/* ============================================================
   ThePetChef – Header  (PawPots-inspired)
   ============================================================ */

/* header.css — legacy file, kept for reference.
   All active header CSS is now in header.php inline <style>.
   Body padding-top and header positioning are controlled there.  */

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

/* ── ANNOUNCEMENT BAR ─────────────────────────────────────── */
.announcement-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 901;
  height: var(--bar-h);
  background: #e8a020;          /* warm amber — change to any promo colour */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 48px;
  transition: transform .35s var(--ease-out);
}
.announcement-bar.is-hidden {
  transform: translateY(-100%);
}
.announcement-bar__text {
  font-size: .82rem;
  font-weight: 700;
  color: var(--ink);
  text-align: center;
  letter-spacing: .01em;
}
.announcement-bar__text a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.announcement-bar__close {
  position: absolute;
  right: 14px;
  width: 28px; height: 28px;
  border: none; background: transparent;
  cursor: pointer; color: var(--ink);
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-pill);
  opacity: .7;
  transition: opacity .15s, background .15s;
}
.announcement-bar__close:hover { opacity: 1; background: rgba(0,0,0,.12); }
.announcement-bar__close svg { width: 14px; height: 14px; }

/* ── MAIN HEADER ──────────────────────────────────────────── */
.site-header {
  position: fixed;
  top: var(--bar-h);
  left: 0; right: 0;
  z-index: 900;
  height: var(--header-h);
  background: #f7f2ea;
  transition: top .35s var(--ease-out), box-shadow .3s;
}
.site-header.bar-hidden { top: 0; }
.site-header.is-scrolled { box-shadow: 0 2px 12px rgba(0,0,0,.10); background: #ede8df; }

.site-header__inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 28px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 0;
}

/* ── Logo ─────────────────────────────────────────────────── */
.site-logo {
  text-decoration: none;
  flex-shrink: 0;
  margin-right: 36px;
  display: flex;
  align-items: center;
}
.site-logo img {
  height: 46px;
  width: auto;
  display: block;
  /* light header — preserve logo colors */
  filter: none;
}

/* ── Primary Nav ──────────────────────────────────────────── */
.primary-nav { flex: 1; display: flex; align-items: center; }
.nav-menu {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 2px;
}
.nav-menu > li { position: relative; }

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  font-size: .9rem;
  font-weight: 700;
  color: #3d5048;
  text-decoration: none;
  white-space: nowrap;
  transition: color .18s, background .18s;
  letter-spacing: .01em;
}
.nav-link:hover,
.nav-link:focus-visible,
.nav-link.is-active {
  color: #1a2e25;
  background: rgba(26,46,37,.07);
  outline: none;
}
/* dropdown chevron */
.nav-link .chev {
  width: 13px; height: 13px;
  opacity: .65;
  transition: transform .25s var(--ease-out);
}
.nav-menu > li:hover .chev,
.nav-menu > li:focus-within .chev { transform: rotate(180deg); opacity: 1; }

/* dropdown panel */
.nav-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 190px;
  background: #ffffff;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: var(--radius-md);
  padding: 6px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity .2s, transform .2s var(--ease-out);
  box-shadow: var(--shadow-md);
}
.nav-menu > li:hover .nav-dropdown,
.nav-menu > li:focus-within .nav-dropdown {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.nav-dropdown a {
  display: block;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 600;
  color: #3d5048;
  text-decoration: none;
  transition: background .15s, color .15s;
}
.nav-dropdown a:hover { background: rgba(26,46,37,.05); color: #1a2e25; }

/* ── Right side actions ───────────────────────────────────── */
.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
}

/* CTA pill — "Build a Plan" */
.header-cta {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 22px;
  background: #3d7a5e;
  color: #ffffff !important;
  border-radius: var(--radius-pill);
  text-decoration: none;
  font-weight: 800;
  font-size: .875rem;
  line-height: 1.2;
  transition: background .2s, transform .15s;
  white-space: nowrap;
}
.header-cta span {
  font-size: .68rem;
  font-weight: 600;
  opacity: .75;
}
.header-cta:hover  { background: #2d6a4e; transform: translateY(-1px); }
.header-cta:active { transform: translateY(0); }

/* icon buttons */
.header-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 12px;
  border: none;
  background: transparent;
  color: #3d5048;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-family: inherit;
  font-size: .875rem;
  font-weight: 700;
  text-decoration: none;
  transition: background .18s, color .18s;
  white-space: nowrap;
}
.header-btn svg { width: 20px; height: 20px; flex-shrink: 0; }
.header-btn:hover { background: rgba(26,46,37,.06); color: #1a2e25; }

/* account btn shows label on desktop */
.header-btn__label { display: inline; font-size: .875rem; }

/* cart badge */
.cart-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px; height: 20px;
  padding: 0 5px;
  background: #3d7a5e;
  color: #ffffff;
  border-radius: var(--radius-pill);
  font-size: .68rem;
  font-weight: 800;
  line-height: 1;
  transition: transform .25s var(--ease-out), background .2s;
}
.cart-badge.bump { animation: bump .35s var(--ease-out); }
@keyframes bump { 0%{transform:scale(1)} 40%{transform:scale(1.5)} 100%{transform:scale(1)} }

/* divider */
.header-divider {
  width: 1px; height: 22px;
  background: rgba(255,255,255,.15);
  flex-shrink: 0;
  margin: 0 4px;
}

/* hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 38px; height: 38px;
  border: none; background: transparent;
  cursor: pointer; gap: 5px;
  border-radius: var(--radius-sm);
  transition: background .2s;
  margin-right: 12px;
}
.nav-toggle:hover { background: rgba(255,255,255,.08); }
.nav-toggle span {
  display: block; width: 22px; height: 2px;
  background: var(--white); border-radius: 2px;
  transition: transform .3s var(--ease-out), opacity .3s;
}
.nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── CART DRAWER (LEFT) ───────────────────────────────────── */
.cart-drawer {
  position: fixed; inset: 0;
  z-index: 1000; pointer-events: none;
}
.cart-drawer.is-open { pointer-events: auto; }

.cart-overlay {
  position: absolute; inset: 0;
  background: rgba(10,14,13,.6);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .35s var(--ease-out), visibility .35s;
  cursor: pointer;
}
.cart-drawer.is-open .cart-overlay { opacity: 1; visibility: visible; }

.cart-panel {
  position: absolute; top: 0; left: 0;
  width: 400px; max-width: 100vw; height: 100%;
  background: var(--white);
  display: flex; flex-direction: column;
  transform: translateX(-100%);
  transition: transform .4s var(--ease-out);
  box-shadow: var(--shadow-lg);
}
.cart-drawer.is-open .cart-panel { transform: translateX(0); }

.cart-panel__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 22px;
  background: #f7f2ea;
  color: var(--white);
  flex-shrink: 0;
}
.cart-panel__title {
  display: flex; align-items: center; gap: 10px;
  font-size: 1rem; font-weight: 800; color: var(--white);
}
.cart-panel__title svg { width: 20px; height: 20px; }
.cart-panel__title .count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px; padding: 0 6px;
  background: var(--taupe); color: var(--ink);
  border-radius: var(--radius-pill); font-size: .72rem; font-weight: 800;
}
.cart-close-btn {
  width: 34px; height: 34px;
  border: none; background: rgba(255,255,255,.12);
  border-radius: var(--radius-pill); cursor: pointer; color: var(--white);
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.cart-close-btn:hover { background: rgba(255,255,255,.22); }
.cart-close-btn svg { width: 15px; height: 15px; }

/* free-shipping bar */
.shipping-bar {
  padding: 11px 22px; background: var(--linen);
  border-bottom: 1px solid rgba(209,178,160,.3);
  font-size: .78rem; color: var(--eucalyptus-dk); flex-shrink: 0;
}
.shipping-bar__track {
  height: 5px; background: rgba(95,111,104,.2);
  border-radius: 5px; margin-top: 6px; overflow: hidden;
}
.shipping-bar__fill {
  height: 100%; background: var(--eucalyptus);
  border-radius: 5px; transition: width .5s var(--ease-out);
}

/* items */
.cart-panel__body {
  flex: 1; overflow-y: auto; padding: 16px 22px;
  scrollbar-width: thin; scrollbar-color: var(--taupe) transparent;
}
.cart-empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; height: 100%; text-align: center;
  gap: 14px; color: var(--taupe-dark); padding: 40px 0;
}
.cart-empty svg { width: 52px; height: 52px; opacity: .3; }
.cart-empty p { font-size: .9rem; }
.cart-empty a {
  padding: 11px 24px; background: var(--eucalyptus); color: var(--white);
  border-radius: var(--radius-pill); font-weight: 700; font-size: .875rem;
  text-decoration: none; transition: background .2s;
}
.cart-empty a:hover { background: var(--eucalyptus-dk); }

.cart-item {
  display: grid; grid-template-columns: 68px 1fr auto;
  gap: 12px; align-items: start;
  padding: 14px 0; border-bottom: 1px solid rgba(209,178,160,.2);
}
.cart-item:last-child { border-bottom: none; }
.cart-item__img {
  width: 68px; height: 68px; border-radius: var(--radius-sm);
  object-fit: cover; background: var(--linen);
}
.cart-item__name {
  font-size: .88rem; font-weight: 700; color: var(--ink);
  margin-bottom: 6px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.cart-item__meta { font-size: .72rem; color: var(--taupe-dark); margin-bottom: 8px; }
.cart-item__qty {
  display: inline-flex; align-items: center;
  border: 1.5px solid rgba(209,178,160,.5); border-radius: var(--radius-pill); overflow: hidden;
}
.cart-item__qty button {
  width: 28px; height: 28px; border: none; background: transparent;
  font-size: 1.1rem; font-weight: 700; color: var(--eucalyptus-dk);
  cursor: pointer; transition: background .15s; line-height: 1;
}
.cart-item__qty button:hover { background: var(--linen); }
.cart-item__qty span {
  width: 28px; text-align: center; font-size: .875rem; font-weight: 700;
}
.cart-item__price { font-size: .9rem; font-weight: 800; color: var(--eucalyptus-dk); white-space: nowrap; }
.cart-item__remove {
  display: block; margin-top: 5px; font-size: .7rem; color: var(--taupe-dark);
  background: none; border: none; padding: 0; cursor: pointer; transition: color .15s;
}
.cart-item__remove:hover { color: #c0392b; }

.cart-panel__foot {
  padding: 18px 22px 22px; border-top: 1px solid rgba(209,178,160,.25);
  flex-shrink: 0; display: flex; flex-direction: column; gap: 10px;
}
.cart-subtotal {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: .875rem; color: var(--eucalyptus-dk);
}
.cart-subtotal .amount { font-size: 1.15rem; font-weight: 800; color: var(--ink); }
.cart-note { font-size: .72rem; color: var(--taupe-dark); text-align: center; }
.btn-checkout {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 15px 24px; background: var(--ink); color: var(--white);
  border: none; border-radius: var(--radius-pill); font-family: inherit;
  font-size: .95rem; font-weight: 800; text-decoration: none;
  cursor: pointer; transition: background .2s, transform .15s;
}
.btn-checkout:hover { background: var(--eucalyptus-dk); transform: translateY(-1px); }
.btn-view-cart {
  display: block; text-align: center; font-size: .85rem; font-weight: 600;
  color: var(--eucalyptus-dk); text-decoration: none; transition: color .15s;
}
.btn-view-cart:hover { color: var(--eucalyptus); }

/* ── AUTH MODAL ───────────────────────────────────────────── */
.auth-modal {
  position: fixed; inset: 0; z-index: 1100;
  pointer-events: none; display: flex;
  align-items: center; justify-content: center; padding: 16px;
}
.auth-modal.is-open { pointer-events: auto; }
.auth-overlay {
  position: absolute; inset: 0;
  background: rgba(10,14,13,.6);
  backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
  opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s; cursor: pointer;
}
.auth-modal.is-open .auth-overlay { opacity: 1; visibility: visible; }
.auth-panel {
  position: relative; z-index: 1;
  width: 100%; max-width: 430px;
  background: var(--white); border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); overflow: hidden;
  transform: scale(.94) translateY(14px); opacity: 0;
  transition: transform .35s var(--ease-out), opacity .3s;
}
.auth-modal.is-open .auth-panel { transform: scale(1) translateY(0); opacity: 1; }

/* modal dark header stripe */
.auth-panel__head {
  background: #f7f2ea; padding: 22px 24px 18px;
  display: flex; align-items: center; justify-content: space-between;
}
.auth-brand { display: flex; align-items: center; gap: 10px; }
.auth-brand img { height: 34px; filter: brightness(0) invert(1); }
.auth-brand-name { font-size: .95rem; font-weight: 800; color: var(--white); }
.auth-brand-tag  { font-size: .68rem; font-weight: 400; color: rgba(255,255,255,.55); letter-spacing: .05em; }
.auth-close {
  width: 30px; height: 30px; border: none;
  background: rgba(255,255,255,.12); border-radius: var(--radius-pill);
  cursor: pointer; color: var(--white);
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.auth-close:hover { background: rgba(255,255,255,.22); }
.auth-close svg { width: 13px; height: 13px; }

.auth-tabs {
  display: flex; margin: 18px 24px 0;
  background: #f7f2ea; border-radius: var(--radius-sm); padding: 4px;
}
.auth-tab {
  flex: 1; padding: 9px 12px; border: none; background: transparent;
  border-radius: calc(var(--radius-sm) - 2px); font-family: inherit;
  font-size: .875rem; font-weight: 700; color: var(--taupe-dark); cursor: pointer;
  transition: background .2s, color .2s;
}
.auth-tab.is-active {
  background: var(--white); color: var(--ink);
  box-shadow: 0 1px 4px rgba(0,0,0,.10);
}

.auth-body { padding: 20px 24px 26px; }
.auth-panel-content { display: none; }
.auth-panel-content.is-active { display: block; }
.auth-greeting { font-size: 1.25rem; font-weight: 800; color: var(--ink); margin-bottom: 4px; }
.auth-sub { font-size: .82rem; color: var(--taupe-dark); margin-bottom: 18px; }

.form-field { margin-bottom: 13px; }
.form-field label { display: block; font-size: .78rem; font-weight: 700; color: var(--eucalyptus-dk); margin-bottom: 5px; }
.form-field input {
  width: 100%; padding: 11px 14px;
  border: 1.5px solid rgba(209,178,160,.5); border-radius: var(--radius-sm);
  font-family: inherit; font-size: .875rem; color: var(--ink);
  background: var(--white); transition: border-color .2s, box-shadow .2s; outline: none;
}
.form-field input:focus {
  border-color: var(--eucalyptus);
  box-shadow: 0 0 0 3px rgba(95,111,104,.15);
}
.form-field input::placeholder { color: var(--taupe); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }

.pw-field { position: relative; }
.pw-toggle {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  border: none; background: transparent; cursor: pointer; color: var(--taupe-dark);
  display: flex; align-items: center; transition: color .15s;
}
.pw-toggle:hover { color: var(--eucalyptus-dk); }
.pw-toggle svg { width: 16px; height: 16px; }
.hidden { display: none !important; }

.form-meta {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px; font-size: .78rem;
}
.form-remember { display: flex; align-items: center; gap: 6px; cursor: pointer; font-weight: 600; color: var(--eucalyptus-dk); }
.form-remember input { accent-color: var(--eucalyptus); }
.form-forgot { color: var(--eucalyptus); font-weight: 600; text-decoration: none; }
.form-forgot:hover { text-decoration: underline; }

.btn-auth {
  width: 100%; padding: 13px; background: var(--ink); color: var(--white);
  border: none; border-radius: var(--radius-pill); font-family: inherit;
  font-size: .95rem; font-weight: 800; cursor: pointer;
  transition: background .2s, transform .15s;
}
.btn-auth:hover { background: var(--eucalyptus-dk); transform: translateY(-1px); }
.auth-terms {
  margin-top: 13px; font-size: .7rem; color: var(--taupe-dark); text-align: center; line-height: 1.5;
}
.auth-terms a { color: var(--eucalyptus); }

/* ── MOBILE NAV ───────────────────────────────────────────── */
@media (max-width: 1020px) {
  .nav-toggle { display: flex; }
  .header-btn__label { display: none; }

  .primary-nav {
    position: fixed;
    top: var(--total-h); left: 0; right: 0;
    height: calc(100dvh - var(--total-h));
    background: #f7f2ea;
    flex-direction: column; align-items: flex-start;
    padding: 20px; gap: 2px;
    transform: translateX(-100%);
    transition: transform .35s var(--ease-out);
    overflow-y: auto; z-index: 899;
  }
  .site-header.bar-hidden ~ .primary-nav,
  .primary-nav.bar-hidden {
    top: var(--header-h);
    height: calc(100dvh - var(--header-h));
  }
  .primary-nav.is-open { transform: translateX(0); }

  .nav-menu { flex-direction: column; align-items: flex-start; width: 100%; gap: 1px; }
  .nav-menu > li { width: 100%; }
  .nav-link { width: 100%; padding: 13px 16px; font-size: 1rem; border-radius: var(--radius-sm); }
  .nav-dropdown {
    position: static; transform: none; opacity: 1; pointer-events: auto;
    background: rgba(255,255,255,.05); box-shadow: none; border: none;
    margin-top: 2px; padding-left: 14px;
  }
  .nav-dropdown a { color: rgba(255,255,255,.7); }

  .header-cta { padding: 7px 16px; font-size: .8rem; }
}

@media (max-width: 480px) {
  :root { --bar-h: 36px; --header-h: 60px; }
  .cart-panel { width: 100vw; }
}

:focus-visible { outline: 2px solid var(--taupe); outline-offset: 2px; }
