/* ==========================================================================
   IT Galaxy — Responsive
   Breakpoints tested: 360, 390, 430, 768, 1024, 1280, 1440, 1920
   ========================================================================== */

/* Large desktop polish (1440+) */
@media (min-width: 1440px) {
    .container { max-width: 1320px; }
}

/* Below 1280: tighten nav gaps */
@media (max-width: 1279.98px) {
    .main-nav > ul { gap: 0; }
    .main-nav a,
    .nav-dropdown-toggle { padding: 10px 10px; font-size: 0.9rem; }
    .search-box input { width: 170px; }
}

/* Below 1024: hide desktop nav/search, show hamburger; 3-col grids */
@media (max-width: 1023.98px) {
    .main-nav, .search-box { display: none; }
    .menu-toggle, #mobileSearchLink { display: inline-flex; }

    .category-grid { grid-template-columns: repeat(2, 1fr); }
    .product-grid { grid-template-columns: repeat(3, 1fr); }
    .feature-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }

    .hero-grid { grid-template-columns: 1fr; }
    .hero-visual { max-width: 460px; }

    .listing-layout { grid-template-columns: 1fr; }
    .filters-panel {
        position: fixed;
        top: 0; right: 0;
        height: 100%;
        width: min(340px, 88vw);
        z-index: 250;
        border-radius: 0;
        transform: translateX(100%);
        transition: transform 0.25s ease;
        overflow-y: auto;
    }
    .filters-panel.is-open { transform: translateX(0); box-shadow: var(--shadow-lg); }
    .filter-drawer-toggle { display: inline-flex; }
    .filters-backdrop {
        display: none;
        position: fixed; inset: 0;
        background: rgba(11,31,61,0.45);
        z-index: 240;
    }
    .filters-backdrop.is-open { display: block; }
    .filters-panel-close { display: inline-flex; }
}

/* Tablet (768–1023): header height & product detail stacking */
@media (max-width: 991.98px) {
    .product-detail { grid-template-columns: 1fr; gap: 28px; }
    .contact-grid { grid-template-columns: 1fr; }
}

/* 768px */
@media (max-width: 767.98px) {
    :root { --header-height: 64px; }
    .section { padding: 40px 0; }
    .container { padding: 0 16px; }
    .brand img { height: 36px; }
    .header-contact-btn { display: none; }

    .category-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
    .feature-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; }

    .section-head { flex-direction: column; align-items: flex-start; gap: 4px; }
    .hero { padding: 40px 0; }
    .hero-actions { flex-direction: column; }
    .hero-actions .btn { width: 100%; }
    .hero-visual { display: none; }

    .cta-band { padding: 32px 20px; }
    .cta-band .cta-actions { flex-direction: column; }
    .cta-band .cta-actions .btn { width: 100%; }

    .product-card-actions { flex-direction: column; }

    .footer-bottom { flex-direction: column; text-align: center; }
}

/* Narrow phones (430 and below) */
@media (max-width: 430px) {
    .category-grid,
    .product-grid { grid-template-columns: 1fr; }
    .brand img { height: 32px; }
    h1 { font-size: 1.6rem; }
    .hero-stat strong { font-size: 1.3rem; }
    .wa-float { bottom: 16px; right: 16px; padding: 12px; }
}

/* Very narrow phones (360–390) keep single-column product cards and full-width CTAs */
@media (max-width: 390px) {
    .icon-btn { width: 40px; height: 40px; }
    .search-box input { width: 100%; }
    .btn { font-size: 0.9rem; }
}
