/* ==========================================================================
   Header / announcement / mobile drawer / search
   ========================================================================== */

/* Announcement bar — brand magenta */
.hcg-announce {
  background: var(--hcg-primary);
  color: #fff;
  font-size: .95rem;
  font-weight: 600;
  text-align: center;
  padding: .7em 0;
  letter-spacing: .01em;
}

/* Header shell — sticky, frosted, smart-hide on scroll */
.hcg-header {
  position: sticky; top: 0; z-index: 200;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--hcg-line);
  transition: transform var(--hcg-transition), box-shadow var(--hcg-transition);
}
.hcg-header.is-hidden { transform: translateY(-100%); }
.hcg-header.is-scrolled { box-shadow: var(--hcg-shadow); }

/* Three zones: [burger + search] · [logo] · [account/cart] */
.hcg-header__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: clamp(12px, 3vw, 32px);
  min-height: var(--hcg-header-height);
  padding-block: 12px;
}

.hcg-header__left { display: flex; align-items: center; gap: 14px; justify-self: start; min-width: 0; }

/* Logo centred */
.hcg-header__brand { justify-self: center; }
.hcg-header__brand img,
.hcg-header__brand .custom-logo { width: auto; height: 68px; border-radius: var(--hcg-radius-sm); }
.hcg-header__brand-text { font-weight: 700; font-size: 1.1rem; color: var(--hcg-primary); }

/* Search */
.hcg-search-form { display: flex; align-items: stretch; width: min(360px, 38vw); }
.hcg-search-form__input {
  flex: 1; min-width: 0;
  padding: .7em 1em;
  border: 1px solid var(--hcg-line);
  border-right: 0;
  border-radius: var(--hcg-radius-sm) 0 0 var(--hcg-radius-sm);
  font: inherit; background: var(--hcg-card-bg); color: var(--hcg-ink);
}
.hcg-search-form__input:focus { outline: 2px solid var(--hcg-primary); outline-offset: -2px; }
.hcg-search-form__submit {
  display: grid; place-items: center;
  width: 52px; flex: 0 0 auto;
  border: 0; border-radius: 0 var(--hcg-radius-sm) var(--hcg-radius-sm) 0;
  background: var(--hcg-primary); color: #fff; cursor: pointer;
  transition: background var(--hcg-transition);
}
.hcg-search-form__submit:hover { background: var(--hcg-primary-dark); }

/* Right actions */
.hcg-header__actions { display: flex; align-items: center; gap: 14px; justify-self: end; }
.hcg-header__action {
  position: relative;
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--hcg-primary-dark); font-weight: 600; font-size: .95rem; line-height: 1;
  transition: color var(--hcg-transition);
}
.hcg-header__action svg { stroke: var(--hcg-primary); transition: stroke var(--hcg-transition); }
.hcg-header__action:hover { color: var(--hcg-ink); }
.hcg-header__action:hover svg { stroke: var(--hcg-ink); }
.hcg-header__divider { width: 1px; height: 22px; background: var(--hcg-line); }

.hcg-cart__count {
  position: absolute; top: -8px; left: 10px;
  min-width: 18px; height: 18px; padding: 0 4px;
  display: grid; place-items: center;
  background: var(--hcg-action); color: var(--hcg-ink);
  font-size: .68rem; font-weight: 700; border-radius: 999px;
}
.hcg-cart__count[data-count="0"] { display: none; }

/* ---------- Burger (nav trigger, always visible) / drawer ---------- */
.hcg-header__burger {
  display: flex; flex-direction: column; gap: 5px;
  width: 48px; height: 48px; flex: 0 0 auto;
  background: transparent; border: 0; border-radius: var(--hcg-radius-sm);
  cursor: pointer; align-items: center; justify-content: center;
  transition: opacity var(--hcg-transition);
}
.hcg-header__burger:hover { opacity: .7; }
.hcg-header__burger span { width: 22px; height: 2px; background: var(--hcg-primary); border-radius: 2px; transition: transform var(--hcg-transition), opacity var(--hcg-transition); }
.hcg-header__burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hcg-header__burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.hcg-header__burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.hcg-mobile__close { position: absolute; top: 18px; right: 20px; width: 40px; height: 40px; font-size: 28px; line-height: 1; background: 0; border: 0; color: var(--hcg-ink); cursor: pointer; }
.hcg-search-form--drawer { width: 100%; margin-bottom: 20px; }

/* Overlay fades; panel slides. Kept in the DOM so both directions animate. */
.hcg-mobile {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0, 0, 0, .45);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .35s ease, visibility .35s ease;
}
.hcg-mobile.is-open { opacity: 1; visibility: visible; pointer-events: auto; }

.hcg-mobile__panel {
  position: absolute; inset: 0 auto 0 0;
  width: min(360px, 85vw);
  background: var(--hcg-card-bg);
  padding: 88px 24px 24px;
  overflow-y: auto;
  box-shadow: var(--hcg-shadow-lg);
  transform: translateX(-100%);
  transition: transform .4s cubic-bezier(.4, 0, .2, 1);
  will-change: transform;
}
.hcg-mobile.is-open .hcg-mobile__panel { transform: translateX(0); }
.hcg-mobile__menu, .hcg-mobile__menu .sub-menu { list-style: none; margin: 0; padding: 0; }
.hcg-mobile__menu a { display: block; padding: .7em 0; color: var(--hcg-ink); border-bottom: 1px solid var(--hcg-line); font-weight: 500; }

/* Collapsible parents (accordion) */
.hcg-mobile__menu .menu-item-has-children > a { display: flex; align-items: center; justify-content: space-between; }
.hcg-mobile__menu .menu-item-has-children > a::after {
  content: ""; flex: 0 0 auto; width: 8px; height: 8px; margin-left: 12px;
  border-right: 2px solid var(--hcg-primary); border-bottom: 2px solid var(--hcg-primary);
  transform: rotate(45deg); transition: transform var(--hcg-transition);
}
.hcg-mobile__menu .menu-item-has-children.is-expanded > a::after { transform: rotate(-135deg); }
.hcg-mobile__menu .sub-menu { display: none; padding-left: 14px; }
.hcg-mobile__menu .menu-item-has-children.is-expanded > .sub-menu { display: block; }
.hcg-mobile__menu .sub-menu a { font-weight: 400; color: var(--hcg-ink-soft); }

/* Tablet: drop the inline search; logo stays centred */
@media (max-width: 900px) {
  .hcg-header__inner { grid-template-columns: auto 1fr auto; }
  .hcg-header__left .hcg-search-form { display: none; }
  .hcg-header__action-label { display: none; }
  .hcg-header__divider { display: none; }
  .hcg-header__actions { gap: 10px; }
  .hcg-header__brand img, .hcg-header__brand .custom-logo { height: 54px; }
}
@media (max-width: 480px) {
  .hcg-header__brand img, .hcg-header__brand .custom-logo { height: 44px; }
  .hcg-header__burger { width: 44px; height: 44px; }
}
