/* ============================================
   MANFARE - Responsive Stylesheet
   ============================================ */

/* ---------- Tablet (max 1024px) ---------- */
@media (max-width: 1024px) {
  :root {
    --container-max: 960px;
  }

  .header-main {
    grid-template-columns: auto 1fr auto;
    gap: 12px;
  }

  .site-logo { order: -1; justify-self: start; }
  .header-left { order: -1; }
  .header-search { order: 1; max-width: none; }
  .header-icons { order: 2; }

  .nav-list { gap: 0; }
  .nav-link { padding: 14px 12px; font-size: 0.72rem; }

  .mega-menu { width: 560px; }
  .mega-menu-grid { grid-template-columns: repeat(3, 1fr); }

  .features-grid { grid-template-columns: repeat(2, 1fr); }

  .brand-inner { grid-template-columns: 1fr; gap: 40px; }
  .brand-img-grid { max-width: 500px; margin: 0 auto; }

  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }

  .newsletter-box {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 36px 40px;
  }
  .newsletter-form { min-width: unset; width: 100%; }

  .luxury-layout { gap: 16px; }
  .luxury-banner { flex: 0 0 220px; width: 220px; }

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

/* ---------- Mobile Large (max 768px) ---------- */
@media (max-width: 768px) {
  /* Header */
  .topbar-left, .topbar-right { display: none; }
  .topbar { text-align: center; font-size: 0.72rem; }

  /* Mobile header: [ Hamburger ] [ Logo Center ] [ Cart + User ] */
  .header-main {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    gap: 0;
  }

  /* Left slot: only show hamburger, hide search bar */
  .header-left {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
  }

  .header-search {
    display: none;
  }

  /* Center: logo */
  .site-logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
  }

  /* Right slot: icon buttons only */
  .header-icons {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 0 0 auto;
  }

  /* Hide phone number on mobile */
  .header-phone { display: none; }

  /* Hide wishlist on mobile to save space */
  .header-icons .icon-btn[aria-label="Wishlist"] { display: none; }

  /* Ensure cart & user icons are visible and touch-friendly */
  .header-icons .icon-btn {
    display: flex;
    width: 40px;
    height: 40px;
    font-size: 1.15rem;
    padding: 8px;
    -webkit-tap-highlight-color: rgba(0,0,0,0.05);
  }

  /* Mobile hamburger */
  .mobile-menu-btn {
    display: flex;
    width: 40px;
    height: 40px;
    padding: 8px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    border-radius: 8px;
    -webkit-tap-highlight-color: rgba(0,0,0,0.05);
    transition: background 0.2s;
  }

  .mobile-menu-btn:hover,
  .mobile-menu-btn:active {
    background: var(--color-bg-2);
  }

  /* Nav */
  .site-nav { display: none; }
  .site-nav.nav-open { display: block; }

  .nav-list {
    flex-direction: column;
    padding: 10px 0;
  }

  .nav-item { width: 100%; }

  .nav-link {
    padding: 12px 20px;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.9);
    justify-content: space-between;
  }

  .dropdown,
  .mega-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    border-radius: 0;
    width: 100%;
    background: rgba(0,0,0,0.18);
    display: none;
    padding: 4px 0;
    flex-direction: column;
  }

  .nav-item.open .dropdown,
  .nav-item.open .mega-menu {
    display: block;
  }

  /* Mobile dropdown items */
  .dropdown-label {
    color: var(--color-gold);
    padding: 10px 20px 6px;
    font-size: 0.6rem;
  }

  .dropdown-item a {
    color: rgba(255,255,255,0.8);
    padding: 10px 32px;
    font-size: 0.82rem;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    background: transparent;
  }

  .dropdown-item a::before { background: var(--color-gold); }

  .dropdown-item a:hover {
    color: var(--color-gold);
    background: rgba(255,255,255,0.08);
    padding-left: 38px;
  }

  /* Mobile mega menu: stack vertically */
  .mega-menu {
    display: none;
    flex-direction: column;
  }

  .nav-item.open .mega-menu {
    display: flex;
  }

  .mega-links {
    flex: none;
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding: 6px 0;
  }

  .mega-links-label {
    color: var(--color-gold);
    padding: 10px 20px 6px;
    font-size: 0.6rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }

  .mega-links ul li a {
    color: rgba(255,255,255,0.8);
    padding: 10px 32px;
    font-size: 0.82rem;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    background: transparent;
  }

  .mega-links ul li a:hover {
    color: var(--color-gold);
    background: rgba(255,255,255,0.08);
    padding-left: 38px;
  }

  .mega-featured { display: none; } /* hide featured cards on mobile */

  /* Hero */
  .hero-swiper { height: 420px; }

  .hero-content h1 { font-size: 1.8rem; }
  .hero-content p { font-size: 0.85rem; }

  /* Features */
  .features-grid { grid-template-columns: 1fr 1fr; }
  .feature-item { padding: 16px 18px; gap: 10px; }
  .feature-icon { width: 40px; height: 40px; font-size: 1.1rem; }

  /* Sections */
  .section-header { flex-direction: column; align-items: flex-start; gap: 10px; }

  /* Luxury layout */
  .luxury-layout { flex-direction: column; }
  .luxury-banner { flex: 0 0 auto; width: 100%; min-height: 220px; max-height: 280px; }

  /* Brand */
  .brand-stats { grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .stat-number { font-size: 1.5rem; }

  /* Newsletter */
  .newsletter-box { padding: 28px 24px; }
  .newsletter-text h3 { font-size: 1.2rem; }
  .newsletter-form { flex-direction: column; }

  /* Footer */
  .footer-grid { grid-template-columns: 1fr; gap: 30px; }
  .footer-bottom { flex-direction: column; text-align: center; gap: 14px; }
  .payment-icons { justify-content: center; }

  /* Promo */
  .promo-banner-full { height: 260px; }
  .promo-banner-full .promo-overlay { padding: 0 24px; }
  .promo-text-box { padding: 22px 20px; }
}

/* ---------- Mobile Small (max 480px) ---------- */
@media (max-width: 480px) {
  .hero-swiper { height: 320px; }

  .hero-overlay { padding: 0 5%; }
  .hero-content h1 { font-size: 1.5rem; }
  .hero-content p { display: none; }
  .hero-btns { gap: 10px; }
  .btn-primary, .btn-outline { padding: 10px 22px; font-size: 0.75rem; }

  /* Keep 2 features per row on small mobile for compact look */
  .features-grid { grid-template-columns: 1fr 1fr; }
  .feature-item {
    padding: 14px 10px;
    gap: 8px;
    border-right: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
  }
  .feature-item:nth-child(2n) { border-right: none; }
  .feature-item:nth-last-child(-n+2) { border-bottom: none; }
  .feature-icon { width: 34px; height: 34px; font-size: 0.95rem; }
  .feature-text h4 { font-size: 0.7rem; letter-spacing: 0.03em; line-height: 1.25; }
  .feature-text p { font-size: 0.64rem; line-height: 1.3; }

  .section-title { font-size: 1.3rem; }

  .brand-stats { grid-template-columns: 1fr; max-width: 200px; }

  .swiper-nav-prev { left: -8px; }
  .swiper-nav-next { right: -8px; }

  .video-grid { gap: 14px; }

  .footer-top { padding: 40px 0 28px; }
  .social-links { gap: 8px; }

  .promo-banner-full { height: 200px; }
  .promo-text-box { padding: 16px; }
  .promo-text-box p { display: none; }
}

/* ---------- Large screens ---------- */
@media (min-width: 1400px) {
  :root { --container-max: 1400px; }
  .hero-swiper { height: 640px; }
}

/* Shirt mega menu mobile adjustments */
@media (max-width: 768px) {
  .mega-feature-img-wrap { display: none; }
  .mega-links--wide { min-width: unset; flex: none; }
}

/* ============================================================
   V4 RESPONSIVE UPDATES
   ============================================================ */

/* --- < 900px: Mobile menu triggers --- */
@media (max-width: 900px) {
  /* Show hamburger */
  .mobile-menu-btn { display: flex !important; }

  /* Hide desktop nav */
  .site-nav { display: none !important; }

  /* Show mobile bottom nav */
  .mobile-bottom-nav { display: flex !important; }

  /* Topbar: only phone + track */
  .topbar-hide-mobile { display: none !important; }
}

/* --- < 768px remains intact --- */

/* ============================================================
   MOBILE CATEGORY CAROUSEL - FULL WIDTH + OVERLAY NAV BUTTONS
   ============================================================ */
@media (max-width: 768px) {
  /* Make categories section span the full screen width on mobile
     so the carousel fills the viewport horizontally. */
  .categories-section > .container {
    padding-left: 0;
    padding-right: 0;
    max-width: 100%;
  }

  /* Keep the section title properly padded even though container is flush */
  .categories-section .section-title {
    padding-left: 20px;
    padding-right: 20px;
  }

  /* Remove default swiper-outer side padding on mobile */
  .categories-section .swiper-outer {
    padding: 0;
  }

  /* Add a small side inset to the swiper itself so first/last slide
     doesn't touch the screen edge but the track is still full width. */
  .categories-section .categories-swiper {
    padding-left: 12px;
    padding-right: 12px;
  }

  /* Overlay the navigation arrows ON TOP of the category images,
     instead of sitting outside in empty space. */
  .categories-section .swiper-nav-btn {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
    border: none;
  }
  .categories-section .swiper-nav-prev { left: 18px; right: auto; }
  .categories-section .swiper-nav-next { right: 18px; left: auto; }
}

@media (max-width: 480px) {
  .categories-section .swiper-nav-btn {
    width: 32px;
    height: 32px;
    font-size: 0.75rem;
  }
  .categories-section .swiper-nav-prev { left: 12px; }
  .categories-section .swiper-nav-next { right: 12px; }

  .categories-section .categories-swiper {
    padding-left: 8px;
    padding-right: 8px;
  }
}
