/**
 * BuyNearby — Global Wide Layout + Modern Startup Redesign
 * Overrides narrow 540px container & upgrades every shared surface.
 * Applied on: public site (header.php) + store-dashboard (store-dashboard/header.php)
 */

/* ── Google Font: Inter ─────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ── Design Tokens ───────────────────────────────────────────────────────────── */
:root {
  --bn-primary:       #14b8a6;
  --bn-primary-dark:  #0d9488;
  --bn-primary-light: #f0fdfa;
  --bn-accent:        #0f766e;
  --bn-success:       #10b981;
  --bn-warning:       #f59e0b;
  --bn-danger:        #ef4444;
  --bn-surface:       #ffffff;
  --bn-bg:            #f8fafc;
  --bn-border:        #e2e8f0;
  --bn-text:          #0f172a;
  --bn-muted:         #64748b;
  --bn-radius:        14px;
  --bn-radius-lg:     20px;
  /* Color shadows — brand purple tint instead of black */
  --bn-shadow:        0 1px 2px rgba(20, 184, 166,.04), 0 4px 16px rgba(20, 184, 166,.07);
  --bn-shadow-lg:     0 4px 24px rgba(20, 184, 166,.12), 0 12px 48px rgba(20, 184, 166,.08);
  --bn-transition:    all .18s cubic-bezier(.4,0,.2,1);
  --bn-container:     1440px;
  --bn-padding:       clamp(16px, 4vw, 48px);
  --header-height:    66px;
}

/* ── Base ─────────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bn-bg);
  color: var(--bn-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }

/* ── Wide container — replaces the 540px .container everywhere ──────────────── */
.container,
.main-nav.container {
  width: 100%;
  max-width: var(--bn-container);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--bn-padding);
  padding-right: var(--bn-padding);
}

/* ── Public site header / nav ─────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 500;
  height: var(--header-height);
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(226,232,240,.6);
  box-shadow: 0 1px 0 rgba(0,0,0,.04);
}

.main-nav {
  display: flex;
  align-items: center;
  height: var(--header-height);
  gap: 0;
  /* Side gutters match the restaurant pages: logo and language/cart controls keep clear of the
     window edge (v3-complete's own 2rem / 1.5rem / 1rem / .75rem steps). Vertical size comes from
     --header-height, so no vertical padding. */
  padding: 0 2rem !important;
}
@media (max-width: 1024px) { .main-nav { padding: 0 1.5rem !important; } }
@media (max-width: 768px)  { .main-nav { padding: 0 1rem !important; } }
@media (max-width: 480px)  { .main-nav { padding: 0 .75rem !important; } }

.main-nav .logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--bn-primary);
  letter-spacing: -.02em;
  flex-shrink: 0;
  margin-right: 24px;
  text-decoration: none;
}
.main-nav .logo img { height: 30px; width: auto; }
.main-nav .logo span { color: #0f172a; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  /* Remove the fixed container padding v3 sets */
}

/* Push cart + user menu to the far right of the nav */
#header-cart-btn { margin-left: auto; }
.user-menu-container { margin-left: 6px; }

/* Tighten nav link text on mid-size screens */
@media (max-width: 1100px) {
  .nav-links a span:not(.desktop-only),
  .nav-links a i { display: none; }
  .nav-links a { padding: 7px 10px; }
  .main-nav .logo { margin-right: 12px; }
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: .88rem;
  font-weight: 500;
  color: var(--bn-muted);
  white-space: nowrap;
  transition: var(--bn-transition);
}
.nav-links a:hover {
  background: var(--bn-primary-light);
  color: var(--bn-primary);
}
/* "For Stores" — solid brand pill */
.nav-links a.nav-highlight,
.nav-links .nav-highlight {
  background: var(--bn-primary) !important;
  color: #fff !important;
  font-weight: 700;
  border-radius: 20px;
  padding: 6px 16px;
  box-shadow: 0 2px 10px rgba(20, 184, 166,.3);
  transition: var(--bn-transition);
}
.nav-links a.nav-highlight:hover,
.nav-links .nav-highlight:hover {
  background: var(--bn-primary-dark) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(20, 184, 166,.4);
}

/* "Shop & Deliver" inline override */
.nav-links a.nav-shop-deliver {
  background: var(--bn-primary) !important;
  color: #fff !important;
  border-radius: 20px;
  font-weight: 700;
  padding: 6px 14px;
  box-shadow: 0 2px 10px rgba(20, 184, 166,.25);
}
.nav-links a.nav-shop-deliver:hover {
  background: var(--bn-primary-dark) !important;
}

/* WhatsApp — keep green, but consistent pill shape */
.nav-links a.nav-whatsapp {
  color: #16a34a;
  font-weight: 600;
}
.nav-links a.nav-whatsapp:hover {
  background: #f0fdf4;
  color: #15803d;
}

.nav-links a i { font-size: .8rem; opacity: .7; }

#header-cart-btn {
  position: relative;
  background: var(--bn-primary-light);
  border: 1.5px solid #99f6e4;
  cursor: pointer;
  padding: 7px 12px;
  border-radius: 20px;
  font-size: 1rem;
  color: var(--bn-primary);
  font-weight: 600;
  transition: var(--bn-transition);
}
#header-cart-btn:hover {
  background: var(--bn-primary);
  color: #fff;
  border-color: var(--bn-primary);
  box-shadow: 0 3px 12px rgba(20, 184, 166,.3);
}
#header-cart-btn:active { transform: scale(0.97); }

.cart-badge {
  position: absolute;
  top: 2px; right: 2px;
  background: var(--bn-danger);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ── User menu ───────────────────────────────────────────────────────────────── */
.user-menu-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1.5px solid #99f6e4;
  background: var(--bn-primary-light);
  cursor: pointer;
  font-size: .85rem;
  font-weight: 600;
  color: var(--bn-primary);
  transition: var(--bn-transition);
  white-space: nowrap;
}
.user-menu-btn:hover {
  background: var(--bn-primary);
  color: #fff;
  border-color: var(--bn-primary);
  box-shadow: 0 3px 12px rgba(20, 184, 166,.3);
}
.user-menu-btn:active { transform: scale(0.97); }

.user-menu-dropdown {
  min-width: 240px;
  background: #fff;
  border: 1px solid var(--bn-border);
  border-radius: var(--bn-radius-lg);
  box-shadow: var(--bn-shadow-lg);
  overflow: hidden;
}
.user-menu-dropdown a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: .88rem;
  font-weight: 500;
  color: var(--bn-text);
  transition: background .15s;
}
.user-menu-dropdown a:hover { background: var(--bn-bg); }
.user-menu-dropdown a i { width: 16px; color: var(--bn-muted); }

/* ── Site footer ─────────────────────────────────────────────────────────────── */
.site-footer {
  background: #0f172a;
  color: #94a3b8;
  margin-top: 80px;
  padding: 64px 0 32px;
}

.site-footer .container { max-width: var(--bn-container); }

.footer-content {
  display: grid;
  grid-template-columns: 2fr repeat(4, 1fr);
  gap: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.footer-section h3 {
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 12px;
  letter-spacing: -.02em;
}
.footer-section h4 {
  font-size: .8rem;
  font-weight: 700;
  color: #cbd5e1;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 14px;
}
.footer-section p { font-size: .88rem; line-height: 1.7; margin-bottom: 8px; }
.footer-section ul { list-style: none; padding: 0; margin: 0; }
.footer-section ul li { margin-bottom: 8px; }
.footer-section ul li a { font-size: .88rem; color: #94a3b8; transition: color .15s; }
.footer-section ul li a:hover { color: #fff; }

.social-links { display: flex; gap: 10px; margin-top: 16px; }
.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  color: #fff;
  font-size: 1rem;
  transition: var(--bn-transition);
}
.social-link:hover { background: var(--bn-primary); }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 28px;
  font-size: .82rem;
  color: #64748b;
  flex-wrap: wrap;
  gap: 8px;
}
.footer-bottom a { color: #64748b; transition: color .15s; }
.footer-bottom a:hover { color: #fff; }

/* ── Shared cards ─────────────────────────────────────────────────────────────── */
.card {
  background: var(--bn-surface);
  border-radius: var(--bn-radius-lg);
  border: 1px solid var(--bn-border);
  box-shadow: var(--bn-shadow);
  padding: 24px;
}

/* ── Shared buttons ──────────────────────────────────────────────────────────── */
.btn-primary {
  background: var(--bn-primary);
  color: #fff;
  padding: 11px 22px;
  border-radius: 10px;
  font-size: .9rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: var(--bn-transition);
  text-decoration: none;
}
.btn-primary:hover  { background: var(--bn-primary-dark); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(20, 184, 166,.4); }
.btn-primary:active { transform: scale(0.98); box-shadow: none; }

.btn-secondary {
  background: var(--bn-surface);
  color: var(--bn-text);
  padding: 11px 22px;
  border-radius: 10px;
  font-size: .9rem;
  font-weight: 600;
  border: 1.5px solid var(--bn-border);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: var(--bn-transition);
  text-decoration: none;
}
.btn-secondary:hover  { border-color: var(--bn-primary); color: var(--bn-primary); background: var(--bn-primary-light); }
.btn-secondary:active { transform: scale(0.98); }

/* ── Product grid ────────────────────────────────────────────────────────────── */
.grid,
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}

.product-card {
  background: var(--bn-surface);
  border-radius: var(--bn-radius-lg);
  border: 1px solid var(--bn-border);
  box-shadow: var(--bn-shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--bn-transition);
  cursor: pointer;
}
.product-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--bn-shadow-lg);
  border-color: #99f6e4;
}
.product-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 0;
  margin: 0;
}
.product-card h3 { font-size: .9rem; font-weight: 600; line-height: 1.4; color: var(--bn-text); margin: 12px 14px 4px; }
.product-card .price { font-size: 1rem; font-weight: 700; color: var(--bn-primary); margin: 0 14px 12px; }
.product-card .btn-add {
  background: var(--bn-primary);
  color: #fff;
  border: none;
  padding: 10px;
  margin: auto 14px 14px;
  border-radius: 9px;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--bn-transition);
}
.product-card .btn-add:hover { background: var(--bn-primary-dark); }

/* ── Store cards ─────────────────────────────────────────────────────────────── */
.store-card {
  background: var(--bn-surface);
  border-radius: var(--bn-radius-lg);
  border: 1px solid var(--bn-border);
  box-shadow: var(--bn-shadow);
  overflow: hidden;
  transition: var(--bn-transition);
  display: flex;
  flex-direction: column;
  text-decoration: none;
  cursor: pointer;
  width: 168px;
  flex-shrink: 0;
}
.store-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--bn-shadow-lg);
  border-color: #99f6e4;
}
.store-card img {
  width: 100%;
  height: 108px;
  /* contain, not cover — store logos are rarely square (wide logotypes,
     transparent-background icons); cover cropped them unpredictably. A
     light tile + padding keeps every logo fully visible and consistent. */
  object-fit: contain;
  object-position: center;
  background: #f8fafc;
  padding: 10px;
  box-sizing: border-box;
  border-radius: 0;
  margin: 0;
  border: none;
  border-bottom: 1px solid var(--bn-border);
  box-shadow: none;
  display: block;
}
.store-card .store-info {
  padding: 12px 14px 14px;
  flex: 1;
}
.store-card .store-info h6 {
  font-size: .88rem;
  font-weight: 700;
  color: var(--bn-text);
  margin: 0 0 3px;
  line-height: 1.3;
  letter-spacing: -.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}
.store-card .store-info p {
  font-size: .76rem;
  color: var(--bn-muted);
  margin: 0 0 2px;
}
/* Category line: always reserves 2 lines of height, even for a
   one-word category, so every card's distance line (and card height)
   lines up regardless of how long the category text is. */
.store-card .store-info p:first-of-type {
  color: #475569;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  height: calc(1.35em * 2);
  min-height: calc(1.35em * 2);
}
.store-card .store-info p:not(:first-of-type) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Directory / linked badges — sit over the image, top-left */
.store-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .01em;
  padding: 4px 9px;
  border-radius: 100px;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.store-badge-unclaimed { background: var(--bn-warning); color: #fff; }
.store-badge-linked    { background: var(--bn-primary); color: #fff; }
.store-badge-age       { background: #1f2937; color: #fff; }
.store-card { position: relative; }

/* ── Category-grouped store directory (homepage) ─────────────────────────────── */
.store-category-section {
  /* Matches the native app's #cards rhythm (app/index.php): a flat flex
     column with gap:12px between every item, plus 4px extra margin-top on
     each heading — no divider line between groups there, so none here. */
  margin-bottom: 16px;
}
.store-category-section:last-child {
  margin-bottom: 0;
}
.store-category-heading {
  font-size: .85rem;
  font-weight: 700;
  /* #nearby-stores sits on the page's dark navy background (#main-content /
     #app-root, #0f172a — see index.php), matching .app-sec-hdr h2's light
     text; var(--bn-text) here would be near-invisible dark-on-dark. */
  color: #e2e8f0;
  letter-spacing: -.01em;
  margin: 0 2px 12px;
}
/* Wrapping list instead of a horizontal scroll strip — one column on
   phones (native "app list" feel), more as the viewport allows. */
.store-category-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 640px) { .store-category-row { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .store-category-row { grid-template-columns: repeat(3, 1fr); } }

/* assets/css/v3-complete.css forces #nearby-stores and its .store-card
   children into a fixed-width horizontal scroller with !important at three
   separate breakpoints (mobile/tablet/iPad) — it loads before this file, so
   matching its specificity (an #id) here is what lets these rules win the
   cascade instead of needing an !important war throughout this whole
   section. No media query needed: this file loads after v3-complete.css,
   so on a tie it always wins, regardless of which of their breakpoints
   is active. */
#nearby-stores { display: block !important; }
#nearby-stores .store-card {
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  flex: 1 1 auto !important;
}
/* The server-rendered fallback (shown before JS groups stores into
   .store-category-row grids — see index.php) puts cards directly under
   #nearby-stores with no grid to stretch them, so give that specific case
   full width explicitly. Doesn't touch the JS-rendered cards: those sit
   inside .store-category-row, not as a direct child of #nearby-stores. */
#nearby-stores > .store-card { width: 100% !important; margin-bottom: 12px !important; }
#nearby-stores > .store-card:last-child { margin-bottom: 0 !important; }

/* Mobile-app-style row card for the directory: small square logo left,
   name/category/distance/badge stacked right, tap chevron — instead of the
   vertical tile card other .store-card usages (search results, dashboard)
   still use elsewhere on the site. */
#nearby-stores .store-card {
  flex-direction: row;
  align-items: center;
  gap: 12px;
  padding: 12px 14px 12px 10px;
}
#nearby-stores .store-card img {
  /* !important: index.php's own <style> block still carries leftover
     @media(max-width:640/380px) rules sizing .store-card img for the old
     horizontal-scroll strip (height:94px/82px !important) — those load
     after this file and otherwise win over a plain (non-!important)
     declaration here regardless of this selector's higher specificity,
     stretching the small row-card avatar into a tall, squashed image. */
  width: 52px !important;
  height: 52px !important;
  flex-shrink: 0;
  border-radius: 11px;
  border-bottom: none;
  padding: 4px;
  order: 1;
}
#nearby-stores .store-card .store-info { flex: 1; min-width: 0; padding: 0; order: 2; }
#nearby-stores .store-card .store-info p:first-of-type {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-line-clamp: 1;
  height: auto;
  min-height: 0;
}
#nearby-stores .store-badge {
  position: static;
  order: 3;
  flex-shrink: 0;
  box-shadow: none;
}
#nearby-stores .store-card::after {
  content: "\203A";
  order: 4;
  flex-shrink: 0;
  margin-left: auto;
  color: #cbd5e1;
  font-size: 1.3rem;
  line-height: 1;
}

/* ── Inputs ──────────────────────────────────────────────────────────────────── */
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
select,
textarea {
  font-family: 'Inter', sans-serif;
  border: 1.5px solid var(--bn-border);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: .9rem;
  background: #fff;
  color: var(--bn-text);
  transition: var(--bn-transition);
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--bn-primary);
  box-shadow: 0 0 0 3px rgba(20, 184, 166,.12);
}

/* ── Page titles ─────────────────────────────────────────────────────────────── */
.page-title {
  font-size: clamp(1.4rem, 3vw, 2.4rem);
  font-weight: 800;
  color: var(--bn-text);
  letter-spacing: -.03em;
  line-height: 1.2;
}
.page-subtitle {
  font-size: 1rem;
  color: var(--bn-muted);
  margin-top: 6px;
}

/* ── Section headers ─────────────────────────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.section-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--bn-text);
  letter-spacing: -.02em;
}

/* ── Stat cards ──────────────────────────────────────────────────────────────── */
.stat-card {
  background: var(--bn-surface);
  border-radius: var(--bn-radius-lg);
  border: 1px solid var(--bn-border);
  box-shadow: var(--bn-shadow);
  padding: 22px 24px;
  transition: var(--bn-transition);
}
.stat-card:hover { box-shadow: var(--bn-shadow-lg); transform: translateY(-1px); }
.stat-card .stat-label { font-size: .78rem; font-weight: 600; color: var(--bn-muted); text-transform: uppercase; letter-spacing: .06em; }
.stat-card .stat-value { font-size: 1.9rem; font-weight: 800; color: var(--bn-text); margin-top: 6px; letter-spacing: -.03em; line-height: 1.1; }
.stat-card .stat-delta { font-size: .8rem; color: var(--bn-success); font-weight: 600; margin-top: 4px; }

/* ── Data tables ─────────────────────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: .88rem;
}
.data-table th {
  background: var(--bn-bg);
  padding: 10px 16px;
  text-align: left;
  font-size: .75rem;
  font-weight: 700;
  color: var(--bn-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  border-bottom: 1px solid var(--bn-border);
  white-space: nowrap;
}
.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
  color: var(--bn-text);
  vertical-align: middle;
}
.data-table tbody tr:hover { background: #f8fafc; }
.data-table tbody tr:last-child td { border-bottom: none; }

/* ── Badges ──────────────────────────────────────────────────────────────────── */
.badge, [class^="badge-"] {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  white-space: nowrap;
}
.badge-success, .badge-active, .badge-paid     { background: #dcfce7; color: #15803d; }
.badge-warning, .badge-pending                 { background: #fef3c7; color: #92400e; }
.badge-danger,  .badge-canceled, .badge-failed  { background: #fee2e2; color: #991b1b; }
.badge-info,    .badge-processing              { background: #dbeafe; color: #1d4ed8; }
.badge-neutral, .badge-draft                   { background: #f1f5f9; color: #475569; }

/* ── Toast ───────────────────────────────────────────────────────────────────── */
.toast-notification {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #0f172a;
  color: #fff;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: .88rem;
  font-weight: 600;
  box-shadow: 0 8px 32px rgba(0,0,0,.25);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 360px;
  animation: toastIn .25s cubic-bezier(.34,1.56,.64,1);
}
@keyframes toastIn { from { opacity:0; transform:translateY(16px) scale(.95); } to { opacity:1; transform:none; } }
.toast-success { border-left: 4px solid var(--bn-success); }
.toast-error   { border-left: 4px solid var(--bn-danger); }
.toast-info    { border-left: 4px solid var(--bn-primary); }

/* ── Nuclear width overrides — catch any lingering inline 1200px containers ── */
/* These use high-specificity selectors so they win without !important */
body .app-sec,
body .app-promos,
body .app-hero-inner,
body .page-content,
body .page-wrap,
body .content-wrap,
body [class*="page-inner"],
body [class*="inner-wrap"] {
  max-width: 1440px !important;
  padding-left: clamp(16px,4vw,48px) !important;
  padding-right: clamp(16px,4vw,48px) !important;
}

/* ── Language selector ───────────────────────────────────────────────────────── */
.bn-lang-selector {
  position: relative;
  flex-shrink: 0;
  margin-left: 8px;
}
/* Always-visible variant — sits outside .nav-links so it shows on mobile too */
.bn-lang-always {
  margin-left: 12px;
  z-index: 600;
}
.bn-lang-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 20px;
  border: 1.5px solid #99f6e4;
  background: #f0fdfa;
  cursor: pointer;
  font-size: .82rem;
  font-weight: 700;
  color: var(--bn-primary);
  font-family: inherit;
  transition: var(--bn-transition);
  white-space: nowrap;
  box-shadow: 0 1px 4px rgba(20, 184, 166,.12);
}
.bn-lang-btn:hover {
  background: var(--bn-primary);
  border-color: var(--bn-primary);
  color: #fff;
  box-shadow: 0 3px 10px rgba(20, 184, 166,.3);
}
.bn-lang-name { max-width: 72px; overflow: hidden; text-overflow: ellipsis; }
/* Hide name on very small screens, keep flag */
@media (max-width: 480px) { .bn-lang-name { display: none; } }
.bn-lang-drop {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: #fff;
  border: 1px solid var(--bn-border);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(20, 184, 166,.14);
  min-width: 160px;
  z-index: 600;
  /* 19 languages are taller than a laptop viewport: scroll inside the menu instead of clipping it,
     and reserve the scrollbar's own gutter so it never sits on top of the language names */
  overflow-x: hidden;
  overflow-y: auto;
  max-height: calc(100vh - 96px);
  scrollbar-width: thin;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
  padding: 4px;
}
.bn-lang-selector.open .bn-lang-drop { display: block; animation: navDropIn .15s ease; }
/* Desktop: two columns so every language is visible without scrolling */
@media (min-width: 769px) {
  .bn-lang-selector.open .bn-lang-drop {
    display: grid;
    grid-template-columns: repeat(2, minmax(150px, 1fr));
    min-width: 340px;
  }
}
.bn-lang-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  font-size: .85rem;
  font-weight: 500;
  color: var(--bn-text);
  text-decoration: none;
  border-radius: 9px;
  transition: background .12s;
  white-space: nowrap;
}
.bn-lang-item:hover { background: var(--bn-bg); color: var(--bn-primary); }
.bn-lang-active { background: var(--bn-primary-light); color: var(--bn-primary); font-weight: 700; }

/* RTL support */
[dir="rtl"] body { direction: rtl; }
[dir="rtl"] .main-nav { flex-direction: row-reverse; }
[dir="rtl"] .nav-links { flex-direction: row-reverse; }
[dir="rtl"] #header-cart-btn { margin-left: 0; margin-right: auto; }
[dir="rtl"] .bn-lang-drop { right: auto; left: 0; }
[dir="rtl"] .site-footer .footer-content { direction: rtl; }

/* ── Responsive ──────────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .footer-content { grid-template-columns: 1fr 1fr 1fr; }
}
@media (max-width: 768px) {
  .footer-content { grid-template-columns: 1fr 1fr; gap: 32px; }
  .grid, .products-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
  .nav-links a span:not(.desktop-only) { display: none; }
}
@media (max-width: 480px) {
  .footer-content { grid-template-columns: 1fr; }
  .grid, .products-grid { grid-template-columns: 1fr 1fr; }
}

/* ── Header scroll-shrink ─────────────────────────────────────────────────────── */
.site-header {
  transition: height .25s ease, box-shadow .25s ease, background .25s ease;
}
.site-header.scrolled {
  height: 52px;
  background: rgba(255,255,255,.97);
  box-shadow: 0 2px 20px rgba(20, 184, 166,.10);
}
.site-header.scrolled .main-nav { height: 52px; }
.site-header.scrolled .main-nav .logo img { height: 24px; }

/* ── Nav visual separator between primary and secondary links ─────────────────── */
.nav-sep {
  width: 1px;
  height: 20px;
  background: rgba(20, 184, 166,.15);
  margin: 0 6px;
  flex-shrink: 0;
}

/* ── Mission link — heart pulse on hover ─────────────────────────────────────── */
.nav-mission-link:hover .nav-heart {
  display: inline-block;
  animation: heartPulse .5s ease;
}
@keyframes heartPulse {
  0%,100% { transform: scale(1); }
  30%      { transform: scale(1.35); }
  60%      { transform: scale(0.9); }
}

/* ── Cart badge — pulse when items added ───────────────────────────────────────── */
@keyframes badgePop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.5); }
  70%  { transform: scale(0.85); }
  100% { transform: scale(1); }
}
.cart-badge.pop { animation: badgePop .35s cubic-bezier(.34,1.56,.64,1); }

/* ── Header search expander ──────────────────────────────────────────────────── */
.header-search-wrap {
  display: flex;
  align-items: center;
  gap: 0;
  margin-left: 6px;
  position: relative;
}
.header-search-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--bn-muted);
  font-size: 1rem;
  padding: 7px 10px;
  border-radius: 50%;
  transition: var(--bn-transition);
  display: flex;
  align-items: center;
}
.header-search-btn:hover { background: var(--bn-primary-light); color: var(--bn-primary); }
.header-search-input {
  width: 0;
  opacity: 0;
  border: none;
  outline: none;
  background: var(--bn-primary-light);
  border-radius: 20px;
  font-size: .88rem;
  font-family: inherit;
  color: var(--bn-text);
  padding: 0;
  transition: width .25s cubic-bezier(.4,0,.2,1), opacity .2s, padding .25s;
  pointer-events: none;
}
.header-search-wrap.open .header-search-input {
  width: 200px;
  opacity: 1;
  padding: 7px 16px;
  pointer-events: auto;
}
.header-search-wrap.open .header-search-btn { color: var(--bn-primary); }

/* ── Shop & Deliver — gradient shimmer on hover ──────────────────────────────── */
.nav-links a.nav-shop-deliver {
  background: linear-gradient(90deg, var(--bn-primary) 0%, var(--bn-accent) 100%) !important;
  background-size: 200% 100% !important;
  transition: background-position .4s ease, transform .18s, box-shadow .18s !important;
}
.nav-links a.nav-shop-deliver:hover {
  background-position: 100% 0 !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 14px rgba(20, 184, 166,.4) !important;
}

@media (max-width: 768px) {
  .header-search-wrap { display: none; }
  .nav-sep { display: none; }
}
