/* MésioFits - Luxury Header (Kokolet-inspired) */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  height: var(--header-height);
}

.site-header__inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--page-padding);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap);
}

.site-header__logo img {
  height: 44px;
  width: auto;
  object-fit: contain;
}

.site-header__nav {
  display: none;
  align-items: center;
  gap: 28px;
}

@media (min-width: 992px) {
  .site-header__nav { display: flex; }
}

.site-header__nav a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  text-transform: capitalize;
  position: relative;
}

.site-header__nav a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width var(--duration) var(--ease-out);
}

.site-header__nav a:hover::after { width: 100%; }
.site-header__nav a:hover { color: var(--primary); }

.site-header__search {
  display: none;
  flex: 1;
  max-width: 480px;
  position: relative;
}

@media (min-width: 768px) {
  .site-header__search { display: block; }
}

.site-header__search input {
  padding: 10px 40px 10px 16px;
  border-radius: 999px;
  background: var(--bg-soft);
  border-color: transparent;
  font-size: 0.875rem;
}

.site-header__search button {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.site-header__actions a {
  position: relative;
  color: var(--text);
  font-size: 1.1rem;
  padding: 6px;
}

.site-header__actions a:hover { color: var(--primary); }

.badge-count {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--accent);
  color: var(--white);
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.badge-count.is-empty {
  display: none;
}

.site-header__account {
  display: none;
  font-size: 0.8rem;
}

@media (min-width: 992px) {
  .site-header__account { display: block; }
  .site-header__account a { color: var(--text-muted); }
  .site-header__account a:hover { color: var(--primary); }
}

.menu-toggle {
  display: flex;
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--text);
  cursor: pointer;
  padding: 8px;
}

@media (min-width: 992px) {
  .menu-toggle { display: none; }
}

/* Mobile drawer */
.mobile-drawer {
  position: fixed;
  top: 0;
  left: -100%;
  width: min(320px, 85vw);
  height: 100vh;
  background: var(--white);
  z-index: 1100;
  transition: left 0.3s var(--ease-out);
  overflow-y: auto;
  box-shadow: var(--shadow-hover);
}

.mobile-drawer.open { left: 0; }

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 1050;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s;
}

.drawer-overlay.open {
  opacity: 1;
  visibility: visible;
}

.mobile-drawer__header {
  padding: var(--gap-lg);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mobile-drawer__nav {
  padding: var(--gap);
}

.mobile-drawer__nav a {
  display: block;
  padding: 14px var(--gap);
  font-weight: 500;
  border-bottom: 1px solid var(--border);
}

.mobile-drawer__nav a:hover {
  background: var(--bg-soft);
  color: var(--primary);
}

.mobile-drawer__track {
  display: flex !important;
  align-items: center;
  gap: 10px;
  font-weight: 700 !important;
  color: var(--primary);
  background: var(--bg-soft);
}

.mobile-drawer__track i {
  color: var(--primary);
}

/* Top announcement bar */
.announce-bar {
  background: var(--primary);
  color: var(--white);
  text-align: center;
  padding: 8px var(--page-padding);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  overflow-wrap: anywhere;
}

@media (max-width: 767px) {
  .site-header__inner {
    min-width: 0;
    gap: 8px;
  }
  .site-header__logo img {
    max-height: 40px;
  }
  .site-header__actions {
    gap: 8px;
    flex-shrink: 0;
  }
}

.announce-bar a {
  color: var(--white);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.announce-bar a:hover { color: #ece3d6; }

/* ---------- MésioFits header (brief §11 navigation) ---------- */
.site-header { background: var(--mesio-ivory); border-bottom: 1px solid var(--border); }
.site-header__logo img { height: 30px; }
@media (min-width: 768px) { .site-header__logo img { height: 34px; } }

.site-header__nav { gap: 22px; }
.site-header__nav > a,
.site-header__dropdown > a {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text);
  white-space: nowrap;
}
.site-header__nav a.active { color: var(--accent); }
.site-header__nav a.active::after { width: 100%; }

.site-header__dropdown { position: relative; }
.site-header__dropdown > a i { font-size: 0.55rem; margin-left: 3px; vertical-align: 2px; }
.site-header__menu {
  position: absolute;
  top: calc(100% + 14px);
  left: -18px;
  min-width: 200px;
  padding: 10px 0;
  background: var(--mesio-ivory);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity var(--duration) var(--ease-out), transform var(--duration) var(--ease-out), visibility var(--duration);
  z-index: 20;
}
.site-header__menu::before { content: ''; position: absolute; left: 0; right: 0; top: -16px; height: 16px; }
.site-header__dropdown:hover .site-header__menu,
.site-header__dropdown:focus-within .site-header__menu { opacity: 1; visibility: visible; transform: none; }
.site-header__menu a {
  display: block;
  padding: 9px 18px;
  font-family: var(--font-serif);
  font-size: 1.12rem;
  color: var(--text);
}
.site-header__menu a::after { display: none; }
.site-header__menu a:hover { background: var(--bg-muted); color: var(--accent); }
.site-header__menu-all {
  margin-top: 6px;
  border-top: 1px solid var(--border);
  font-family: var(--font-sans) !important;
  font-size: 0.72rem !important;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* The full nav needs room: show the search box only on wide screens, an icon otherwise */
.site-header__search { max-width: 240px; }
.site-header__search-link { display: inline-flex; }
@media (min-width: 768px) and (max-width: 1279px) {
  .site-header__search { display: none; }
}
@media (min-width: 1280px) {
  .site-header__search-link { display: none; }
}
@media (max-width: 767px) {
  .site-header__search-link { display: none; }
}
.site-header__search input { background: var(--white); border: 1px solid var(--border); border-radius: 0; }
.site-header__account a { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.04em; white-space: nowrap; }

@media (min-width: 992px) and (max-width: 1180px) {
  .site-header__nav { gap: 16px; }
  .site-header__account { display: none; }
}

.mobile-drawer { background: var(--mesio-ivory); }
.mobile-drawer__logo { height: 26px; width: auto; }
.mobile-drawer__label {
  margin: 18px 0 4px;
  padding: 0 var(--gap-lg);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mesio-taupe);
}
.mobile-drawer__nav a { font-family: var(--font-serif); font-size: 1.18rem; }
.mobile-drawer__nav a.mobile-drawer__sub { padding-left: calc(var(--gap-lg) + 10px); }

/* ---------- Roomier desktop header ----------
   The full nav + search box + greeting + icons don't fit on one row below ~1480px, so there the
   search box collapses to an icon and the greeting to a user icon (name shown as a tooltip). */
.site-header__inner { gap: 20px; }
.site-header__account { font-size: 1.1rem; }
.site-header__account a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  color: var(--text);
}
.site-header__account a:hover { color: var(--primary); }
.site-header__account-text { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.04em; }
.site-header__actions { gap: 14px; }

/* The header content is capped at --container-max (1280px), so a search box never fits beside the
   full menu: on desktop, search is always the magnifier icon (it opens the search page). */
@media (min-width: 768px) {
  .site-header__search { display: none; }
  .site-header__search-link { display: inline-flex; }
}
@media (min-width: 768px) and (max-width: 1479px) {
  .site-header__account-text { display: none; }
}
@media (min-width: 992px) {
  .site-header__account { display: block; }
  .site-header__nav { gap: 26px; margin-left: auto; margin-right: auto; }
}
@media (min-width: 992px) and (max-width: 1180px) {
  .site-header__nav { gap: 18px; }
}
/* Account icon sits with the other icons: put it just before them. */
.site-header__account { order: 10; }
.site-header__actions { order: 11; }
.site-header__account a { font-size: 1.1rem; }
