/* ============================================================
   BERJÓ — Responsive v2.1
   mobile <640 · tablet 640-1023 · desktop ≥1024 · wide ≥1280
   ============================================================ */

/* ── Global mobile helpers ────────────────────────────────── */
@media (max-width: 639px) {
  .container { padding: 0 18px; }
}
@media (max-width: 1023px) {
  :root { --section-py: var(--section-py-mobile); }
}

/* ── Grid system collapse ─────────────────────────────────── */
@media (max-width: 1023px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 639px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ── NAVBAR ───────────────────────────────────────────────── */
@media (max-width: 1023px) {
  .nav-links    { display: none; }
  .lang-selector { display: none; }
  .nav-hamburger { display: flex; }
}
@media (min-width: 1024px) {
  .nav-hamburger { display: none; }
  .mobile-nav    { display: none !important; }
}

/* ── HERO ─────────────────────────────────────────────────── */
@media (max-width: 639px) {
  .hero { min-height: 88vh; }
  .hero-content { padding: 52px 0 88px; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; text-align: center; }
  .hero-blob-1, .hero-blob-2 { display: none; }
}

/* ── BERGAMOT SECTION ─────────────────────────────────────── */
@media (max-width: 1023px) {
  .bergamot-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .bergamot-img {
    max-width: 580px;
    margin: 0 auto;
    width: 100%;
  }
  .stats-row { justify-content: center; }
  .bergamot-text .section-title,
  .bergamot-text .lime-bar { text-align: center; margin-left: auto; }
}

/* ── PRODUCTS PREVIEW ─────────────────────────────────────── */
@media (max-width: 639px) {
  .products-preview-grid { grid-template-columns: 1fr !important; }
}

/* ── WHY SECTION ──────────────────────────────────────────── */
@media (max-width: 1023px) {
  .why-grid { grid-template-columns: 1fr; }
}
@media (max-width: 639px) {
  .why-grid { grid-template-columns: 1fr; }
}

/* ── PRODUCT DETAIL CARD ──────────────────────────────────── */
@media (max-width: 1023px) {
  .product-detail-card { grid-template-columns: 1fr; }
  .product-detail-img  { aspect-ratio: 16/9; }
  .product-detail-body { padding: 2rem; }
}
@media (max-width: 639px) {
  .product-detail-body { padding: 1.35rem; }
}

/* ── ABOUT PAGE ───────────────────────────────────────────── */
@media (max-width: 1023px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .about-img {
    max-width: 560px;
    margin: 0 auto;
    width: 100%;
  }
  .values-grid { grid-template-columns: repeat(2, 1fr); }
  .about-text-col .section-title,
  .about-text-col .lime-bar { text-align: center; margin-left: auto; }
}
@media (max-width: 639px) {
  .values-grid { grid-template-columns: 1fr; }
}

/* ── CONTACT PAGE ─────────────────────────────────────────── */
@media (max-width: 1023px) {
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
}

/* ── FOOTER ───────────────────────────────────────────────── */
@media (max-width: 1023px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
  }
}
@media (max-width: 639px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .footer { padding-top: 3.5rem; }
}

/* ── CHECKOUT ─────────────────────────────────────────────── */
@media (max-width: 1023px) {
  .checkout-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .order-summary { position: static; }
}
@media (max-width: 900px) {
  .checkout-layout {
    grid-template-columns: 1fr !important;
  }
  .checkout-layout > div:last-child {
    position: static !important;
  }
}
@media (max-width: 639px) {
  #co-indirizzo, #co-note { width: 100%; }
  .checkout-layout > div > div > div[style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
  .checkout-layout > div > div > div[style*="grid-template-columns:1fr 1fr 1fr"] {
    grid-template-columns: 1fr 1fr !important;
  }
}

/* ── FORM ROW ─────────────────────────────────────────────── */
@media (max-width: 639px) {
  .form-row { grid-template-columns: 1fr; }
  .form-card { padding: 1.5rem; }
}

/* ── CART PANEL ───────────────────────────────────────────── */
@media (max-width: 480px) {
  .cart-panel { max-width: 100%; }
}

/* ── RESULT CARD ──────────────────────────────────────────── */
@media (max-width: 639px) {
  .result-card { padding: 2.5rem 1.35rem; }
}

/* ── CTA CARD ─────────────────────────────────────────────── */
@media (max-width: 639px) {
  .cta-card { padding: 3rem 1.35rem; }
}

/* ── COOKIE BANNER ────────────────────────────────────────── */
@media (max-width: 639px) {
  .cookie-banner { width: calc(100% - 2rem); bottom: 1rem; }
  .cookie-actions { width: 100%; }
  .cookie-actions .btn { flex: 1; }
}

/* ── PRICING WIDGET ───────────────────────────────────────── */
@media (max-width: 639px) {
  .pricing-display { flex-wrap: wrap; }
  .pricing-total   { margin-left: 0; }
  .pricing-per-kg  { font-size: 2rem; }
}

/* ── BOX QTY SELECTOR ─────────────────────────────────────── */
@media (max-width: 639px) {
  .box-qty-selector { justify-content: center; }
}

/* ── PAGE HERO ────────────────────────────────────────────── */
@media (max-width: 639px) {
  .page-hero { padding: 3rem 0 2.5rem; }
  .page-hero h1 { font-size: clamp(1.65rem, 8vw, 2rem); }
}

/* ── STATS ROW ────────────────────────────────────────────── */
@media (max-width: 639px) {
  .stats-row   { gap: 1.75rem; }
  .stat-number { font-size: 1.7rem; }
}

/* ── WHY SECTION WIDE ─────────────────────────────────────── */
@media (min-width: 1280px) {
  .why-card { padding: 3rem 2.5rem; }
  .product-detail-body { padding: 3.5rem; }
}

/* ── PRODUCTS PAGE STACK ──────────────────────────────────── */
.products-page-stack {
  display: flex;
  flex-direction: column;
  gap: 4rem;
  padding: var(--section-py) 0;
}

/* ── RTL (Arabic) ─────────────────────────────────────────── */
[dir="rtl"] .lime-bar-left { margin-right: 0; margin-left: auto; }
[dir="rtl"] .nav-links     { flex-direction: row-reverse; }
[dir="rtl"] .nav-inner     { flex-direction: row-reverse; }
[dir="rtl"] .lang-dropdown { right: auto; left: 0; }
[dir="rtl"] .cart-panel    { right: auto; left: 0; transform: translateX(-100%); }
[dir="rtl"] .cart-panel.open { transform: translateX(0); }
[dir="rtl"] .hero-content  { text-align: right; }
[dir="rtl"] .footer-grid   { text-align: right; }
[dir="rtl"] .product-detail-body { text-align: right; }
