/**
 * Header + Footer styles (redesign)
 * Depends on design-system.css for token variables.
 */

/* ── Body scroll lock when drawers are open ── */
body.nav-open,
body.cart-open {
  overflow: hidden;
}

/* ── Top bar ── */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 64px;
  display: flex;
  align-items: center;
  transition: background var(--transition);
}
.mode-cream .top-bar {
  background: var(--canvas);
  border-bottom: 1px solid var(--card-border);
}
.mode-dark .top-bar {
  background: var(--charcoal);
  border-bottom: 1px solid var(--charcoal-border);
}
/* Default to cream mode when no mode class is set */
.top-bar {
  background: var(--canvas);
  border-bottom: 1px solid var(--card-border);
}
.top-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.top-bar-left {
  display: flex;
  align-items: center;
  gap: 24px;
}
.top-bar-nav {
  display: flex;
  list-style: none;
  gap: 24px;
  margin: 0;
  padding: 0;
}
.top-bar-nav a {
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  position: relative;
  padding: 4px 0;
  transition: color var(--transition);
}
.top-bar-nav a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--orange);
  border-radius: 1px;
  transform: scaleX(0);
  transition: transform 0.2s;
}
.top-bar-nav a:hover::after,
.top-bar-nav a.active::after {
  transform: scaleX(1);
}
.mode-cream .top-bar-nav a { color: var(--text-gray); }
.mode-cream .top-bar-nav a:hover { color: var(--text-dark); }
.mode-dark .top-bar-nav a { color: var(--text-light-2); }
.mode-dark .top-bar-nav a:hover { color: var(--text-light); }
/* Default (no mode class) */
.top-bar-nav a { color: var(--text-gray); }
.top-bar-nav a:hover { color: var(--text-dark); }

/* ── Logo ── */
.top-bar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}
.top-bar-logo svg {
  height: 44px;
  width: auto;
}
/* Dark mode: flip the gray SVG letters to semi-transparent white */
.mode-dark .top-bar-logo svg path[fill="#777"] { fill: rgba(255,255,255,0.5); }

/* ── Right icons ── */
.top-bar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.top-bar-icon {
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  position: relative;
  text-decoration: none;
  transition: background var(--transition);
}
.top-bar-icon svg {
  width: 20px;
  height: 20px;
}
.mode-cream .top-bar-icon { color: var(--text-gray); }
.mode-cream .top-bar-icon:hover { background: rgba(0,0,0,0.04); }
.mode-dark .top-bar-icon { color: var(--text-light-2); }
.mode-dark .top-bar-icon:hover { background: rgba(255,255,255,0.06); }
.top-bar-icon { color: var(--text-gray); }
.cart-badge {
  position: absolute;
  top: 0;
  right: -2px;
  background: var(--orange);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── City selector ── */
.city-selector {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}
.mode-cream .city-selector { background: rgba(0,0,0,0.04); color: var(--text-gray); }
.mode-dark .city-selector { background: rgba(255,255,255,0.06); color: var(--text-light-2); }
.city-selector { color: var(--text-gray); }

/* ── Burger button (mobile only) ── */
.burger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.mode-cream .burger { color: var(--text-dark); }
.mode-dark .burger { color: var(--text-light); }
.burger { color: var(--text-dark); }

/* ── Mobile nav drawer ── */
.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 300;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.nav-overlay.open {
  opacity: 1;
  visibility: visible;
}
.nav-drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  height: 100%;
  background: var(--canvas);
  z-index: 301;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
}
.nav-overlay.open .nav-drawer {
  transform: translateX(0);
}
.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
}
.drawer-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}
.drawer-logo svg {
  height: 36px;
  width: auto;
}
.drawer-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-dark);
  padding: 4px;
}
.drawer-links {
  list-style: none;
  padding: 0 20px;
  margin: 0;
}
.drawer-links li {
  border-bottom: 1px solid var(--card-border);
}
.drawer-links a {
  display: block;
  padding: 14px 0;
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-dark);
}

/* ── Cart drawer ── */
.cart-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 300;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.cart-drawer-overlay.open {
  opacity: 1;
  visibility: visible;
}
.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 400px;
  max-width: 100vw;
  height: 100%;
  background: var(--charcoal);
  z-index: 301;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}
.cart-drawer-overlay.open .cart-drawer {
  transform: translateX(0);
}
.cart-drawer .drawer-header {
  padding: 20px;
  border-bottom: 1px solid var(--charcoal-border);
}
.drawer-details-link {
  font-size: 13px;
  color: var(--orange);
  text-decoration: none;
  margin-left: auto;
  margin-right: 16px;
}
.drawer-details-link:hover {
  text-decoration: underline;
}
.cart-drawer .drawer-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-light);
}
.cart-drawer .drawer-close {
  color: var(--text-light-2);
}
.cart-drawer .drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}
.cart-drawer .drawer-footer {
  padding: 20px;
  border-top: 1px solid var(--charcoal-border);
}

/* ── Footer ── */
.site-footer {
  background: var(--charcoal);
  color: var(--text-light-2);
  padding: 60px 0 0;
}
.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 32px;
}
.footer-brand .logo-row {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text-light);
}
.footer-brand .tagline {
  font-size: 14px;
  margin-top: 12px;
  color: var(--text-light-3);
}
.footer-socials {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}
.footer-socials a {
  color: var(--text-light-2);
  transition: color var(--transition);
}
.footer-socials a:hover {
  color: #fff;
}
.footer-socials svg {
  width: 20px;
  height: 20px;
}
.footer-col h4 {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-light);
  margin-bottom: 16px;
}
.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.footer-col li {
  margin-bottom: 10px;
}
.footer-col a {
  color: var(--text-light-2);
  text-decoration: none;
  font-size: 14px;
  transition: color var(--transition);
}
.footer-col a:hover {
  color: #fff;
}
.footer-mascot {
  margin-top: 20px;
}
.footer-mascot svg {
  height: 60px;
  width: auto;
  opacity: 0.7;
}
.footer-badges {
  margin-top: 32px;
  padding: 16px 0;
}
.footer-badges .container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-badges img {
  height: 40px;
  width: auto;
  display: block;
}
.footer-bottom {
  margin-top: 16px;
  padding: 20px 0;
  border-top: 1px solid var(--charcoal-border);
  text-align: center;
  font-size: 13px;
  color: var(--text-light-3);
}

/* ── Tablet responsive ── */
@media (max-width: 1024px) {
  .footer-inner {
    grid-template-columns: 2fr 1fr 1fr;
    gap: 24px;
  }
}

/* ── Mobile responsive ── */
@media (max-width: 768px) {
  .top-bar {
    height: 56px;
  }
  .top-bar-nav {
    display: none;
  }
  .burger {
    display: flex;
  }
  .city-selector {
    display: none;
  }
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}
