/* Large Desktop - Keep inline side by side (990px and above) */
@media (min-width: 1400px) {
  .hero-title { font-size: 4.2rem; }
  .hero-description { font-size: 1.25rem; }
  .hero-visual-wrapper { max-width: 550px; }
  .floating-element {min-width: 160px; max-width: 340px; padding: 12px 16px;}
}

@media (max-width: 1399px) {
  .hero-visual-wrapper { max-width: 480px; }
  .element-icon { font-size: 1.5rem; }
  .element-title { font-size: 0.9rem; }
}

@media (max-width: 1199px) {
  .hero-section { padding: 100px 0 80px;}
  .hero-title { font-size: 3.2rem; }
  .hero-visual-wrapper { max-width: 440px; }
  .floating-element { min-width: 130px; max-width: 300px; padding: 12px 16px; }
  .element-icon { font-size: 1.3rem; }
  .element-title { font-size: 0.75rem; }
  .element-subtitle { font-size: 0.65rem; }
  .hero-video-card { width: 65%; }
  .floating-element-1 { top: -15%; left: 20%}
  .floating-element-2 { top: 12%; right: -5%; }
  .floating-element-3 { bottom: 10%; }
  .floating-element-4 { bottom: 0%; }
  .floating-element-5 { top: 10%; left: -15%; }

  .contact-hero-title { font-size: 2.8rem; }
    .form-wrapper { padding: 35px; }
}

@media (min-width: 990px) {
  .banner-logo {
    justify-content: flex-start;
  }
  
  .banner-content {
    text-align: right;
  }
}

/* Tablet and Mobile - Stack vertically and center (989px and below) */
@media (max-width: 991px) {
  .top-banner {
    padding: 15px 0;
  }
  .banner-logo {
    display: block;
    text-align: center;
    margin-bottom: 15px;
    width: 100%;
  }
  .banner-logo img {
    max-height: 70px;
    margin: 0 auto;
  }
  .banner-content {
    display: block;
    text-align: center;
    width: 100%;
  }
  .company-name {
    font-size: 1.4rem;
  }
  .company-tagline {
    font-size: 0.95rem;
  }
  .company-info {
    font-size: 0.85rem;
  }
  .theme-toggle-container {
    margin-left: 0;
    margin-top: 10px;
    justify-content: center;
    padding-bottom: 10px;
  }
  .theme-toggle-btn {
    width: 42px;
    height: 42px;
  }
  .theme-icon {
    width: 20px;
    height: 20px;
  }
  .hero-section { padding: 80px 0 60px; min-height: auto; }
  .hero-content { padding-right: 0; margin-bottom: 60px; text-align: center; align-items: center; }
  .hero-title { font-size: 2.8rem; }
  .hero-description { max-width: 100%; margin-left: auto; margin-right: auto; }
  .hero-buttons { justify-content: center; margin-bottom: 50px; }
  .hero-stats { justify-content: center; gap: 35px; }
  .hero-badge { margin: 0 auto 30px; }
  .hero-visual { padding: 40px 0; }
  .hero-visual-wrapper { max-width: 450px; }
  .scroll-indicator { bottom: 20px; }
  .technologies-section .card { min-height: 240px; }
  
  /* Hide floating elements on tablet */
  .floating-element { display: none !important; }
  .hero-video-card { width: 85%; }

  .services-section { padding: 80px 0; }
  .section-title h2 { font-size: 2.2rem; }
  .footer-copyright span {
        font-size: 0.8rem;
    }
  .nav-footer .nav-link {
        font-size: 0.8rem;
        padding: 5px 10px;
    }

    .svc-hero-section {
        padding: 100px 0 80px;
    }
    .svc-hero-title {
        font-size: 2.8rem;
    }

    .svc-filter-buttons {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 10px;
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
    .svc-filter-buttons::-webkit-scrollbar {
        display: none;
    }
    .svc-filter-btn {
        flex-shrink: 0;
    }

    .prod-hero-section { padding: 60px 0; }
    .prod-hero-title { font-size: 2.8rem; }

    .modal-img-container {
        height: 300px; /* Fixed height for tablet/mobile */
        min-height: auto;
    }
    .product-modal .modal-dialog {
        margin: 10px; /* Add margin on mobile so it doesn't touch edges */
    }
    .modal-details {
        padding: 20px !important;
    }

    .contact-hero-section { padding: 80px 0 60px; }
    .contact-hero-title { font-size: 2.5rem; }
    .form-wrapper { padding: 30px 25px; margin-top: 30px; }
    /* On tablet, form usually comes first or stacks nicely */
    .contact-info-wrapper { margin-top: 40px; }

    .about-hero-section { padding: 60px 0; text-align: center; }
    .about-hero-title { font-size: 2.8rem; }
    .hero-img-wrapper { display: none; } /* Hide hero img on tablet/mobile */
    
    .chairman-card .row { flex-direction: column; }
    /* Reset main container height for mobile stacking */
    .chairman-img-container-main { height: auto; min-height: 350px; }
    .chairman-img-container { width: 70%; aspect-ratio: 3/4; transform: scale(1); } /* Reset scale on mobile */
    .chairman-info { padding: 30px; text-align: center; }
    .chairman-header { flex-direction: column; gap: 10px; }
    
    /* Reset team modal wrapper for mobile */
    .modal-team-img-wrapper { height: auto; min-height: 350px; }
    .modal-team-img-inner { width: 70%; }
}

@media (max-width: 767px) {
  .hero-section { padding: 60px 0 40px; }
  .hero-title { font-size: 2.2rem; }
  .hero-description { font-size: 1.05rem; margin-bottom: 30px; }
  .hero-buttons { flex-direction: column; gap: 16px; margin-bottom: 40px; }
  .btn-hero-primary, .btn-hero-secondary { width: 100%; padding: 14px 32px; }
  .hero-stats { gap: 25px; }
  .stat-number { font-size: 2rem; }
  .stat-divider { height: 50px; }
  .hero-visual { padding: 15px 0; }
  .hero-visual-wrapper { max-width: 90%; aspect-ratio: auto; height: auto; }
  .hero-video-card { position: relative; width: 100%; aspect-ratio: 16 / 9; transform: none; left: auto; top: auto;}
  .hero-video-card:hover { transform: translateY(-5px); }
  .shape { opacity: 0.04; }
  .scroll-indicator { visibility: hidden; opacity: 0; }
  .scroll-arrow svg { width: 24px; height: 24px; }
  .technologies-section { padding: 60px 0; }
  .technologies-section .card { min-height: 220px; padding: 25px 15px; }
  .technologies-section .card-title { font-size: 1.1rem; min-height: 50px; }
  .technologies-section .card-text { font-size: 0.9rem; }
  
  .services-section { padding: 60px 0; }
  .section-title h2 { font-size: 2rem; }
  .section-title { margin-bottom: 40px; }
  .service-card { padding: 30px 25px; }
  .service-icon { width: 60px; height: 60px; font-size: 1.8rem; }
  
  .footer-bottom {
        padding: 10px 15px;
    }
    .footer-content {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    .footer-copyright span {
        font-size: 0.75rem;
    }
    .nav-footer {
        gap: 8px;
    }
    .nav-footer .nav-link {
        font-size: 0.75rem;
        padding: 4px 8px;
    }

    .svc-hero-section {
        padding: 80px 0 60px;
        text-align: center;
    }
    .svc-hero-subtitle {
        font-size: 0.9rem;
        letter-spacing: 1.5px;
    }
    .svc-hero-title {
        font-size: 2.2rem;
        margin-bottom: 15px;
    }
    .svc-hero-desc {
        font-size: 1rem;
        padding: 0 15px;
    }

    .svc-search-filter-section {
        top: 60px;
    }
    .svc-cta-strip {
        text-align: center;
        padding: 40px 0;
    }
    .svc-cta-strip .d-flex {
        justify-content: center !important;
        flex-direction: column;
    }
    .svc-cta-strip .btn {
        width: 100%;
    }

    .prod-hero-section { padding: 50px 0; text-align: center; }
    .prod-hero-title { font-size: 2.2rem; }
    .prod-hero-desc { margin: 0 auto; font-size: 1rem; }

    .toolbar-section .row {
        flex-direction: column-reverse; /* Put search on top for mobile */
        gap: 10px;
    }
    .results-count {
        text-align: center;
        font-size: 0.85rem;
    }
    .active-filters {
        text-align: center;
    }

    .contact-hero-section { padding: 60px 0 50px; text-align: center; }
    .contact-hero-desc { margin: 0 auto; font-size: 1rem; }
    .contact-hero-title { font-size: 2.2rem; }
    
    /* Stack Info Cards more compactly */
    .info-card { padding: 20px; flex-direction: row; text-align: left; }
    .info-content h5 { font-size: 1rem; }
    
    /* Adjust Form */
    .form-wrapper { padding: 25px 20px; }
    .form-header h3 { font-size: 1.5rem; }
    
    /* Ensure map doesn't break layout */
    .map-container { height: 250px; margin-top: 30px; }

    .about-hero-title { font-size: 2.2rem; }
    .founder-story-card .row { flex-direction: column; }
    .founder-story-card img { height: 250px; width: 100%; }
    
    .team-img-wrapper { height: 350px; } /* Taller images for stacked mobile cards */
}

/* Small Mobile (576px and below) */
@media (max-width: 576px) {
  .top-banner {
    padding: 12px 0;
  }
  .banner-logo img {
    max-height: 55px;
  }
  .company-name {
    font-size: 1.1rem;
  }
  .company-tagline {
    font-size: 0.85rem;
  }
  .company-info {
    font-size: 0.75rem;
  }
  .navbar {
    padding: 12px 0;
  }
  .navbar-brand {
    font-size: 1.2rem;
  }
  .navbar-brand img {
    height: 35px;
  }
  .theme-toggle-btn {
    width: 38px;
    height: 38px;
  }
  .theme-icon {
    width: 18px;
    height: 18px;
  }
  .hero-section { padding: 50px 0 30px; }
  .hero-title { font-size: 1.9rem; }
  .hero-description { font-size: 1rem; }
  .hero-badge { padding: 8px 18px; }
  .badge-text { font-size: 0.85rem; }
  .hero-stats { flex-direction: column; gap: 20px; }
  .stat-item { text-align: center; }
  .stat-divider { width: 120px; height: 2px; }
  .hero-video-card { border-radius: 20px; }
  .hero-visual-wrapper { padding:0 10px; }
  .hero-video { border-radius: 20px; }
  .scroll-indicator { bottom: 10px; }
  .technologies-section { padding: 50px 0; }
  .technologies-section .card { min-height: 200px; padding: 20px 15px; }
  .technologies-section .card-title { font-size: 1rem; min-height: 45px; }

  .footer-copyright span {
        font-size: 0.7rem;
    }

    .nav-footer .nav-link {
        font-size: 0.7rem;
        padding: 3px 6px;
    }

    .prod-hero-title { font-size: 1.8rem; }
    .cat-card { min-width: 130px; height: 80px; }
    .cat-card-title { font-size: 0.85rem; }
    .category-row-wrapper { margin: 0; } /* Remove button margin on mobile */
    .cat-nav-btn { display: none; } /* Hide buttons on mobile, use touch scroll */

    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 15px;
    }
    .prod-card { height: 350px; }

    .modal-img-container { height: 220px; }
    .modal-title { font-size: 1.5rem; }
    .specs-grid { grid-template-columns: 1fr; gap: 10px; } /* Stack specs on very small screens */

    .contact-hero-title { font-size: 1.8rem; }
    .contact-hero-subtitle { font-size: 0.8rem; letter-spacing: 1px; }
    
    /* Stack icon and text in info cards for very small screens */
    .info-card { flex-direction: column; align-items: flex-start; gap: 15px; }
    .icon-wrapper { width: 40px; height: 40px; font-size: 1.2rem; }
    
    /* Phone Input Group adjustment */
    .input-group-custom .form-select { max-width: 85px !important; padding-right: 25px; text-overflow: ellipsis; }
    
    /* Form padding */
    .form-wrapper { padding: 20px 15px; border-radius: 12px; }
    
    .hours-list li { flex-direction: column; gap: 2px; margin-bottom: 8px; }
}

@media (max-width: 480px) {
    .svc-hero-title {
        font-size: 1.8rem;
    }
}

/* Extra Small Mobile (400px and below) */
@media (max-width: 400px) {
  .banner-logo img {
    max-height: 50px;
  }

  .company-name {
    font-size: 1rem;
  }

  .company-tagline {
    font-size: 0.8rem;
  }

  .company-info {
    font-size: 0.7rem;
  }
  .hero-title { font-size: 1.7rem; }
  .stat-number { font-size: 1.8rem; }
  .scroll-indicator { display: none !important; }
  .technologies-section .card { min-height: 180px; }
}