/* habb — site navigation v2 (announcement bar + minimal sticky header + drawers)
 * Pattern: Mikuna / Aesop / Le Labo — three things in the header, the rest in a drawer.
 * Auto-injected by /assets/nav.js. Pages with <body data-nav="off"> are skipped.
 */

/* ──────────────────────────────────────────────────────────────────────
   Tokens (fall back to per-page :root values)
   ──────────────────────────────────────────────────────────────────── */
:root {
  --habb-cream:        #F4EEE4;
  --habb-cream-soft:   #ECE3D4;
  --habb-terracotta:   #C07A5C;
  --habb-terracotta-d: #A25F42;
  --habb-espresso:     #3D2A1F;
  --habb-espresso-d:   #2A1B12;
  --habb-rule:         rgba(61, 42, 31, 0.18);
}

/* ──────────────────────────────────────────────────────────────────────
   Skip link (a11y)
   ──────────────────────────────────────────────────────────────────── */
.skip-link {
  position: absolute;
  top: -48px;
  left: 16px;
  z-index: 300;
  padding: 10px 18px;
  background: var(--habb-espresso-d);
  color: var(--habb-cream);
  font-family: 'Manrope', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: top 220ms cubic-bezier(0.22, 1, 0.36, 1);
}
.skip-link:focus-visible {
  top: 16px;
  outline: 2px solid var(--habb-terracotta);
  outline-offset: 2px;
}

/* Focus-visible default for site-wide interactive elements */
:where(a, button, input, select, textarea, [role="button"]):focus { outline: none; }
:where(a, button, input, select, textarea, [role="button"]):focus-visible {
  outline: 2px solid var(--habb-terracotta);
  outline-offset: 3px;
}
:where(#main) { scroll-margin-top: 100px; }

/* ──────────────────────────────────────────────────────────────────────
   Announcement bar — fixed at top, persistent, rotating messages
   ──────────────────────────────────────────────────────────────────── */
.habb-announce {
  position: relative;
  z-index: 110;
  background: var(--habb-espresso);
  color: var(--habb-cream);
  font-family: 'Manrope', system-ui, sans-serif;
  font-size: 12px;
  letter-spacing: 0.02em;
  text-align: center;
  padding: 0 16px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.habb-announce-track {
  position: relative;
  width: 100%;
  height: 100%;
}
.habb-announce-item {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 500ms ease;
  padding: 0 32px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.habb-announce-item.active { opacity: 1; }
.habb-announce-item a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(244, 238, 228, 0.5);
}
.habb-announce-item a:hover {
  text-decoration-color: var(--habb-terracotta);
}

@media (max-width: 640px) {
  .habb-announce {
    height: 32px;
    font-size: 11px;
  }
  .habb-announce-item { padding: 0 16px; }
}

/* ──────────────────────────────────────────────────────────────────────
   Site header — sticky, transparent → cream on scroll
   ──────────────────────────────────────────────────────────────────── */
.habb-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 64px;
  padding: 0 clamp(16px, 4vw, 32px);
  background: transparent;
  transition: background 280ms cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 280ms ease;
}
.habb-header.scrolled {
  background: rgba(244, 238, 228, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 1px 4px rgba(61, 42, 31, 0.08);
}

.habb-header .menu-toggle {
  justify-self: start;
  background: transparent;
  border: none;
  cursor: pointer;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--habb-espresso);
}
.habb-header .menu-toggle svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 1.6;
  fill: none;
  stroke-linecap: round;
}

.habb-header .wordmark {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  line-height: 0;
  text-decoration: none;
}
.habb-header .wordmark img {
  height: 24px;
  width: auto;
  display: block;
  transition: filter 200ms ease;
}

/* Cream scroll-state — wordmark stays terracotta; menu/cart icons stay espresso */
.habb-header.scrolled .menu-toggle,
.habb-header.scrolled .cart-toggle {
  color: var(--habb-espresso);
}

.habb-header .cart-toggle {
  justify-self: end;
  background: transparent;
  border: none;
  cursor: pointer;
  position: relative;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--habb-espresso);
}
.habb-header .cart-toggle svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 1.6;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.habb-header .cart-count {
  position: absolute;
  top: 6px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--habb-terracotta);
  color: var(--habb-cream);
  font-family: 'Manrope', sans-serif;
  font-size: 10px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0;
}

/* When the page hero sits behind a transparent header (top of page only),
   force a light tone for hover states so the icons stay readable. */
.habb-header:not(.scrolled) .menu-toggle:hover,
.habb-header:not(.scrolled) .cart-toggle:hover {
  color: var(--habb-terracotta);
}
.habb-header.scrolled .menu-toggle:hover,
.habb-header.scrolled .cart-toggle:hover {
  color: var(--habb-terracotta);
}

@media (max-width: 640px) {
  .habb-header {
    height: 56px;
    padding: 0 clamp(12px, 4vw, 24px);
  }
  .habb-header .wordmark img { height: 20px; }
}

/* ──────────────────────────────────────────────────────────────────────
   Drawer overlay (shared by both drawers)
   ──────────────────────────────────────────────────────────────────── */
.habb-overlay {
  position: fixed;
  inset: 0;
  background: rgba(42, 27, 18, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 320ms ease;
  z-index: 199;
}
.habb-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

/* ──────────────────────────────────────────────────────────────────────
   Nav drawer — slides in from the LEFT
   ──────────────────────────────────────────────────────────────────── */
.habb-drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 380px;
  max-width: 100vw;
  height: 100vh;
  background: var(--habb-cream);
  transform: translateX(-100%);
  transition: transform 360ms cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 200;
  display: flex;
  flex-direction: column;
  padding: clamp(24px, 4vh, 36px) clamp(28px, 4vw, 40px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.habb-drawer.open { transform: translateX(0); }

.habb-drawer .drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: clamp(28px, 5vh, 48px);
}
.habb-drawer .drawer-head .wordmark {
  line-height: 0;
  display: inline-flex;
}
.habb-drawer .drawer-head .wordmark img {
  height: 22px;
  width: auto;
}
.habb-drawer .drawer-close {
  background: transparent;
  border: 0;
  padding: 0;
  width: 32px;
  height: 32px;
  cursor: pointer;
  color: var(--habb-espresso);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.habb-drawer .drawer-close svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.6;
  fill: none;
  stroke-linecap: round;
}
.habb-drawer .drawer-close:hover { color: var(--habb-terracotta); }

.habb-drawer .nav-primary {
  display: flex;
  flex-direction: column;
  list-style: none;
  margin: 0;
  padding: 0;
}
.habb-drawer .nav-primary li {
  border-bottom: 1px solid rgba(61, 42, 31, 0.08);
}
.habb-drawer .nav-primary li:last-child {
  border-bottom: 1px solid rgba(192, 122, 92, 0.3);
}
.habb-drawer .nav-primary a {
  display: block;
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 400;
  font-size: clamp(20px, 2.4vw, 26px);
  letter-spacing: -0.01em;
  color: var(--habb-espresso);
  text-decoration: none;
  padding: 16px 0;
  transition: color 200ms ease, padding-left 220ms cubic-bezier(0.22, 1, 0.36, 1);
}
.habb-drawer .nav-primary a:hover {
  color: var(--habb-terracotta);
  padding-left: 6px;
}

.habb-drawer .nav-secondary {
  display: flex;
  flex-direction: column;
  list-style: none;
  margin: clamp(20px, 3vh, 28px) 0 0;
  padding: 0;
}
.habb-drawer .nav-secondary a {
  display: block;
  font-family: 'Manrope', system-ui, sans-serif;
  font-size: 14px;
  letter-spacing: 0.01em;
  color: rgba(61, 42, 31, 0.6);
  text-decoration: none;
  padding: 8px 0;
  transition: color 200ms ease;
}
.habb-drawer .nav-secondary a:hover { color: var(--habb-espresso); }

.habb-drawer .drawer-foot {
  margin-top: auto;
  padding-top: clamp(28px, 4vh, 36px);
}
.habb-drawer .social-row {
  display: flex;
  gap: 18px;
  margin-bottom: 18px;
}
.habb-drawer .social-row a {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--habb-espresso);
  border: 1px solid var(--habb-rule);
  border-radius: 50%;
  transition: color 200ms ease, border-color 200ms ease;
}
.habb-drawer .social-row a:hover {
  color: var(--habb-terracotta);
  border-color: var(--habb-terracotta);
}
.habb-drawer .social-row svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 1.6;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.habb-drawer .copyright {
  font-family: 'Manrope', system-ui, sans-serif;
  font-size: 11px;
  color: rgba(61, 42, 31, 0.45);
  letter-spacing: 0.02em;
}

@media (max-width: 480px) {
  .habb-drawer { width: 100vw; }
}

/* ──────────────────────────────────────────────────────────────────────
   Cart drawer — slides in from the RIGHT
   ──────────────────────────────────────────────────────────────────── */
.habb-cart {
  position: fixed;
  top: 0;
  right: 0;
  width: 420px;
  max-width: 100vw;
  height: 100vh;
  background: var(--habb-cream);
  transform: translateX(100%);
  transition: transform 360ms cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 200;
  display: flex;
  flex-direction: column;
  padding: clamp(24px, 4vh, 36px) clamp(28px, 4vw, 40px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.habb-cart.open { transform: translateX(0); }

.habb-cart .cart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: clamp(32px, 6vh, 56px);
}
.habb-cart .cart-head h2 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 400;
  font-size: 22px;
  letter-spacing: -0.012em;
  color: var(--habb-espresso);
  margin: 0;
}
.habb-cart .drawer-close {
  background: transparent;
  border: 0;
  padding: 0;
  width: 32px;
  height: 32px;
  cursor: pointer;
  color: var(--habb-espresso);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.habb-cart .drawer-close svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.6;
  fill: none;
  stroke-linecap: round;
}
.habb-cart .drawer-close:hover { color: var(--habb-terracotta); }

.habb-cart .cart-empty {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 18px;
  padding: 48px 12px;
}
.habb-cart .cart-empty .icon {
  width: 56px;
  height: 56px;
  border: 1px solid var(--habb-rule);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--habb-espresso);
}
.habb-cart .cart-empty .icon svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 1.6;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.habb-cart .cart-empty p {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 400;
  font-size: 18px;
  color: var(--habb-espresso);
  margin: 0;
  max-width: 22ch;
  line-height: 1.4;
}
.habb-cart .cart-empty .lede {
  font-family: 'Manrope', system-ui, sans-serif;
  font-size: 13px;
  color: rgba(61, 42, 31, 0.65);
  margin-top: 4px;
}
.habb-cart .cart-empty a.cta {
  margin-top: 16px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  background: var(--habb-terracotta);
  color: var(--habb-cream);
  font-family: 'Manrope', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background 200ms ease;
}
.habb-cart .cart-empty a.cta:hover { background: var(--habb-terracotta-d); }

/* ──────────────────────────────────────────────────────────────────────
   Body scroll lock when a drawer is open
   ──────────────────────────────────────────────────────────────────── */
body.habb-drawer-open {
  overflow: hidden;
}

/* ──────────────────────────────────────────────────────────────────────
   Reduced motion
   ──────────────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .habb-header, .habb-drawer, .habb-cart, .habb-overlay,
  .habb-announce-item, .habb-drawer .nav-primary a {
    transition: none !important;
  }
}
