/* ==========================================================================
   VETALUX — Header v2 (index.html)
   Announcement bar + main bar + phone search row, all inside the fixed
   #stickyHeaderWrap. Breakpoints: phone ≤720, tablet 721–1100, desktop >1100.
   ========================================================================== */

.hv2 {
  --hdr-main: 76px;
  --hdr-extra: 38px;           /* announcement bar (desktop/tablet) or search row (phone) */
}

body { padding-top: calc(var(--hdr-main, 76px) + var(--hdr-extra, 38px)); }

@media (max-width: 1100px) {
  .hv2 { --hdr-main: 70px; }
  body { --hdr-main: 70px; }
}

@media (max-width: 720px) {
  .hv2 { --hdr-main: 62px; --hdr-extra: 58px; }
  body { --hdr-main: 62px; --hdr-extra: 58px; }
}

.hv2 .site-header {
  height: var(--hdr-main);
  background: rgba(255, 252, 246, 0.88);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid rgba(226, 197, 149, 0.45);
}

.hv2.scrolled .site-header {
  background: rgba(255, 255, 255, 0.94);
  box-shadow: none;
}

.hv2.scrolled {
  box-shadow: 0 10px 30px rgba(30, 21, 11, 0.08);
}

.hv2 .header-container { gap: 20px; }

/* --------------------------------------------------------------------------
   Announcement bar
   -------------------------------------------------------------------------- */
.hdr-topbar {
  height: var(--hdr-extra);
  overflow: hidden;
  background:
    radial-gradient(400px 60px at 15% 50%, rgba(240, 178, 35, 0.22), transparent 70%),
    var(--color-bg-dark);
  color: rgba(248, 236, 214, 0.86);
  font-size: 0.8rem;
  transition: height .35s cubic-bezier(.22, 1, .36, 1), opacity .25s ease;
}

.hv2.scrolled .hdr-topbar { height: 0; opacity: 0; }

.hdr-topbar-inner {
  height: var(--hdr-extra);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.hdr-topbar-msg {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hdr-topbar-msg strong { color: var(--c-gold-bright); letter-spacing: 0.04em; }
.hdr-topbar-sep { color: var(--c-gold-primary); opacity: .7; }

.hdr-topbar-tag {
  flex: none;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--c-gold-primary);
  color: #1e140a;
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.hdr-topbar-links {
  flex: none;
  display: flex;
  align-items: center;
  gap: 22px;
}

.hdr-topbar-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(248, 236, 214, 0.86);
  font-weight: 600;
  transition: color .2s ease;
}

.hdr-topbar-links a:hover { color: var(--c-gold-bright); }
.hdr-topbar-links svg { width: 14px; height: 14px; color: var(--c-coral); }

.hdr-topbar-concierge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Brand
   -------------------------------------------------------------------------- */
.hv2 .brand-logo { gap: 10px; }

.hv2 .site-header .brand-logo-image { width: 46px; height: 46px; }

.brand-wordmark {
  display: flex;
  flex-direction: column;
  font-family: var(--font-display);
  font-size: 1.32rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  line-height: 1;
  color: var(--color-text-main);
}

.brand-wordmark small {
  margin-top: 4px;
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--c-amber-deep);
}

/* --------------------------------------------------------------------------
   Desktop navigation
   -------------------------------------------------------------------------- */
.hv2 .desktop-nav .nav-list {
  gap: 2px;
  padding: 5px;
  border-radius: 999px;
  background: rgba(253, 236, 203, 0.45);
  border: 1px solid rgba(226, 197, 149, 0.5);
}

.hv2 .nav-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 13px;
  border-radius: 999px;
  font-size: 0.88rem;
  white-space: nowrap;
  color: var(--color-text-muted);
  background: transparent;
  border: 0;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease, box-shadow .2s ease;
}

.hv2 .nav-link::after { display: none; }

.hv2 .nav-link:hover { color: var(--color-text-main); background: rgba(255, 255, 255, 0.85); transform: none; }

.hv2 .nav-link.active {
  color: #1e140a;
  background: #fff;
  box-shadow: 0 2px 10px rgba(217, 138, 12, 0.16);
}

.nav-chevron { width: 14px; height: 14px; transition: transform .25s ease; }
.has-mega.is-open .nav-chevron { transform: rotate(180deg); }
.has-mega.is-open .nav-mega-trigger { color: var(--c-amber-deep); background: #fff; }

.nav-new-dot {
  width: 7px;
  height: 7px;
  margin-left: 2px;
  border-radius: 50%;
  background: var(--c-coral);
  box-shadow: 0 0 0 3px rgba(236, 114, 86, 0.18);
}

/* Mega dropdown */
.has-mega { position: relative; }

.nav-mega {
  position: absolute;
  top: calc(100% + 16px);
  left: 50%;
  width: 560px;
  padding: 14px;
  border-radius: 24px;
  background: #fff;
  border: 1px solid var(--color-border);
  box-shadow: 0 30px 60px rgba(30, 21, 11, 0.16);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 8px);
  transition: opacity .22s ease, transform .3s cubic-bezier(.22, 1, .36, 1), visibility 0s linear .3s;
  z-index: 20;
}

/* hover bridge so the pointer can travel from the trigger to the panel */
.nav-mega::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -18px;
  height: 18px;
}

.has-mega.is-open .nav-mega {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
  transition-delay: 0s;
}

.nav-mega-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.nav-mega-tile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: 16px;
  transition: background-color .2s ease;
}

.nav-mega-tile:last-child:nth-child(odd) { grid-column: span 2; }

.nav-mega-tile:hover { background: var(--color-primary-subtle); }

.nav-mega-tile img {
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  object-fit: cover;
  transition: transform .3s ease;
}

.nav-mega-tile:hover img { transform: scale(1.06) rotate(-2deg); }

.nav-mega-tile span,
.nav-mega-promo > span:nth-child(2) { display: flex; flex-direction: column; min-width: 0; }

.nav-mega-tile strong,
.nav-mega-promo strong {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--color-text-main);
}

.nav-mega-tile small,
.nav-mega-promo small { font-size: 0.75rem; color: var(--color-text-muted); }

.nav-mega-promo {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: linear-gradient(120deg, var(--c-cream-soft), #fbe2b0);
}

.nav-mega-promo-tag {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--color-bg-dark);
  color: var(--c-gold-bright);
  font-family: var(--font-display);
  font-weight: 900;
}

.nav-mega-promo > svg { width: 18px; height: 18px; margin-left: auto; color: var(--c-amber-deep); transition: transform .2s ease; }
.nav-mega-promo:hover > svg { transform: translateX(4px); }

/* --------------------------------------------------------------------------
   Actions
   -------------------------------------------------------------------------- */
.hv2 .header-actions { gap: 6px; }

.hv2 .action-btn {
  width: 42px;
  height: 42px;
  border-radius: 14px;
}

.hv2 .action-btn:hover { background: var(--c-cream-soft); transform: none; }

.hv2 .action-badge {
  top: 2px;
  right: 2px;
  min-width: 17px;
  height: 17px;
  font-size: 0.62rem;
  box-shadow: 0 0 0 2px #fff;
}

/* Search field */
.hdr-search-text,
.hdr-search-kbd { display: none; }

/* Cart pill */
.hdr-cart-label { display: none; }

.hv2 .cart-action-btn {
  width: auto;
  gap: 8px;
  padding: 0 16px 0 14px;
  border-radius: 999px;
  background: var(--color-bg-dark);
  color: #fff;
  box-shadow: 0 8px 20px rgba(30, 21, 11, 0.18);
}

.hv2 .cart-action-btn:hover { background: #33230f; color: #fff; }
.hv2 .cart-action-btn .icon-svg { width: 19px; height: 19px; }

.hv2 .cart-action-btn .hdr-cart-label {
  display: inline;
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 700;
}

.hv2 .cart-action-btn .cart-count-badge {
  position: static;
  min-width: 22px;
  height: 22px;
  box-shadow: none;
  font-size: 0.72rem;
}

/* Desktop: search as a field */
@media (min-width: 1101px) {
  .hv2 .hdr-search {
    width: 186px;
    justify-content: flex-start;
    gap: 9px;
    padding: 0 8px 0 14px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--color-border);
    color: var(--color-text-subtle);
  }

  .hv2 .hdr-search:hover { border-color: var(--color-border-hover); background: #fff; color: var(--color-text-muted); }
  .hv2 .hdr-search .icon-svg { width: 17px; height: 17px; color: var(--c-amber-deep); }

  .hv2 .hdr-search-text { display: inline; font-size: 0.85rem; flex: 1; text-align: left; }

  .hv2 .hdr-search-kbd {
    display: inline;
    padding: 3px 7px;
    border-radius: 7px;
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    font-family: var(--font-body);
    font-size: 0.66rem;
    font-weight: 700;
    color: var(--color-text-subtle);
  }
}

/* Narrow desktop: search shrinks to an icon so the nav fits */
@media (min-width: 1101px) and (max-width: 1300px) {
  .hv2 .hdr-search { width: 42px; padding: 0; justify-content: center; border-radius: 14px; }
  .hv2 .hdr-search-text,
  .hv2 .hdr-search-kbd { display: none; }
  .hv2 .nav-link { padding: 8px 12px; }
  .brand-wordmark small { display: none; }
}

/* Phone search row (hidden above 720px) */
.hdr-mobile-search { display: none; }

/* --------------------------------------------------------------------------
   Tablet 721–1100
   -------------------------------------------------------------------------- */
@media (max-width: 1100px) {
  .hv2 .desktop-nav { display: none; }
  .hv2 .mobile-toggle-btn { display: inline-flex; }

  .hdr-topbar-links a { display: none; }
}

@media (min-width: 721px) and (max-width: 1100px) {
  .hv2 .site-header .brand-logo {
    position: static;
    transform: none;
  }

  .hv2 #openAccountBtn { display: flex; }

  .hv2 .header-actions { flex: 1; justify-content: flex-end; }

  .hv2 .hdr-search {
    flex: 1;
    max-width: 380px;
    width: auto;
    margin-right: 6px;
    justify-content: flex-start;
    gap: 10px;
    padding: 0 16px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--color-border);
    color: var(--color-text-subtle);
  }

  .hv2 .hdr-search .icon-svg { width: 18px; height: 18px; color: var(--c-amber-deep); }
  .hv2 .hdr-search-text { display: inline; font-size: 0.88rem; }
}

/* --------------------------------------------------------------------------
   Phone ≤720
   -------------------------------------------------------------------------- */
@media (max-width: 720px) {
  .hdr-topbar { display: none; }

  .hv2 .header-container { gap: 8px; }
  .hv2 .mobile-toggle-btn { width: 42px; height: 42px; border-radius: 13px; }

  .hv2 .site-header .brand-logo {
    position: static;
    transform: none;
    gap: 7px;
    margin-right: auto;
  }
  .hv2 .site-header .brand-logo-image { width: 36px; height: 36px; }
  .brand-wordmark { font-size: 1.05rem; letter-spacing: 0.12em; }
  .brand-wordmark small { font-size: 0.48rem; letter-spacing: 0.26em; margin-top: 3px; }

  .hv2 #openAccountBtn,
  .hv2 #openWishlistBtn { display: none; }

  .hv2 .header-actions { gap: 4px; }

  /* search icon only appears once the search row has folded away */
  .hv2 .hdr-search {
    width: 0;
    min-width: 0 !important;
    padding: 0;
    opacity: 0;
    overflow: hidden;
    transition: width .3s ease, opacity .2s ease;
  }

  .hv2.scrolled .hdr-search { width: 42px; opacity: 1; }

  .hv2 .cart-action-btn { padding: 0 12px 0 11px; height: 42px; gap: 6px; }
  .hv2 .cart-action-btn .hdr-cart-label { display: none; }

  .hdr-mobile-search {
    display: block;
    height: var(--hdr-extra);
    overflow: hidden;
    background: rgba(255, 252, 246, 0.94);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(226, 197, 149, 0.45);
    transition: height .3s cubic-bezier(.22, 1, .36, 1), opacity .2s ease, border-color .2s ease;
  }

  .hv2.scrolled .hdr-mobile-search { height: 0; opacity: 0; border-bottom-color: transparent; }

  .hdr-mobile-search-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    height: 44px;
    margin-top: 2px;
    padding: 0 16px;
    border: 1px solid var(--color-border);
    border-radius: 14px;
    background: #fff;
    color: var(--color-text-subtle);
    font-family: var(--font-body);
    font-size: 0.88rem;
    text-align: left;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(217, 138, 12, 0.06);
  }

  .hdr-mobile-search-btn svg { flex: none; width: 18px; height: 18px; color: var(--c-amber-deep); }
  .hdr-mobile-search-btn span { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
}

@media (max-width: 360px) {
  .brand-wordmark small { display: none; }
  .hv2 .cart-action-btn { padding: 0 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .hdr-topbar, .hdr-mobile-search, .nav-mega, .hv2 .hdr-search { transition: none !important; }
}

/* never let the bar squeeze its controls */
.hv2 .mobile-toggle-btn,
.hv2 .action-btn,
.hv2 .brand-logo-image { flex-shrink: 0; }
.hv2 .action-btn .icon-svg { flex-shrink: 0; }
.hv2 .nav-chevron { flex-shrink: 0; display: block; }
@media (max-width: 360px) {
  .hv2 .header-container { gap: 6px; }
  .hv2 .site-header .brand-logo-image { width: 32px; height: 32px; }
  .brand-wordmark { font-size: 0.95rem; letter-spacing: 0.1em; }
}

/* in-page links land just below the (collapsed) fixed header */
html { scroll-padding-top: 90px; }
@media (max-width: 1100px) { html { scroll-padding-top: 84px; } }
@media (max-width: 720px) { html { scroll-padding-top: 74px; } }
