
/* ============================================================
   EDITH CHAWARD FOUNDATION — FULL MOBILE RESPONSIVE OVERHAUL
   Appended: 100% Mobile-First Responsive Styles
   ============================================================ */

/* ---- Base mobile fixes ---- */
* { box-sizing: border-box; }
body { overflow-x: hidden; }
img { max-width: 100%; height: auto; display: block; }
.container { padding: 0 1.2rem; }
body.no-scroll { overflow: hidden !important; }

/* ---- NAVBAR / LOGO ---- */
.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  gap: 0.6rem;
  flex-shrink: 0;
}
.logo img { height: 46px; border-radius: 8px; border: 2px solid var(--secondary-gold); }
.logo-text {
  font-size: 1rem;
  font-weight: 800;
  color: var(--primary-deep);
  line-height: 1.2;
  font-family: 'Outfit', sans-serif;
}
.logo-sub {
  color: var(--secondary-gold);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}

/* Nav icon (shown only on mobile drawer) */
.nav-icon { display: none; }

/* ---- Desktop: hide mobile-only elements ---- */
.nav-mobile-actions { display: none; }
.mobile-cart-btn { display: none; }

/* ---- HAMBURGER (desktop hidden) ---- */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 21px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  gap: 0;
}
.hamburger span {
  display: block;
  width: 100%;
  height: 3px;
  background: var(--primary-deep);
  border-radius: 3px;
  transition: transform 0.3s ease, opacity 0.3s ease;
  transform-origin: center;
}
.hamburger.active span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.active span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

/* ---- NAV LINKS (desktop) ---- */
.nav-links {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  list-style: none;
  flex-wrap: nowrap;
}
.nav-links a { font-weight: 600; font-size: 0.88rem; color: var(--text-ink); padding: 0.3rem 0; white-space: nowrap; }
.nav-links a:hover { color: var(--primary-deep); }
.cart-link { display: inline-flex; align-items: center; }

/* Cart icon on desktop stays in nav links list */
.nav-donate-item a,
.nav-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--secondary-gold);
  color: #0d2137 !important;
  font-weight: 700;
  padding: 0.6rem 1.2rem;
  border-radius: 50px;
  font-size: 0.9rem;
  white-space: nowrap;
}
.nav-cta-btn:hover { background: var(--primary-deep); color: #fff !important; }

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

  /* Container padding tighter on mobile */
  .container { padding: 0 1rem; }

  /* Show hamburger and mobile actions */
  .hamburger { display: flex; }
  .nav-mobile-actions { display: flex; align-items: center; gap: 0.8rem; }

  /* Show mobile cart button in top bar */
  .mobile-cart-btn {
    display: inline-flex;
    align-items: center;
    position: relative;
    font-size: 1.3rem;
    color: var(--primary-deep);
  }

  /* Show nav icons inside drawer */
  .nav-icon { display: inline-block; margin-right: 8px; width: 18px; text-align: center; }

  /* ---- Mobile NAV DRAWER ---- */
  .nav-links {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    position: fixed;
    top: var(--nav-height);
    left: -100%;
    width: 80%;
    max-width: 320px;
    height: calc(100vh - var(--nav-height));
    background: #fff;
    border-right: 3px solid var(--secondary-gold);
    padding: 1.5rem 0 3rem;
    gap: 0;
    overflow-y: auto;
    z-index: 9998;
    box-shadow: 6px 0 30px rgba(0,0,0,0.18);
    transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .nav-links.mobile-active { left: 0; }

  .nav-links > li {
    border-bottom: 1px solid #f1f5f9;
    width: 100%;
  }
  .nav-links > li:last-child { border-bottom: none; }

  .nav-links > li > a {
    display: flex;
    align-items: center;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-ink);
    padding: 1rem 1.5rem;
    white-space: normal;
  }
  .nav-links > li > a:hover { background: #f8fafc; color: var(--primary-deep); }
  .nav-links > li > a.active { color: var(--primary-deep); border-left: 3px solid var(--secondary-gold); background: rgba(245,166,35,0.06); }

  /* Cart inside drawer: hide (shown in top bar) */
  .nav-links .cart-link { display: none; }

  /* Donate button at bottom of drawer */
  .nav-donate-item {
    margin-top: auto;
    padding: 1.2rem 1.5rem 0;
  }
  .nav-cta-btn {
    display: flex;
    justify-content: center;
    width: 100%;
    padding: 0.9rem;
    font-size: 1rem;
    border-radius: 10px;
  }
}

/* ============================================================
   MOBILE BREAKPOINT: max-width 768px — Layout grids
   ============================================================ */
@media (max-width: 768px) {
  /* Reduce padding on sections */
  section { padding: 4rem 0 !important; }

  /* Any div with display:grid goes single column */
  .shop-grid,
  .blog-grid {
    grid-template-columns: 1fr !important;
    gap: 1.4rem !important;
  }

  /* Hero slideshow adjustments */
  .hero-slider-container { min-height: 100svh !important; }
  .hero-slide-content { padding-top: 7rem !important; padding-bottom: 3rem !important; }
  .hero-slider-arrow { width: 38px !important; height: 38px !important; font-size: 1.6rem !important; }
  .hero-slider-arrow.prev { left: 10px !important; }
  .hero-slider-arrow.next { right: 10px !important; }

  /* Hero text */
  .hero-slide h1 { font-size: clamp(1.8rem, 7vw, 2.8rem) !important; }
  .hero-slide p  { font-size: 0.98rem !important; }

  /* Hero CTA buttons — stack vertically */
  .hero-slide > .container > div > div:last-child,
  .hero-slide-content div[style*="display: flex"] {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.8rem !important;
  }
  .hero-slide .btn-primary,
  .hero-slide .btn-outline-white {
    width: 100% !important;
    max-width: 320px !important;
    justify-content: center !important;
  }

  /* Footer columns stack */
  .footer-grid {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
  }

  /* Blog share buttons */
  .share-row { flex-wrap: wrap; gap: 0.6rem; }

  /* Generic inline grids (repair style= grid) */
  div[style*="display: grid"] { grid-template-columns: 1fr !important; }
  div[style*="display: flex; gap"] { flex-wrap: wrap !important; }

  /* Tables on mobile: make scrollable */
  .cart-table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .cart-table { min-width: 580px; }

  /* Admin content: already scoped to admin pages, skip */

  /* Forms: full width */
  .form-control, input, textarea, select { font-size: 16px !important; /* prevents iOS zoom */ }

  /* Product / Blog cards */
  .product-card, .blog-card { max-width: 100%; }

  /* Checkout: summary below form */
  .checkout-layout { flex-direction: column !important; }

  /* PWA Install Banner */
  #pwaInstallBanner .container { flex-direction: column; align-items: flex-start; }
  #pwaInstallBanner > .container > div:last-child { width: 100%; justify-content: flex-start; }

  /* Floating buttons: page up closer on mobile */
  #backToTopBtn { width: 44px; height: 44px; font-size: 16px; right: 74px; bottom: 18px; }
  footer + a[href*="wa.me"] { width: 44px; height: 44px; font-size: 22px; right: 18px; bottom: 18px; }

  /* Download app section */
  div[style*="border-radius: 24px; padding: 4rem"] { padding: 2rem 1.5rem !important; }

  /* Stat/counter cards */
  div[style*="grid-template-columns: repeat(auto-fit, minmax(220px"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* ============================================================
   EXTRA SMALL: max-width 480px
   ============================================================ */
@media (max-width: 480px) {
  html { font-size: 15px; }
  .container { padding: 0 0.9rem; }

  /* Logo text shrink */
  .logo-text { font-size: 0.88rem !important; }
  .logo img { height: 40px !important; }

  /* Hero text tighter */
  .hero-slide h1 { font-size: clamp(1.6rem, 8vw, 2.4rem) !important; }
  .eyebrow { font-size: 0.75rem !important; padding: 4px 12px !important; }

  /* Stat cards: single column on very small */
  div[style*="grid-template-columns: repeat(auto-fit, minmax(220px"] {
    grid-template-columns: 1fr !important;
  }

  /* Section headings */
  h2 { font-size: clamp(1.5rem, 6vw, 2rem) !important; }
  h3 { font-size: 1.1rem !important; }

  /* Buttons full width */
  .btn-primary { width: 100%; max-width: 100%; }

  /* Table: force scroll */
  .cart-table { min-width: 520px; }
  table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table thead, table tbody, table tr, table th, table td { display: revert; }

  /* Blog share buttons */
  .share-row { flex-direction: column; gap: 0.5rem; }

  /* Floating buttons */
  #backToTopBtn { right: 68px !important; bottom: 15px !important; width: 40px !important; height: 40px !important; }
}

/* ============================================================
   HEADER NAV — additional nav fixes
   ============================================================ */
nav#navbar {
  height: var(--nav-height);
  display: flex;
  align-items: center;
}
.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 0.5rem;
}

/* Overlay when drawer is open */
@media (max-width: 900px) {
  .nav-links.mobile-active::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: -1;
  }
}
