/* ============================================
   Afriqone — Responsive Mobile-First
   ============================================ */

/* ============================================
   TABLET (max-width: 1024px)
   ============================================ */
@media (max-width:1024px) {
  :root {
    --container-padding: 1.5rem;
    --header-height: 64px;
  }

  .categories-grid { grid-template-columns: repeat(2,1fr); gap: var(--space-lg); }
  .products-grid { grid-template-columns: repeat(3,1fr); gap: var(--space-lg); }
  .why-us-grid { gap: var(--space-lg); }
  .footer-main { grid-template-columns: 1fr 1fr; gap: var(--space-2xl); }
  .footer-brand { grid-column: span 2; text-align: center; }
  .footer-brand p { max-width: 600px; margin-left: auto; margin-right: auto; }
  .footer-social { justify-content: center; }
  .footer-payment { justify-content: center; }
  .related-products .products-grid { grid-template-columns: repeat(3,1fr); }
}

/* ============================================
   MOBILE (max-width: 768px)
   ============================================ */
@media (max-width:768px) {

  /* ---- Variables ---- */
  :root {
    --container-padding: 1rem;
    --header-height: 60px;
    --space-4xl: 3.5rem;
    --space-3xl: 2.5rem;
    --space-2xl: 2rem;
  }

  section { padding: var(--space-2xl) 0; }

  /* ---- Top bar — keep marquee, just tighten font ---- */
  .top-bar { padding: 0.4rem 0; }
  .top-bar-track { font-size: 0.6rem; gap: 1.5rem; }
  .top-bar-dot { font-size: 0.4rem; }

  /* ---- Mobile nav ---- */
  .menu-toggle { display: flex; }

  .nav-links {
    position: fixed;
    top: 0; left: 0;
    width: 80%; max-width: 280px;
    height: 100%;
    background: #f7f5f2;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 5rem 2rem 3rem;
    gap: 0;
    transform: translateX(-100%);
    transition: transform var(--duration-slow) var(--ease);
    z-index: 1600;
    border-right: 1px solid rgba(22,20,18,0.08);
    box-shadow: 8px 0 30px rgba(22,20,18,0.1);
  }
  .nav-links.open { transform: translateX(0); }

  .nav-links li { width: 100%; }
  .nav-links a {
    display: block;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(22,20,18,0.08);
    color: #161412;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
  .nav-links a.active { color: #161412; opacity: 0.45; }
  .nav-links a::after { display: none; }

  /* ---- Hero ---- */
  .hero { min-height: 560px; height: 75vh; padding: 0; }
  .hero--editorial::after { display: none; }
  .hero-content { width: 100%; padding: 1.5rem; text-align: center; }
  .hero-badge { font-size: 0.7rem; padding: 0.4rem 1rem; }
  .hero-title { font-size: clamp(1.6rem, 7vw, 2.4rem); margin-bottom: 1rem; white-space: normal; }
  .hero-description { font-size: 0.9rem; margin-bottom: 1.5rem; }
  .hero-buttons { flex-direction: column; align-items: center; gap: 0.6rem; }
  .hero-buttons .btn { width: 100%; max-width: 320px; padding: 0.95rem 1.5rem; font-size: 0.88rem; }
  .hero-scroll { display: none; }

  /* ---- Section titles ---- */
  .section-title { font-size: clamp(1.5rem, 6vw, 2rem); margin-bottom: var(--space-xs); }
  .section-subtitle { font-size: 0.88rem; margin-bottom: var(--space-xl); }
  .section-divider { margin: var(--space-sm) auto var(--space-md); }

  /* ---- Categories ---- */
  .categories-grid { grid-template-columns: repeat(2,1fr); gap: var(--space-sm); }
  .category-card { aspect-ratio: 3/4; }
  .category-card-title { font-size: 1.1rem; }
  .category-card-content { padding: var(--space-md); }

  /* ---- Products grid ---- */
  .products-grid { grid-template-columns: repeat(2,1fr); gap: var(--space-sm); }

  /* ---- Best-sellers carousel on mobile ---- */
  .bs-header { margin-bottom: 1.25rem; }
  .bs-scroll-track .product-card { flex: 0 0 62vw; min-width: 0; }
  .bs-arrow { display: none; }

  /* Product card tighter on mobile */
  .product-card { border-radius: 10px; }
  .product-card-image-wrapper { aspect-ratio: 3/4; border-radius: 10px 10px 0 0; }
  .product-card-info { padding: 0.65rem 0.75rem 0.75rem; }
  .product-card-name { font-size: 0.82rem; line-height: 1.3; margin-bottom: 0.35rem; }
  .product-card-name a { color: #1a1a1a; }
  .price-current { font-size: 0.88rem; }
  .price-old { font-size: 0.73rem; }
  .product-badge { font-size: 0.58rem; padding: 0.2rem 0.5rem; top: 0.5rem; left: 0.5rem; }

  /* Mobile: quick-add caché, btn-commander visible */
  .product-card-quick-add { display: none !important; }
  .btn-commander {
    display: block;
    width: 100%;
    margin-top: 0.6rem;
    padding: 0.65rem;
    background: #161412;
    color: #f7f5f2;
    border: none;
    border-radius: 5px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    cursor: pointer;
    text-align: center;
    font-family: 'Outfit', sans-serif;
    text-transform: uppercase;
  }

  /* ---- Shop page ---- */
  .shop-header { padding: var(--space-2xl) 0 var(--space-md); }
  .shop-header h1 { font-size: clamp(1.4rem, 6vw, 2rem); }
  .shop-header p { font-size: 0.85rem; }

  .breadcrumbs { padding: var(--space-md) 0; font-size: 0.75rem; gap: 0.3rem; }
  .results-count { font-size: 0.8rem; margin-bottom: var(--space-lg); }

  /* Filter pills — horizontal scroll */
  .filter-pills {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: var(--space-xs);
    margin-bottom: var(--space-lg);
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .filter-pills::-webkit-scrollbar { display: none; }
  .filter-pill {
    flex-shrink: 0;
    padding: 0.45rem 1rem;
    font-size: 0.78rem;
    white-space: nowrap;
  }

  /* ---- Stats ticker ---- */
  .stats-ticker { padding: 0.65rem 0; }
  .stats-ticker-item { font-size: 0.7rem; }

  /* ---- How it works ---- */
  .how-it-works { padding: 3rem 0; }
  .hiw-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  .hiw-connector { display: none; }
  .hiw-step { padding: 1.5rem 1.25rem; gap: 0.75rem; flex-direction: row; align-items: flex-start; }
  .hiw-number { font-size: 2rem; min-width: 48px; }
  .hiw-body { flex: 1; }
  .hiw-title { font-size: 0.92rem; }
  .hiw-desc { font-size: 0.84rem; }
  .hiw-cta { margin-top: 2rem; }

  /* ---- Testimonials ---- */
  .testimonials { padding: 3rem 0; }
  .testimonials-grid { grid-template-columns: 1fr; gap: 0.85rem; margin-bottom: 2rem; }
  .testimonial-card { padding: 1.5rem 1.25rem; }
  .testimonial-text { font-size: 0.88rem; }
  .testimonials-badge { flex-direction: column; gap: 0.4rem; text-align: center; padding: 1rem; }
  .testimonials-badge-label { font-size: 0.72rem; }

  /* ---- Promo banner ---- */
  .promo-banner { padding: var(--space-2xl) 0; }
  .promo-title { font-size: 1.7rem; }
  .promo-description { font-size: 0.9rem; }

  /* ---- Why us (dark, stacked on mobile) ---- */
  .why-us-grid { grid-template-columns: 1fr; gap: 1px; }
  .why-us-card { padding: 2rem 1.5rem; display: flex; flex-direction: column; align-items: flex-start; gap: 0; text-align: left; border-radius: 0; }
  .why-us-card::before { display: none; }
  .why-us-icon { font-size: 1.4rem; width: auto; height: auto; margin: 0 0 1rem; flex-shrink: 0; }
  .why-us-title { font-size: 0.92rem; margin-bottom: 0.4rem; }
  .why-us-description { font-size: 0.84rem; }

  /* ---- Home FAQ ---- */
  .home-faq { padding: var(--space-2xl) 0; }
  .home-faq .section-subtitle { margin-bottom: var(--space-lg); }
  .home-faq .accordion-header {
    padding: 0.95rem 1rem;
    font-size: 0.88rem;
    line-height: 1.35;
  }
  .home-faq .accordion-icon {
    width: 28px;
    height: 28px;
  }
  .home-faq .accordion-content p {
    padding: 0 1rem 1rem;
    font-size: 0.84rem;
  }
  .home-faq-cta { margin-top: var(--space-lg); }

  /* ---- Footer ---- */
  .footer { padding-top: var(--space-xl); }
  .footer-main { grid-template-columns: 1fr 1fr; gap: var(--space-lg); text-align: left; padding-bottom: var(--space-lg); }
  .footer-brand { grid-column: 1; }
  .footer-brand { grid-column: 1 / -1; display:grid; grid-template-columns:1fr; gap:0.75rem; align-items:start; }
  .footer-brand .logo { margin-bottom:0; }
  .footer-brand p { grid-column:1 / -1; max-width:none; font-size: 0.8rem; margin-bottom: 0; }
  .footer-social { display:none; }
  .footer-social a { width:32px; height:32px; font-size:0.82rem; }
  .footer-payment { grid-column:1 / -1; justify-content: center; width:100%; margin-top:0; font-size: 0.74rem; }
  .footer-column h4 { margin-bottom: 0.55rem; font-size:0.7rem; }
  .footer-column ul li { margin-bottom: 0.25rem; }
  .footer-column ul li a { font-size: 0.78rem; }
  .footer-bottom { flex-direction: column; gap: 0.25rem; text-align: center; font-size: 0.68rem; padding: 0.8rem 0; }

  /* ---- Product page ---- */
  .product-page { padding: var(--space-md) 0 6rem; }
  .product-layout { grid-template-columns: 1fr; gap: var(--space-lg); }
  .product-gallery { position: relative; top: 0; }

  /* Make gallery image full-width on mobile */
  .product-gallery-main { border-radius: var(--radius-md); }
  .product-gallery-thumbs { grid-template-columns: repeat(4,1fr); gap: 0.4rem; margin-top: 0.4rem; }

  .product-brand { font-size: 0.7rem; }
  .product-title { font-size: clamp(1.3rem, 5vw, 1.7rem); margin-bottom: var(--space-sm); }
  .product-review-row { margin-bottom: var(--space-md); padding-bottom: var(--space-md); }
  .product-price .price-current { font-size: 1.5rem; }
  .product-description { font-size: 0.88rem; margin-bottom: var(--space-lg); padding-bottom: var(--space-lg); }
  .product-features li { font-size: 0.85rem; }
  .product-highlight-box { font-size: 0.85rem; padding: var(--space-md); }
  .urgency-bar { font-size: 0.78rem; }

  /* Trust badges row on mobile */
  .trust-badges { padding: var(--space-md); gap: var(--space-sm); }
  .trust-badge { font-size: 0.82rem; }
  .trust-badge-sub { font-size: 0.73rem; }

  /* Inline form — full width fields on mobile */
  .inline-order-form { padding: 1.2rem; border-radius: var(--radius-lg); }
  .iof-fields { grid-template-columns: 1fr; }
  .iof-total { font-size: 0.95rem; }
  .iof-field input { font-size: 1rem; padding: 0.9rem; }
  .iof-submit { padding: 1rem; font-size: 0.92rem; }

  /* Related products */
  .related-products .products-grid { grid-template-columns: repeat(2,1fr); }
  .related-products { padding: var(--space-2xl) 0; }
  .related-products h2 { font-size: 1.3rem; margin-bottom: var(--space-lg); }

  /* ---- Checkout modal — bottom sheet ---- */
  .checkout-overlay { align-items: flex-end; }
  .checkout-modal {
    border-radius: 1.2rem 1.2rem 0 0;
    padding: 1.5rem 1.2rem;
    max-height: 92vh;
  }
  /* Pull handle */
  .checkout-modal::before {
    content: '';
    display: block;
    width: 40px; height: 4px;
    background: var(--beige-dark);
    border-radius: var(--radius-full);
    margin: 0 auto 1.2rem;
  }
  .checkout-modal h2 { font-size: 1.1rem; margin-bottom: 1rem; }
  .checkout-product-emoji { width: 48px; height: 48px; font-size: 2rem; }
  .checkout-product-name { font-size: 0.88rem; }
  .checkout-product-price { font-size: 1rem; }
  .checkout-qty { margin-bottom: 1rem; }
  .form-group { margin-bottom: 0.8rem; }
  .form-group input { padding: 0.9rem 0.85rem; font-size: 1rem; border-radius: var(--radius-md); }
  .form-group label { font-size: 0.72rem; }
  .checkout-form h3 { font-size: 0.78rem; margin-bottom: var(--space-sm); }
  #submitOrder { padding: 1rem; font-size: 0.92rem; border-radius: var(--radius-md); }
  .checkout-trust { gap: 0.5rem; }
  .checkout-trust-item { font-size: 0.72rem; min-width: 100px; }

  /* Toast */
  .toast { bottom: 1rem; right: 1rem; left: 1rem; border-radius: var(--radius-lg); font-size: 0.85rem; justify-content: center; }

  /* FAQ / info pages */
  .accordion-header { font-size: 0.82rem; padding: var(--space-md) 0; }
  .accordion-content p { font-size: 0.85rem; }

  /* ---- Product page — how-it-works mini block ---- */
  .how-steps { gap: 2px; }
  .how-step-icon { font-size: 1.2rem; }
  .how-step-text { font-size: 0.62rem; }
  .how-arrow { font-size: 0.75rem; margin-bottom: 14px; }

  /* ---- Sticky bar ---- */
  .sticky-bar { padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom)); gap: 0.75rem; }
  .sticky-bar-name { font-size: 0.82rem; }
  .sticky-bar-btn { padding: 0.75rem 1.25rem; font-size: 0.78rem; }
}

/* ============================================
   SMALL MOBILE (max-width: 380px)
   ============================================ */
@media (max-width:380px) {
  :root { --container-padding: 0.85rem; }
  .products-grid { gap: 0.5rem; }
  .product-card-info { padding: 0.55rem 0.6rem 0.65rem; }
  .product-card-name { font-size: 0.78rem; }
  .price-current { font-size: 0.92rem; }
  .btn-commander { font-size: 0.68rem; padding: 0.5rem; }
  .hero-title { font-size: 1.7rem; }
  .categories-grid { gap: 0.4rem; }
}

/* ============================================
   PREMIUM PHONE EXPERIENCE
   ============================================ */
@media (max-width:640px) {
  body { background: #f7f5f2; }

  /* top-bar: marquee keeps running on mobile, no override needed */
  .top-bar-track { gap: 1.25rem; }
  .top-bar span { font-size: 0.58rem; letter-spacing: 0.1em; }

  .header {
    top: 0;
    background: rgba(247,245,242,0.96);
  }
  .header .container {
    position: relative;
    height: 56px;
    justify-content: center;
  }
  .menu-toggle {
    position: absolute;
    left: 0;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(22,20,18,0.1);
    border-radius: 50%;
    background: rgba(255,255,255,0.7);
  }
  .logo { font-size: 1.2rem; letter-spacing: 0.18em; }

  .shop-header {
    min-height: 168px;
    padding: 2rem 0 1.25rem;
    display: flex;
    align-items: flex-end;
  }
  .shop-header h1 {
    max-width: 310px;
    font-size: 2.2rem;
    line-height: 1;
    margin-bottom: 0.55rem;
  }
  .shop-header p { max-width: 320px; font-size: 0.86rem; }

  .shop-content { padding: 1rem 0 3rem; }
  .breadcrumbs { display: none; }

  .filter-pills {
    position: sticky;
    top: 56px;
    z-index: 900;
    margin: 0 calc(var(--container-padding) * -1) 1rem;
    padding: 0.75rem var(--container-padding);
    background: rgba(247,245,242,0.92);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(22,20,18,0.07);
    box-shadow: 0 8px 24px rgba(22,20,18,0.06);
  }
  .filter-pill {
    min-height: 36px;
    padding: 0 1rem;
    border: 1px solid rgba(22,20,18,0.1);
    background: #ffffff;
    font-size: 0.74rem;
    border-radius: 4px;
  }
  .filter-pill.active { background: #161412; border-color: #161412; color: #f7f5f2; }

  .results-count {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 0 0.8rem;
    color: #7a7269;
    font-size: 0.78rem;
  }

  .products-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
  .product-card {
    overflow: hidden;
    border: 0;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 4px 16px rgba(22,20,18,0.07);
  }
  .product-card:hover { transform: none; }
  .product-card-image-wrapper { aspect-ratio: 0.92; margin: 0; border-radius: 0; }
  .product-badge { top: 0.5rem; left: 0.5rem; padding: 0.25rem 0.5rem; border-radius: 3px; }
  .product-card-info { padding: 0.72rem; }
  .product-card-meta { align-items: center; margin-bottom: 0.4rem; }
  .product-card-category { font-size: 0.58rem; letter-spacing: 0.12em; }
  .product-card-rating {
    padding: 0.16rem 0.4rem;
    border-radius: 999px;
    background: #ebe8e2;
    color: #161412;
    font-size: 0.58rem;
    white-space: nowrap;
  }
  .product-card-name {
    min-height: 2.6rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.8rem;
    font-weight: 500;
  }
  .product-card-price { padding-top: 0.4rem; }
  .price-current { font-size: 1rem; letter-spacing: 0; }
  .price-old { font-size: 0.68rem; }
  .btn-commander {
    min-height: 36px;
    margin-top: 0.6rem;
    padding: 0 0.55rem;
    border-radius: 5px;
    background: #161412;
    font-size: 0.64rem;
    letter-spacing: 0.06em;
  }

  .checkout-overlay { background: rgba(22,20,18,0.55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
  .checkout-modal {
    max-width: none;
    border-radius: 18px 18px 0 0;
    padding: 1rem 1rem 1.25rem;
    box-shadow: 0 -20px 50px rgba(22,20,18,0.2);
    background: #f7f5f2;
  }
  .checkout-modal h2 { font-size: 1.2rem; }
  .checkout-product-summary { background: #ebe8e2; border: 1px solid rgba(22,20,18,0.06); }
  .checkout-product-emoji { border-radius: 10px; }
  .qty-controls, .form-group input { border-color: rgba(22,20,18,0.12); background: #ffffff; }
  #submitOrder {
    min-height: 52px;
    border-radius: 6px !important;
    background: #161412;
    box-shadow: 0 8px 20px rgba(22,20,18,0.2);
  }
}

@media (max-width:430px) {
  .shop-header h1 {
    font-size:2.05rem;
  }
  .products-grid {
    gap:0.62rem;
  }
  .product-card {
    border-radius:12px;
  }
  .product-card-info {
    padding:0.62rem;
  }
  .product-card-name {
    font-size:0.76rem;
    min-height:2.55rem;
  }
  .product-card-rating {
    display:none;
  }
  .btn-commander {
    min-height:36px;
    font-size:0.62rem;
  }
}

/* ============================================
   SAFE AREA (notch / home bar)
   ============================================ */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  @media (max-width:768px) {
    .checkout-modal {
      padding-bottom: calc(1.5rem + env(safe-area-inset-bottom));
    }
  }
}
