/* =====================================================
   RESPONSIVE STYLESHEET
   Breakpoints: 1199px / 991px / 767px / 575px
   Covers: home, product-details, contact + common UI
   ===================================================== */

/* =====================================================
   ≤ 1199px — Large desktop / small laptop
   ===================================================== */
@media (max-width: 1199px) {
  :root {
    --section-pad: 80px;
    --h1-size: 2.7rem;
    --h2-size: 2.1rem;
  }

  .container { padding: 0 24px; }

  /* Header */
  .header-top-inner { gap: 22px; }
  .header-search { max-width: 420px; }
  .main-nav .nav-list { gap: 32px; }

  /* Home */
  .feature-grid,
  .category-grid,
  .product-grid,
  .recent-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .trending-track {
    grid-auto-columns: calc((100% - 56px) / 3);
  }

  .promo-content { padding: 60px 50px; }

  /* Product details */
  .pd-grid { gap: 48px; }
  .pd-gallery { top: 140px; }
  .pd-tab-panes { padding: 32px; }

  /* Contact */
  .contact-info-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-form { padding: 36px; }

  /* Auth */
  .auth-section { padding: 60px 0; }
}

/* =====================================================
   ≤ 991px — Tablet landscape
   ===================================================== */
@media (max-width: 991px) {
  :root {
    --section-pad: 64px;
    --header-top-h: 68px;
  }

  /* === Header collapses === */
  .hamburger { display: flex; }

  /* Collapse the nav row to zero height but keep it rendered, so the
     position:fixed mobile drawer (.main-nav) can still display.
     display:none on the parent would block the drawer entirely. */
  .header-nav-row {
    height: 0;
    overflow: visible;
    border: none;
    background: transparent;
  }
  .header-nav-row > .container {
    height: 0;
    padding: 0;
    overflow: visible;
  }

  .header-top-inner {
    gap: 14px;
    flex-wrap: nowrap;
  }

  .header-search {
    flex: 1;
    max-width: none;
    height: 42px;
    padding: 0 4px 0 18px;
  }

  .header-search .search-submit {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
  }
  .header-search .search-submit-text { display: none; }
  .header-search .search-submit-icon { display: inline-flex; }
  .header-search input { font-size: 0.88rem; }

  .auth-buttons { display: none; }
  .header-actions { gap: 10px; }
  .action-btn { width: 38px; height: 38px; font-size: 0.95rem; }

  /* Sign-in icon takes the place of Login/Signup buttons on mobile */
  .action-signin { display: inline-flex; }

  /* Compact user menu (avatar only — chevron hidden) */
  .user-menu-toggle {
    padding: 4px;
    height: 38px;
    width: 38px;
    border-radius: 50%;
    justify-content: center;
  }
  .user-menu-toggle .user-chevron { display: none; }
  .user-avatar { width: 30px; height: 30px; }

  /* Drawer nav — flex column: pinned head + scrollable list + pinned foot */
  .main-nav {
    position: fixed;
    top: 0;
    left: -340px;
    width: 320px;
    height: 100vh;
    height: 100dvh;
    background: var(--bg-white);
    z-index: 105;
    padding: 0 22px;
    transition: left var(--transition);
    overflow: hidden;
    box-shadow: var(--shadow-hover);
    display: flex;
    flex-direction: column;
  }

  .main-nav.open { left: 0; }

  /* === Mobile drawer head — pinned at top === */
  .mobile-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 0 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-white);
    flex-shrink: 0;
  }

  .mobile-drawer-head .logo {
    font-size: 1.15rem;
  }

  .mobile-drawer-head .logo-icon {
    width: 34px;
    height: 34px;
    font-size: 0.85rem;
  }

  .mobile-drawer-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    transition: all var(--transition);
  }

  .mobile-drawer-close:hover {
    background: var(--primary);
    color: #fff;
    transform: rotate(90deg);
  }

  /* === Mobile drawer foot — pinned at bottom === */
  .mobile-drawer-foot {
    display: block;
    padding: 22px 0 22px;
    border-top: 1px solid var(--border);
    background: var(--bg-white);
    flex-shrink: 0;
  }

  .mobile-cta-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    background: var(--primary);
    color: #fff;
    border-radius: 50px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.84rem;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    transition: background var(--transition);
    margin-bottom: 18px;
  }

  .mobile-cta-btn:hover {
    background: var(--primary-dark);
    color: #fff;
  }

  .mobile-contact-card {
    margin-bottom: 18px;
    padding: 14px 14px 6px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-white);
  }

  .mobile-contact-card__title {
    display: block;
    font-size: 0.66rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-muted);
    padding: 0 4px 8px;
    border-bottom: 1px dashed var(--border);
    margin-bottom: 4px;
  }

  .mobile-contact-list {
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .mobile-contact-list li + li {
    border-top: 1px solid var(--border);
  }

  .mobile-contact-list a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 4px;
    color: var(--text);
    transition: color var(--transition);
    min-width: 0;
  }

  .mobile-contact-list a:hover { color: var(--primary); }

  .mcc-ico {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
    transition: all var(--transition);
  }

  .mobile-contact-list a:hover .mcc-ico {
    background: var(--primary);
    color: #fff;
  }

  .mcc-body {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
    min-width: 0;
    flex: 1 1 auto;
  }

  .mcc-label {
    font-size: 0.65rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--text-muted);
    margin-bottom: 2px;
  }

  .mcc-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: inherit;
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  .mcc-arrow {
    font-size: 0.65rem;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: transform var(--transition), color var(--transition);
  }

  .mobile-contact-list a:hover .mcc-arrow {
    color: var(--primary);
    transform: translateX(3px);
  }

  .mobile-social {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 16px;
  }

  .mobile-social a {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: all var(--transition);
  }

  .mobile-social a:hover {
    background: var(--primary);
    color: #fff;
    transform: translateY(-2px);
  }

  .mobile-tagline {
    text-align: center;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin: 0;
    letter-spacing: 0.4px;
  }

  .main-nav .nav-list {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    height: auto;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 6px 0;
  }

  .main-nav .nav-list > li {
    width: 100%;
    height: auto;
    border-bottom: 1px solid var(--border);
    display: block;
  }

  .main-nav .nav-list > li > a {
    width: 100%;
    height: auto;
    padding: 14px 0;
    font-size: 0.92rem;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
  }

  .main-nav .nav-list > li > a > .nav-label {
    width: 100%;
    justify-content: space-between;
  }

  .main-nav .nav-list > li > a::after { display: none; }

  .main-nav .has-dropdown > a .fa-chevron-down {
    transition: transform var(--transition);
    font-size: 0.7rem;
    color: var(--text-light);
  }

  .main-nav .has-dropdown.open > a .fa-chevron-down {
    transform: rotate(180deg);
    color: var(--primary);
  }

  .main-nav .dropdown-menu-custom,
  .main-nav .has-dropdown:hover .dropdown-menu-custom {
    position: static !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
    box-shadow: none;
    background: transparent;
    opacity: 1;
    visibility: visible;
    padding: 6px 0 12px 14px;
    display: none;
    border: none;
    margin: 0;
    min-width: auto;
  }

  .main-nav .dropdown-menu-custom li a {
    padding: 9px 0;
    text-align: left;
    font-size: 0.85rem;
  }

  .main-nav .has-dropdown.open .dropdown-menu-custom { display: block; }

  /* === Hero === */
  .hero-slide { height: clamp(520px, 80vh, 700px); }
  .hero-row {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 30px 0 110px;
  }
  .hero-feature-card {
    width: 100%;
    max-width: 340px;
  }
  .hero-controls { bottom: 26px; }

  /* Promo banner */
  .promo-banner { min-height: 380px; }
  .promo-content { padding: 50px 40px; }
  .promo-overlay {
    background: linear-gradient(180deg, rgba(8, 8, 8, 0.65), rgba(8, 8, 8, 0.45));
  }

  /* Categories / Features */
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .feature-item:nth-child(2n) { border-right: none; }
  .feature-item { padding: 14px; }

  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .product-grid,
  .recent-grid { grid-template-columns: repeat(3, 1fr); }
  .trending-track { grid-auto-columns: calc((100% - 28px) / 2); }

  .testimonial-grid { grid-template-columns: 1fr; max-width: 600px; margin: 0 auto; }

  .newsletter-inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 26px;
  }

  /* Footer */
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 40px;
  }

  /* Banner CTA */
  .banner-cta-inner { padding: 60px 40px; }

  /* Product details */
  .pd-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .pd-gallery { position: static; }
  .pd-thumbs { grid-template-columns: repeat(5, 1fr); }
  .pd-tab-nav { overflow-x: auto; flex-wrap: nowrap; }
  .pd-tab-btn { white-space: nowrap; padding: 16px 20px; font-size: 0.82rem; }
  .pd-desc-grid,
  .pd-shipping-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .pd-trust { grid-template-columns: 1fr; }

  /* Contact */
  .contact-form-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .contact-info-grid { grid-template-columns: repeat(2, 1fr); }
  .support-cta-inner { padding: 40px 36px; }
  .map-card iframe { height: 380px; }

  /* Popup */
  .popup-box { grid-template-columns: 1fr; max-width: 460px; }
  .popup-image { height: 200px; }
  .popup-content { padding: 32px 28px; }

  /* Auth */
  .auth-section { padding: 50px 0; }
  .auth-card { padding: 42px 36px 36px; }
  .auth-head h1 { font-size: 1.7rem; }
}

/* =====================================================
   ≤ 767px — Tablet portrait / large mobile
   ===================================================== */
@media (max-width: 767px) {
  :root {
    --section-pad: 50px;
    --h1-size: 2.1rem;
    --h2-size: 1.7rem;
    --h3-size: 1.15rem;
  }

  .container { padding: 0 18px; }

  /* === Header: 2-row stack === */
  .header-top-inner {
    flex-wrap: wrap;
    height: auto;
    padding: 12px 0;
    gap: 10px 12px;
  }

  .logo { order: 1; font-size: 1.35rem; }
  .logo-icon { width: 36px; height: 36px; font-size: 0.92rem; }

  .hamburger { order: 2; margin-left: auto; padding: 8px; }

  .header-actions { order: 3; gap: 6px; }
  .action-btn { width: 36px; height: 36px; font-size: 0.9rem; }

  .header-search {
    order: 4;
    flex-basis: 100%;
    width: 100%;
    max-width: none;
    height: 42px;
    padding: 0 4px 0 16px;
    border-radius: 50px;
  }

  /* === Hero === */
  .hero-slide { height: clamp(480px, 75vh, 620px); }
  .hero-row { padding: 24px 0 90px; }
  .hero-tag {
    font-size: 0.7rem;
    padding: 7px 16px;
    letter-spacing: 2px;
    margin-bottom: 18px;
    gap: 8px;
  }
  .hero-tag .divider-dot { display: none; }
  .hero-actions { gap: 10px; margin-bottom: 28px; }
  .hero-actions .btn { padding: 12px 22px; font-size: 0.85rem; }
  .hero-meta { gap: 18px; font-size: 0.8rem; }
  .hero-feature-card { display: none; }

  .hero-controls { bottom: 22px; }
  .hero-controls-inner { gap: 14px; }
  .hero-carousel .carousel-indicators { gap: 14px; }
  .hero-carousel .carousel-indicators button .ind-num { font-size: 0.7rem; width: 18px; }
  .hero-carousel .carousel-indicators button::after { width: 18px; }
  .hero-carousel .carousel-indicators button.active::after { width: 36px; }
  .hero-carousel .carousel-control-prev,
  .hero-carousel .carousel-control-next { width: 42px; height: 42px; font-size: 0.85rem; }

  /* Promo */
  .promo-banner { min-height: 340px; }
  .promo-content { padding: 40px 28px; }
  .promo-text { font-size: 0.95rem; margin-bottom: 24px; }
  .promo-actions { gap: 14px; }

  /* Section heads */
  .section-head { margin-bottom: 36px; }

  /* Grids */
  .product-grid,
  .recent-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  .trending-track { grid-auto-columns: calc((100% - 16px) / 2); gap: 16px; }

  .product-info { padding: 16px; }
  .product-name { font-size: 0.95rem; }
  .add-cart-btn { font-size: 0.78rem; padding: 9px; opacity: 1; transform: none; }

  .filter-tabs { gap: 6px; flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
  .filter-tabs::-webkit-scrollbar { display: none; }
  .filter-tab { flex-shrink: 0; padding: 8px 18px; font-size: 0.8rem; }

  /* Trending slider arrows hidden on mobile (CSS scroll snap) */
  .slider-arrow { display: none; }
  .trending-slider {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
  }
  .trending-slider::-webkit-scrollbar { display: none; }
  .trending-track { grid-auto-columns: 70%; transform: none !important; }
  .trending-track .product-card { scroll-snap-align: start; }

  /* Banner CTA */
  .banner-cta-inner { padding: 48px 28px; }

  /* Newsletter form stacks */
  .newsletter-form {
    flex-direction: column;
    background: transparent;
    padding: 0;
    border-radius: 0;
    gap: 10px;
  }
  .newsletter-form input,
  .newsletter-form button {
    border-radius: var(--radius-sm);
    width: 100%;
  }
  .newsletter-form input {
    background: var(--bg-white);
    padding: 14px 18px;
  }

  /* Footer */
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
    text-align: left;
  }
  .footer-bottom { flex-direction: column; text-align: center; }

  /* Page banner */
  .page-banner { padding: 80px 0 70px; }

  /* Product details */
  .pd-section { padding: 40px 0 60px; }
  .pd-name { font-size: 1.65rem; }
  .pd-price-now { font-size: 1.7rem; }
  .pd-price-old { font-size: 1rem; }
  .pd-meta-row { gap: 12px; padding-bottom: 16px; margin-bottom: 18px; }
  .pd-thumbs { grid-template-columns: repeat(4, 1fr); }
  .pd-buy-row .pd-cart-btn,
  .pd-buy-row .pd-buy-btn {
    flex: 1 1 100%;
    min-width: 0;
  }
  .pd-actions-row { gap: 14px; }
  .pd-share { margin-left: 0; width: 100%; padding-top: 4px; }
  .pd-tab-panes { padding: 24px 18px; }
  .pd-rating-big .big-num { font-size: 2.6rem; }

  /* Contact */
  .contact-info-grid { grid-template-columns: 1fr; gap: 18px; }
  .info-card { padding: 28px 22px; }
  .contact-form { padding: 28px 22px; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .support-cta-inner {
    padding: 40px 24px;
    flex-direction: column;
    text-align: center;
  }
  .support-cta-text h2 { font-size: 1.4rem; }
  .support-cta-actions { width: 100%; justify-content: center; }
  .map-card iframe { height: 320px; }

  /* Auth */
  .auth-section { padding: 40px 0; }
  .auth-card {
    padding: 36px 26px 32px;
    border-radius: var(--radius-md);
  }
  .auth-head h1 { font-size: 1.55rem; }
  .auth-head .auth-brand { font-size: 1.1rem; margin-bottom: 18px; }
  .auth-head .auth-brand .logo-icon { width: 34px; height: 34px; }
  .auth-form .form-row { grid-template-columns: 1fr; gap: 0; }
  .auth-form-meta { gap: 10px; }

  /* Toast / Back-to-top */
  .toast-msg { bottom: 20px; font-size: 0.82rem; padding: 10px 18px; }
  .back-to-top { bottom: 20px; right: 20px; width: 40px; height: 40px; }
  .whatsapp-float { bottom: 20px; left: 20px; width: 48px; height: 48px; font-size: 1.35rem; }

  /* Announcement */
  .announcement-bar { font-size: 0.74rem; height: 36px; }
}

/* =====================================================
   ≤ 575px — Mobile
   ===================================================== */
@media (max-width: 575px) {
  :root {
    --h1-size: 1.85rem;
    --h2-size: 1.5rem;
  }

  .container { padding: 0 14px; }

  /* Header smaller badges */
  .header-actions .badge-count {
    width: 16px; height: 16px;
    font-size: 0.6rem;
    top: -3px; right: -3px;
  }
  /* User dropdown anchored to viewport edge so it doesn't overflow */
  .user-menu-dropdown {
    right: -10px;
    min-width: 230px;
  }

  /* Hero */
  .hero-actions {
    gap: 10px;
    flex-direction: column;
    align-items: stretch;
  }
  .hero-actions .btn { width: 100%; justify-content: center; }
  .hero-meta {
    flex-direction: column;
    gap: 10px;
  }

  /* Hero arrows hidden — only indicators */
  .hero-arrows { display: none; }

  /* Smaller tag/cart on cards */
  .product-tag { top: 10px; left: 10px; font-size: 0.62rem; padding: 4px 9px; }
  .add-cart-btn { bottom: 10px; left: 10px; right: 10px; padding: 7px; font-size: 0.7rem; }
  .product-info { padding: 12px; }
  .product-name { font-size: 0.85rem; }
  .price-now { font-size: 0.95rem; }
  .price-old { font-size: 0.78rem; }

  /* Categories */
  .category-overlay { padding: 18px; }
  .category-overlay h3 { font-size: 1.2rem; }
  .category-overlay span { font-size: 0.74rem; }

  /* Promo */
  .promo-banner { min-height: 300px; border-radius: var(--radius-md); }
  .promo-content { padding: 30px 20px; }

  /* Banner CTA */
  .banner-cta-inner { padding: 36px 20px; border-radius: var(--radius-md); }
  .banner-cta-perks li { font-size: 0.88rem; }
  .banner-cta-actions { width: 100%; }
  .banner-cta-actions .btn { flex: 1 1 auto; justify-content: center; min-width: 140px; }

  /* Footer */
  .social-links a { width: 34px; height: 34px; font-size: 0.82rem; }
  .payment-methods { font-size: 1.4rem; gap: 10px; }

  /* Popup */
  .popup-content { padding: 24px 20px; }
  .popup-content h2 { font-size: 1.3rem; }
  .popup-image { height: 150px; }
  .popup-close { width: 32px; height: 32px; top: 10px; right: 10px; }

  /* Page banner */
  .page-banner { padding: 60px 0 56px; }
  .page-banner h1 { font-size: 1.85rem; }
  .page-banner p { font-size: 0.95rem; }

  /* Product details */
  .pd-thumbs { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .pd-trust-item { font-size: 0.78rem; }
  .pd-tab-btn { padding: 14px 16px; font-size: 0.78rem; }
  .pd-rating-big { gap: 14px; }
  .pd-rating-big .big-num { font-size: 2.2rem; }
  .pd-review-summary { gap: 16px; }

  /* Contact form */
  .contact-form h3 { font-size: 1.25rem; }
  .form-group input,
  .form-group select,
  .form-group textarea { padding: 12px 14px; font-size: 0.9rem; }
  .info-icon { width: 56px; height: 56px; font-size: 1.2rem; }
  .info-card h3 { font-size: 1.1rem; }
  .map-card iframe { height: 280px; }

  /* Support CTA */
  .support-cta-icon { width: 60px; height: 60px; font-size: 1.3rem; }

  /* Auth */
  .auth-section { padding: 28px 0; }
  .auth-card { padding: 30px 20px 26px; }
  .auth-head h1 { font-size: 1.4rem; }
  .auth-head p { font-size: 0.86rem; }
  .btn-social { padding: 12px 16px; font-size: 0.9rem; }
}

/* =====================================================
   PRINT
   ===================================================== */
@media print {
  .site-header,
  .site-footer,
  .popup-overlay,
  .back-to-top,
  .whatsapp-float,
  .toast-msg,
  .hero-section,
  .banner-cta,
  .page-banner,
  .pd-buy-row,
  .pd-actions-row,
  .contact-support-cta {
    display: none !important;
  }
  body { background: #fff; color: #000; }
}
