/* ============================================================
   MV STYLES — SHELL  (header, primary nav, mobile drawer,
   announcement bar, footer)
   Token-driven, no !important, SVG icons. Replaces the inline
   header/footer <style> blocks that used to live in base_new.html.
   ============================================================ */

/* ---------- Header shell ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-fixed);
  background: var(--color-background);
  border-bottom: 1px solid var(--color-border);
}

/* Body offset is set inline in base_new.html from --header-stack so first paint
   reserves the right space (no CLS). These vars document the pieces. */
:root {
  --announce-h: 40px;
  --headerbar-h: 64px;
}

/* ---------- Announcement bar ---------- */
.announcement {
  background: var(--color-primary);
  color: #fff;
  font-size: 0.8125rem;
  line-height: 1.3;
}
.announcement__inner {
  max-width: var(--container-max);
  margin: 0 auto;
  min-height: var(--announce-h);
  padding: 6px var(--spacing-4);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-3);
  text-align: center;
}
.announcement__text { font-weight: 500; letter-spacing: 0.01em; }
.announcement__text a,
.announcement__cta {
  color: var(--color-accent-light);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 600;
  white-space: nowrap;
}
.announcement__countdown {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.15);
}
.announcement__close {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: 0;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  padding: 4px;
  line-height: 0;
}
.announcement { position: relative; }
.announcement__close:hover { color: #fff; }

/* ---------- Header bar ---------- (lives inside .container) */
.header-bar {
  min-height: var(--headerbar-h);
  padding: 10px 0;
  display: flex;
  align-items: center;
  gap: var(--spacing-3);
  flex-wrap: wrap;
  row-gap: 10px;
}
@media (min-width: 1280px) {
  .header-bar { flex-wrap: nowrap; gap: var(--spacing-4); }
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-2);
  text-decoration: none;
  flex-shrink: 0;
}
.brand__logo { height: 36px; width: 36px; object-fit: contain; border-radius: var(--radius-sm); }
.brand__name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: 0.01em;
  white-space: nowrap;
}

/* ---------- Primary nav (desktop) ---------- */
.primary-nav { display: none; }
@media (min-width: 1280px) {
  .primary-nav {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 0 1 auto;
    min-width: 0;
  }
}
.primary-nav__link {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text);
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--transition-fast), background var(--transition-fast);
}
.primary-nav__link:hover,
.primary-nav__link[aria-current="page"] {
  color: var(--color-primary);
  background: var(--color-surface);
}
.primary-nav__link--accent { color: var(--color-accent-dark); font-weight: 600; }

/* “More” categories popover */
.nav-more { position: relative; }
.nav-more__panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 220px;
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: var(--z-dropdown);
  display: none;
}
.nav-more:hover .nav-more__panel,
.nav-more__panel:focus-within,
.nav-more button[aria-expanded="true"] + .nav-more__panel { display: block; }
.nav-more__panel a {
  display: block;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--color-text);
  text-decoration: none;
}
.nav-more__panel a:hover { background: var(--color-surface); color: var(--color-primary); }

/* ---------- Header search ----------
   One form. Mobile: wraps to its own full-width row. Desktop: inline. */
.header-search {
  order: 4;
  flex: 1 1 100%;
  position: relative;
}
@media (min-width: 1280px) {
  .header-search { order: 0; flex: 0 1 460px; margin-left: auto; }
}

.search-form {
  display: flex;
  align-items: center;
  height: 42px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  overflow: hidden;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  position: relative;
}
.search-form:focus-within {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(185, 140, 70, 0.18);
  background: var(--color-background);
}
.search-input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  padding: 0 14px;
  font-size: 0.9375rem;
  color: var(--color-text);
  outline: none;
}
.search-input::placeholder { color: var(--color-text-muted); }
.camera-button,
.search-button {
  flex-shrink: 0;
  height: 100%;
  border: 0;
  background: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-text-light);
  padding: 0 12px;
}
.camera-button { border-left: 1px solid var(--color-border); }
.search-button {
  background: var(--color-primary);
  color: #fff;
  width: 46px;
  padding: 0;
}
.search-button:hover { background: var(--color-primary-light); }
.camera-button:hover { color: var(--color-primary); }
.camera-button svg, .search-button svg { width: 18px; height: 18px; }

.search-loading {
  position: absolute;
  right: 108px;
  top: 50%;
  transform: translateY(-50%);
  display: none;
}
.search-loading.active { display: block; }
.search-spinner {
  width: 16px; height: 16px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: shell-spin 0.6s linear infinite;
}
@keyframes shell-spin { to { transform: rotate(360deg); } }
.clear-search {
  position: absolute;
  right: 92px;
  top: 50%;
  transform: translateY(-50%);
  display: none;
  background: none;
  border: 0;
  font-size: 18px;
  line-height: 1;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 4px;
}
.clear-search.active { display: block; }
.clear-search:hover { color: var(--color-text); }
.search-hint { display: none; }

/* Suggestions dropdown */
.search-suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 420px;
  overflow-y: auto;
  z-index: var(--z-dropdown);
  display: none;
}
.search-suggestions.active { display: block; }
.suggestions-header {
  padding: 8px 14px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
}
.suggestion-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--color-border-light);
  text-decoration: none;
  color: var(--color-text);
}
.suggestion-item:last-child { border-bottom: 0; }
.suggestion-item:hover,
.suggestion-item.selected { background: var(--color-surface); }
.suggestion-image {
  width: 44px; height: 44px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.suggestion-info { flex: 1; min-width: 0; }
.suggestion-name {
  font-weight: 600;
  font-size: 0.875rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.suggestion-name .highlight { background: var(--color-accent-light); border-radius: 2px; }
.suggestion-category { font-size: 0.75rem; color: var(--color-text-muted); }
.suggestion-price-wrapper { text-align: right; flex-shrink: 0; }
.suggestion-price { font-weight: 700; font-size: 0.875rem; color: var(--color-primary); }
.suggestion-old-price {
  display: block;
  font-size: 0.6875rem;
  color: var(--color-text-muted);
  text-decoration: line-through;
}
.suggestion-badge {
  margin-left: 4px;
  font-size: 0.625rem;
  font-weight: 700;
  color: var(--color-danger);
}
.suggestion-no-results { padding: 24px; text-align: center; color: var(--color-text-muted); font-size: 0.875rem; }
.view-all-results {
  display: block;
  padding: 12px;
  text-align: center;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--color-accent-dark);
  text-decoration: none;
  border-top: 1px solid var(--color-border);
}
.view-all-results:hover { background: var(--color-surface); }

/* ---------- Header actions ---------- */
.header-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  margin-left: auto;
}
@media (min-width: 1280px) { .header-actions { margin-left: 0; } }
.icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 0;
  background: none;
  border-radius: var(--radius-sm);
  color: var(--color-text);
  text-decoration: none;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.icon-btn:hover { background: var(--color-surface); color: var(--color-primary); }
.icon-btn svg { width: 21px; height: 21px; }
.badge-count {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: var(--radius-full);
  background: var(--color-accent-dark);
  color: #fff;
  font-size: 0.625rem;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
}
.icon-btn--cart .badge-count { background: var(--color-primary); }

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

/* ---------- Mobile drawer ---------- */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(26, 23, 21, 0.45);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-base), visibility var(--transition-base);
  z-index: var(--z-backdrop);
}
.mobile-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(86vw, 340px);
  background: var(--color-background);
  z-index: var(--z-modal);
  transform: translateX(-100%);
  transition: transform var(--transition-base) var(--ease-out);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
}
body.drawer-open .mobile-drawer { transform: translateX(0); }
body.drawer-open .drawer-backdrop { opacity: 1; visibility: visible; }
body.drawer-open { overflow: hidden; }

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-4);
  border-bottom: 1px solid var(--color-border);
}
.drawer-head .brand__name { font-size: 1.05rem; }
.drawer-close {
  width: 40px; height: 40px;
  border: 0; background: none; cursor: pointer;
  color: var(--color-text-light);
  display: inline-flex; align-items: center; justify-content: center;
}
.drawer-close:hover { color: var(--color-primary); }

.drawer-section { padding: var(--spacing-2) 0; border-bottom: 1px solid var(--color-border-light); }
.drawer-section__title {
  padding: 10px var(--spacing-4) 6px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.drawer-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px var(--spacing-4);
  font-size: 0.9375rem;
  color: var(--color-text);
  text-decoration: none;
}
.drawer-link:hover { background: var(--color-surface); color: var(--color-primary); }
.drawer-link svg { width: 18px; height: 18px; color: var(--color-text-muted); flex-shrink: 0; }
.drawer-link--strong { font-weight: 600; }

/* ---------- Alerts (messages) ---------- */
.alert {
  max-width: var(--container-max);
  margin: var(--spacing-4) auto 0;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  font-size: 0.9375rem;
}
.alert-success { background: #EEF5EF; border-color: #CBE0CF; color: #2C5138; }
.alert-error, .alert-danger { background: #FBEEEC; border-color: #F0CFC9; color: #7E2A20; }
.alert-warning { background: #FBF3E6; border-color: #EEDDBE; color: #6E4E19; }
.alert-info { background: var(--color-surface); color: var(--color-text); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--color-primary-dark);
  color: rgba(255, 255, 255, 0.72);
  margin-top: var(--spacing-16);
  font-size: 0.875rem;
}
.site-footer .container { max-width: var(--container-max); }

.footer-newsletter {
  text-align: center;
  padding: var(--spacing-10) var(--spacing-4);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.footer-newsletter h3 {
  font-family: var(--font-display);
  color: #fff;
  font-size: 1.375rem;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: 0;
  text-transform: none;
}
.footer-newsletter p { color: rgba(255, 255, 255, 0.6); margin-bottom: var(--spacing-5); font-size: 0.875rem; }
.newsletter-form {
  display: flex;
  gap: var(--spacing-2);
  max-width: 460px;
  margin: 0 auto;
}
@media (max-width: 600px) {
  .newsletter-form { flex-direction: column; }
  .newsletter-btn { width: 100%; justify-content: center; }
}
.newsletter-input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 0.9375rem;
}
.newsletter-input::placeholder { color: rgba(255, 255, 255, 0.5); }
.newsletter-input:focus {
  outline: none;
  border-color: var(--color-accent);
  background: rgba(255, 255, 255, 0.1);
}
.newsletter-btn {
  flex-shrink: 0;
  padding: 12px 22px;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--color-accent);
  color: var(--color-primary-dark);
  font-weight: 700;
  font-size: 0.875rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background var(--transition-fast);
}
.newsletter-btn:hover { background: var(--color-accent-light); }
.newsletter-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.newsletter-message { margin: var(--spacing-3) auto 0; max-width: 460px; font-size: 0.8125rem; }
.newsletter-message.success { color: #A9D6B4; }
.newsletter-message.error { color: #E8A9A0; }

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-8);
  padding: var(--spacing-10) var(--spacing-4);
}
@media (min-width: 640px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
@media (min-width: 1024px) { .footer-grid { grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: var(--spacing-10); } }

.footer-col h4 {
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  margin-bottom: var(--spacing-4);
}
.footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-col a { color: rgba(255, 255, 255, 0.72); text-decoration: none; transition: color var(--transition-fast); }
.footer-col a:hover { color: var(--color-accent-light); }

.footer-brand__name { font-family: var(--font-display); color: #fff; font-size: 1.25rem; font-weight: 700; margin-bottom: 8px; }
.footer-brand__tagline { color: rgba(255, 255, 255, 0.6); margin-bottom: var(--spacing-4); max-width: 34ch; }

.footer-trust { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: var(--spacing-4); }
.footer-trust span {
  font-size: 0.75rem;
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-pill);
  color: rgba(255, 255, 255, 0.75);
}

.footer-social { display: flex; gap: 10px; }
.footer-social a {
  width: 38px; height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.75);
  transition: border-color var(--transition-fast), color var(--transition-fast);
}
.footer-social a:hover { border-color: var(--color-accent); color: var(--color-accent-light); }

.footer-payments { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--spacing-4); }
.footer-payments span {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.6);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: var(--spacing-5) var(--spacing-4);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-3);
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
}
.footer-bottom nav { display: flex; gap: var(--spacing-4); flex-wrap: wrap; }
.footer-bottom a { color: rgba(255, 255, 255, 0.5); text-decoration: none; }
.footer-bottom a:hover { color: var(--color-accent-light); }

.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: var(--color-background);
  color: var(--color-primary);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  z-index: var(--z-sticky);
}
.back-to-top.visible { display: inline-flex; }
.back-to-top:hover { background: var(--color-surface); }
