/* ========================================================
   KAHANI KORNER — Shared Navbar + Footer
   Import after common.css so these rules win.
   ======================================================== */

:root {
  --granite: #4a594a;
  --deep-teal: #687d70;
  --ash-grey: #b0c3b7;
  --white-smoke: #f3f1f0;
  --soft-blush: #f3dedd;
  --cotton-rose: #ffc4c3;
  --rosy-taupe: #d49797;
  --black: #1c2524;
  --white: #ffffff;
  --mint: #c9dcce;
  --radius-lg: 24px;
  --radius-pill: 999px;
  --shadow-hover: 0 22px 50px rgba(74, 89, 74, 0.25);
  --card-bg: #ffffff;
  --danger: #ef4444;
  --muted: #5c6b68;
  --topbar-h: 15px;
  --header-top-gap: 1.75rem;
  --header-h: 74px;
}

/* ── Reset helpers ── */
*, *::before, *::after { box-sizing: border-box; }
html, body { width: 100%; overflow-x: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, select { font-family: inherit; cursor: pointer; }
.hidden { display: none !important; }

/* ── BASE ── */
body {
  margin: 0;
  font-family: "Open Sans", system-ui, sans-serif;
  color: var(--granite);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  background: var(--white-smoke);
  opacity: 1 !important;
  visibility: visible !important;
}

h1, h2, h3, h4 {
  font-family: "Grandstander", cursive;
  font-weight: 800;
  line-height: 1.2;
  margin: 0 0 1rem;
  color: var(--granite);
}

/* ── TOP PROMO BAR ── */
.topbar {
  width: 100%;
  background: var(--ash-grey);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  white-space: nowrap;
}

.topbar__inner {
  display: flex;
  align-items: center;
  width: 100%;
}

.topbar__track {
  display: inline-block;
  padding-left: 100%;
  animation: marquee 22s linear infinite;
}

.topbar__track span {
  display: inline-block;
  padding-right: 50px;
  opacity: 0.95;
}

@keyframes marquee {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ── PILL HEADER ── */
header.header {
  position: fixed;
  top: calc(var(--topbar-h) + var(--header-top-gap));
  left: 50%;
  transform: translateX(-50%);
  width: min(1200px, calc(100% - 2rem));
  z-index: 100;
  padding: 0.5rem 2rem;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 2px solid rgba(176, 195, 183, 0.7);
  border-radius: 999px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
  transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
}

.header-spacer {
  height: calc(var(--topbar-h) + var(--header-top-gap) + var(--header-h) + 1rem);
}

/* ── BRAND / LOGO ── */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: "Grandstander", cursive;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--granite);
  text-decoration: none;
}

.brand-logo {
  height: 32px;
  width: auto;
  display: block;
}

/* ── DESKTOP NAV ── */
.nav {
  display: flex;
  align-items: center;
  gap: 40px;
  font-weight: 300;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.nav a {
  color: var(--granite);
  text-decoration: none;
  transition: color 0.2s, font-weight 0.1s;
}

.nav a:hover {
  color: var(--soft-blush);
  font-weight: 700;
  text-shadow:
    -1px -1px 0 var(--granite),
     1px -1px 0 var(--granite),
    -1px  1px 0 var(--granite),
     1px  1px 0 var(--granite);
}

.nav a.nav-active {
  font-weight: 700;
  color: var(--rosy-taupe);
}

/* ── MOBILE TOGGLE ── */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--granite);
  padding: 0.25rem;
  -webkit-tap-highlight-color: transparent;
}

/* ── HEADER ACTIONS (icon cluster) ── */
.header-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.icon-btn-circle {
  background: var(--mint);
  border: 1px solid var(--granite);
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 50%;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--granite);
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
  cursor: pointer;
  font-size: 1rem;
  -webkit-tap-highlight-color: transparent;
}

.icon-btn-circle:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 0 var(--granite);
  background: var(--ash-grey);
}

.cart-badge-landing {
  position: absolute;
  top: -0.25rem;
  right: -0.25rem;
  background: var(--rosy-taupe);
  color: white;
  font-size: 0.75rem;
  font-weight: 800;
  min-width: 1.5rem;
  height: 1.5rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--white-smoke);
}

/* ── CART OVERLAY ── */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(74, 89, 74, 0.2);
  z-index: 110;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(4px);
}

.cart-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.cart-sidebar {
  position: absolute;
  top: 1rem;
  right: 1rem;
  bottom: 1rem;
  width: calc(100% - 2rem);
  max-width: 400px;
  background: var(--card-bg);
  border-radius: 1.5rem;
  box-shadow: 0 0 0 4px var(--ash-grey);
  transform: translateX(110%);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cart-overlay.open .cart-sidebar { transform: translateX(0); }

.cart-header {
  padding: 1.5rem;
  border-bottom: 2px dashed var(--ash-grey);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--white-smoke);
}

.cart-header h2 { margin: 0; font-size: 1.25rem; }

.close-btn {
  background: var(--soft-blush);
  border: none;
  font-size: 1.25rem;
  color: var(--granite);
  padding: 0.5rem;
  border-radius: 50%;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  cursor: pointer;
}

.cart-items { flex: 1; overflow-y: auto; padding: 1.5rem; }

.cart-item {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  background: var(--white-smoke);
  padding: 1rem;
  border-radius: 1rem;
}

.cart-item img {
  width: 4rem;
  height: 4rem;
  border-radius: 0.75rem;
  object-fit: cover;
}

.cart-item-details { flex: 1; }
.cart-item-details h4 { font-size: 1rem; margin-bottom: 0.25rem; }
.cart-item-price { font-weight: 700; color: var(--rosy-taupe); margin-bottom: 0.5rem; }

.cart-controls { display: flex; align-items: center; gap: 0.5rem; }

.qty-btn {
  background: var(--white-smoke);
  border: 1px solid var(--ash-grey);
  border-radius: 6px;
  width: 1.75rem;
  height: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.remove-btn {
  background: none;
  border: none;
  color: var(--danger);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0;
  margin-left: auto;
}

.empty-cart-msg { text-align: center; color: var(--muted); padding: 2rem; }

.cart-footer {
  padding: 1.5rem;
  border-top: 2px dashed var(--ash-grey);
  background: var(--white-smoke);
}

.cart-total {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  margin-bottom: 1rem;
}

.checkout-btn {
  width: 100%;
  padding: 0.85rem;
  background: var(--granite);
  color: white;
  border: none;
  border-radius: var(--radius-pill);
  font-family: "Grandstander", cursive;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.checkout-btn:hover { background: var(--deep-teal); }

/* ── MOBILE MENU ── */
.mobile-menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(28, 37, 36, 0.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 120;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.mobile-menu-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-menu {
  position: absolute;
  top: 0;
  right: 0;
  width: 80%;
  max-width: 320px;
  height: 100%;
  background: var(--white);
  border-left: 2px solid var(--ash-grey);
  box-shadow: -4px 0 30px rgba(0, 0, 0, 0.18);
  border-radius: 24px 0 0 24px;
  padding: 1.75rem 1.5rem 2rem;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.mobile-menu-overlay.open .mobile-menu { transform: translateX(0); }

.mobile-menu__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.mobile-menu__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.mobile-menu__close {
  background: var(--soft-blush);
  border: 2px solid var(--granite);
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--granite);
  cursor: pointer;
}

.mobile-menu__links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.mobile-menu__links li a {
  display: block;
  padding: 0.75rem 0.25rem;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: var(--granite);
  border-bottom: 1px dashed var(--white-smoke);
  text-decoration: none;
}

.mobile-menu__links li a.nav-active { color: var(--rosy-taupe); }

/* ── SHARED FOOTER ── */
footer.footer {
  width: 100%;
  background: var(--granite);
  color: var(--ash-grey);
  padding: 4rem 2rem;
  text-align: center;
  margin-top: 3rem;
}

.footer-tagline {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  color: var(--white-smoke);
}

footer.footer a { color: var(--white); font-weight: 700; }

.footer-brand-logo {
  height: 40px;
  width: auto;
  filter: brightness(0) invert(1);
  opacity: 0.9;
  margin: 0 auto 1rem;
  display: block;
}

.social-icons {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  margin: 0.5rem 0 1.5rem;
}

.social-icons img {
  width: 26px;
  height: 26px;
  filter: invert(1);
  opacity: 0.85;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.social-icons a:hover img {
  opacity: 1;
  transform: translateY(-2px);
}

/* ── RESPONSIVE ── */
@media (min-width: 769px) {
  .mobile-menu-overlay { display: none; }
}

@media (max-width: 768px) {
  header.header { padding: 0.5rem 1rem; }

  .header__inner {
    display: grid !important;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    width: 100%;
  }

  .mobile-toggle {
    display: block !important;
    grid-column: 1;
    justify-self: start;
  }

  .brand {
    grid-column: 2;
    justify-self: center;
  }

  .header-actions {
    grid-column: 3;
    justify-self: end;
  }

  .nav { display: none !important; }
}
