/* ===== MOBILE DEVICES (320px - 767px) ===== */
@media (max-width: 767.98px) {
  /* General Layout */
  .container,
  .container-fluid {
    padding-left: 15px;
    padding-right: 15px;
    max-width: 100%;
    overflow-x: hidden;
  }

  /* Navbar - Mobile */
  .navbar {
    padding: 8px 0;
  }

  .navbar-brand {
    display: flex;
    align-items: center;
  }

  .logo-img {
    height: 40px !important;
    width: auto !important;
  }

  .navbar-brand h2 {
    font-size: 1.1rem !important;
    margin-left: 8px;
  }

  .navbar-toggler {
    padding: 4px 8px;
    font-size: 0.9rem;
  }

  .navbar-collapse {
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    margin-top: 10px;
  }

  .navbar-nav .nav-link {
    text-align: center;
    padding: 10px 15px !important;
    margin: 2px 0 !important;
    border-radius: 10px !important;
    font-size: 0.9rem;
  }

  /* About Section - Stack on Mobile */
  .about-modern .row {
    flex-direction: column;
    gap: 2rem;
  }

  .about-image-card {
    margin-bottom: 2rem;
    text-align: center;
  }

  .about-image-card img {
    max-width: 100%;
    height: auto;
  }

  .about-content {
    text-align: center;
  }

  .about-text {
    font-size: 0.9rem !important;
    line-height: 1.6;
  }

  .about-list li {
    font-size: 0.85rem !important;
    margin-bottom: 8px;
    text-align: left;
  }

  /* Hero Section */
  .carousel-section {
    margin-top: 66px;
  }

  .hero-carousel .carousel-item {
    height: 50vh;
    min-height: 350px;
  }

  .carousel-caption {
    bottom: 20px;
    transform: none;
    text-align: center;
    padding: 15px;
  }

  .carousel-caption h1 {
    font-size: 1.6rem !important;
    margin-bottom: 10px;
  }

  .carousel-caption p {
    font-size: 0.9rem !important;
    margin-bottom: 15px;
  }


  /* Why Choose Us Section */
  #why-choose {
    padding: 3rem 0 !important;
  }

  .choose-card {
    padding: 1.5rem !important;
    margin-bottom: 1.5rem;
  }

  .choose-icon {
    width: 60px !important;
    height: 60px !important;
    font-size: 1.5rem !important;
    margin-bottom: 1rem !important;
  }

  .counter {
    font-size: 1.8rem !important;
  }

  .choose-card h5 {
    font-size: 1.1rem !important;
  }

  .choose-card p {
    font-size: 0.85rem !important;
  }

  /* Services Section */
  .service-item {
    margin-bottom: 2rem;
    height: auto !important;
  }

  .service-icon {
    width: 50px !important;
    height: 50px !important;
    font-size: 1.2rem !important;
    margin-top: -25px !important;
  }

  .service-item h4 {
    font-size: 1.1rem !important;
  }

  .service-item p {
    font-size: 0.85rem !important;
  }

  /* Products Section */
  .product-section {
    padding: 3rem 0 !important;
  }

  .product-item {
    margin-bottom: 2rem;
    height: auto !important;
  }

  .product-icon {
    width: 50px !important;
    height: 50px !important;
    font-size: 1.2rem !important;
    margin-top: -25px !important;
  }

  .product-badge {
    font-size: 0.7rem !important;
    padding: 4px 10px !important;
  }

  /* Quote Section */
  .quote-modern {
    padding: 3rem 0 !important;
  }

  .quote-form-card {
    padding: 1.5rem !important;
  }

  .quote-form-card h1 {
    font-size: 1.5rem !important;
  }

  .quote-image-card {
    margin-bottom: 2rem;
  }

  /* Contact Section */
  #contact {
    padding: 3rem 0 !important;
  }

  .contact-info-card,
  .contact-form,
  .contact-map {
    margin-bottom: 2rem;
    height: auto !important;
  }

  .contact-form {
    padding: 1.5rem !important;
  }

  .contact-map iframe {
    height: 250px !important;
  }

  /* Section Titles */
  .section-title {
    font-size: 1.6rem !important;
    margin-bottom: 2rem !important;
  }

  /* Buttons */
  .btn-primary,
  .btn-modern {
    padding: 10px 20px !important;
    font-size: 0.9rem;
  }

  /* Floating Buttons */
  .floating-btn {
    width: 45px;
    height: 45px;
    font-size: 1.1rem;
    right: 15px;
  }

  .whatsapp-btn {
    bottom: 70px;
  }

  .back-to-top {
    bottom: 15px;
  }

  .service-icon,
  .product-icon,
  .project-icon {
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
  }
  .service-icon i {
    font-size: 30px;
  }

  .product-icon i {
    font-size: 30px;
  }
}

/* ===== TABLET DEVICES (768px - 1024px) ===== main */
@media (min-width: 768px) and (max-width: 1024px) {
  /* Navbar - Compact Single Row with Left Space */
  .container,
  .container-fluid {
    padding-left: 15px;
    padding-right: 15px;
    max-width: 100%;
    overflow-x: hidden;
  }

  /* Navbar - Mobile */
  .navbar {
    padding: 8px 0;
  }

  .navbar-brand {
    display: flex;
    align-items: center;
  }

  .logo-img {
    height: 40px !important;
    width: auto !important;
  }

  .navbar-brand h2 {
    font-size: 1.1rem !important;
    margin-left: 8px;
  }

  .navbar-toggler {
    padding: 4px 8px;
    font-size: 0.9rem;
  }

  .navbar-collapse {
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    margin-top: 10px;
  }

  .navbar-nav .nav-link {
    text-align: center;
    padding: 10px 15px !important;
    margin: 2px 0 !important;
    border-radius: 10px !important;
    font-size: 0.9rem;
  }

  .about-modern .col-lg-6:first-child {
    order: 1;
  }

  .about-modern .col-lg-6:last-child {
    order: 2;
  }

  /* Image Card Styling */
  .about-image-card {
    width: 100% !important;
    margin-bottom: 0 !important;
    position: relative;
  }

  .about-image-card img {
    width: 100% !important;
    height: 350px !important;
    object-fit: cover !important;
    border-radius: 15px;
    display: block !important;
  }

  /* Content Styling */
  .about-content {
    width: 100% !important;
    display: block !important;
  }

  .about-modern h6.text-accent {
    text-align: left !important;
    display: block !important;
    color: #ffe082 !important;
    margin-bottom: 1rem !important;
  }

  .about-modern .section-title {
    text-align: left !important;
    font-size: 2rem !important;
    color: white !important;
    margin-bottom: 1.5rem !important;
    display: block !important;
  }

  .about-text {
    text-align: left !important;
    font-size: 0.95rem !important;
    line-height: 1.7 !important;
    color: rgba(255, 255, 255, 0.9) !important;
    margin-bottom: 1.5rem !important;
    display: block !important;
  }

  /* List Styling */
  .about-list {
    text-align: left !important;
    margin-bottom: 2rem !important;
    padding: 0 !important;
    display: block !important;
  }

  .about-list li {
    text-align: left !important;
    font-size: 0.9rem !important;
    margin-bottom: 12px !important;
    padding-left: 35px !important;
    color: rgba(255, 255, 255, 0.9) !important;
    display: block !important;
    position: relative;
  }

  .about-list li i {
    position: absolute !important;
    left: 0 !important;
    top: 2px !important;
    color: #ffe082 !important;
    font-size: 18px !important;
  }

  /* Button Styling */
  .btn-modern {
    display: inline-block !important;
    text-align: left !important;
    margin-top: 1rem !important;
  }

  /* Floating Elements */
  .floating-icon {
    display: block !important;
    position: absolute !important;
    font-size: 24px !important;
    color: rgba(255, 255, 255, 0.7) !important;
  }

  .floating-badge {
    display: block !important;
    position: absolute !important;
    bottom: 20px;
    left: 20px;
    background: linear-gradient(135deg, #87ceeb, #2e8b57);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
  }

  /* Ensure all service cards are equal height */
  #services .row.g-4 {
    display: flex;
    flex-wrap: wrap;
  }

  #services .row.g-4 > [class*="col-"] {
    display: flex;
  }

  #services .service-item {
    display: flex;
    flex-direction: column;
    height: 100%;
  }

  #services .service-item img {
    object-fit: cover;
    width: 100%;
    height: 220px; /* keep images consistent */
  }

  #services .position-relative.p-4.pt-0 {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }

  .service-icon,
  .product-icon,
  .project-icon {
    width: 65px;
    height: 65px;
    font-size: 1.6rem;
  }

  .service-icon i {
    font-size: 30px;
  }

  .product-icon i {
    font-size: 30px;
  }
}

/* ===== TABLET PORTRAIT (768px - 900px) ===== */
@media (min-width: 768px) and (max-width: 900px) {
  .navbar-nav .nav-link {
    padding: 5px 8px !important;
    font-size: 0.75rem !important;
    margin: 0 1px !important;
  }

  .navbar-brand h2 {
    font-size: 0.9rem !important;
    margin-left: 5px !important;
  }

  .logo-img {
    height: 32px !important;
  }

  .navbar .btn-primary {
    padding: 5px 10px !important;
    font-size: 0.75rem !important;
    margin-right: 12px !important;
  }

  .navbar-nav {
    gap: 0.3rem !important;
  }

  .navbar-brand {
    margin-left: 12px !important;
  }
}

/* ===== TABLET LANDSCAPE (901px - 1024px) ===== */
@media (min-width: 901px) and (max-width: 1024px) {
  .navbar-nav .nav-link {
    padding: 7px 12px !important;
    font-size: 0.85rem !important;
    margin: 0 3px !important;
  }

  .navbar-brand h2 {
    font-size: 1.1rem !important;
    margin-left: 8px !important;
  }

  .logo-img {
    height: 38px !important;
  }

  .navbar .btn-primary {
    padding: 7px 14px !important;
    font-size: 0.85rem !important;
    margin-right: 18px !important;
  }

  .navbar-nav {
    gap: 0.7rem !important;
  }

  .navbar-brand {
    margin-left: 18px !important;
  }
}

@media (min-width: 1024px) and (max-width: 1288px) {
  /* Navbar - Compact Single Row with Left Space */
  .navbar {
    padding: 8px 0 !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: nowrap !important;
  }

  .navbar > .container,
  .navbar > .container-fluid {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }

  .navbar-collapse {
    display: flex !important;
    flex: 1 !important;
    justify-content: center !important;
    margin-top: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin-left: 1rem !important;
    margin-right: 1rem !important;
  }

  .navbar-nav {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    margin: 0 !important;
    flex-wrap: nowrap !important;
    gap: 0.5rem !important;
  }

  .navbar-nav .nav-link {
    padding: 6px 10px !important;
    margin: 0 2px !important;
    font-size: 0.8rem !important;
    white-space: nowrap !important;
    font-weight: 500 !important;
  }

  .navbar-toggler {
    display: none !important;
  }

  /* Logo and Brand - Compact with Left Space */
  .navbar-brand {
    display: flex !important;
    align-items: center !important;
    flex-shrink: 0 !important;
    margin-right: 0 !important;
    padding: 0 !important;
    margin-left: 15px !important; /* Added left space */
  }

  .logo-img {
    height: 35px !important;
    width: auto !important;
  }

  .navbar-brand h2 {
    font-size: 1rem !important;
    margin-left: 6px !important;
    white-space: nowrap !important;
    font-weight: 600 !important;
  }

  /* Get Quote Button - Compact */
  .navbar .btn-primary {
    display: inline-block !important;
    padding: 6px 12px !important;
    font-size: 0.8rem !important;
    margin-right: 15px !important; /* Added right space */
    white-space: nowrap !important;
    border-radius: 20px !important;
  }

  /* Remove borders and extra spacing */
  .navbar-brand.border-end {
    border-right: none !important;
  }

  .d-none.d-lg-block {
    display: inline-block !important;
  }

  /* Ensure proper spacing */
  .navbar > .container-fluid {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: nowrap !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
}
