/* Souci Mall — utility bar, main header, mega nav */

/* Utility bar */
.sm-utility {
  background: var(--sm-ink);
  color: var(--sm-bg);
  font-family: var(--sm-mono-font);
  font-size: 11px;
  letter-spacing: 0.4px;
}
.sm-utility__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-block: 8px;
  white-space: nowrap;
  overflow: hidden;
}
.sm-utility__slogans,
.sm-utility__links {
  display: flex;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.sm-utility__links { gap: 14px; }
.sm-utility a { color: inherit; }
.sm-utility a:hover { color: var(--sm-accent); }

/* Language switcher rendered inside utility bar (TranslatePress / Polylang / WPML) */
.sm-utility .sm-lang-switcher { display: inline-block; }
.sm-utility .sm-lang-switcher select,
.sm-utility .sm-lang-switcher .trp-language-switcher,
.sm-utility .sm-lang-switcher .lang_sel_sel {
  background: transparent;
  color: inherit;
  border: 0;
  font-family: var(--sm-mono-font);
  font-size: 11px;
  letter-spacing: 0.4px;
  cursor: pointer;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
}
.sm-utility .sm-lang-switcher select option { color: var(--sm-ink); background: var(--sm-bg); }
.sm-utility .sm-lang-switcher ul { list-style: none; margin: 0; padding: 0; display: inline-flex; gap: 10px; }
.sm-utility .sm-lang-switcher a { font-family: var(--sm-mono-font); font-size: 11px; }
.sm-utility .sm-lang-switcher .trp-ls-shortcode-current-language { display: inline-flex; align-items: center; gap: 4px; }

@media (max-width: 900px) {
  /* Mobile: slogan list overflows the viewport, so animate it as a marquee.
   * The PHP renders each item twice; the keyframe shifts the track by 50%
   * so the second (cloned) set is in the same place the first one started,
   * giving a perfectly seamless loop. */
  .sm-utility__inner {
    justify-content: flex-start;
    overflow: hidden;
    padding-block: 7px;
    /* Subtle fade on the right edge hints "more is coming" without showing scrollbar */
    -webkit-mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 24px), transparent 100%);
            mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 24px), transparent 100%);
  }
  .sm-utility__slogans {
    flex-shrink: 0;
    flex-wrap: nowrap;
    gap: 28px;
    will-change: transform;
    animation: sm-utility-marquee 22s linear infinite;
  }
  .sm-utility__slogans li { flex-shrink: 0; }
  .sm-utility:hover .sm-utility__slogans,
  .sm-utility:focus-within .sm-utility__slogans { animation-play-state: paused; }
  .sm-utility__links { display: none; }
}
@keyframes sm-utility-marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  /* Respect OS-level "reduce motion" — turn marquee off and let users scroll manually */
  .sm-utility__slogans { animation: none !important; overflow-x: auto; scrollbar-width: none; }
  .sm-utility__slogans::-webkit-scrollbar { display: none; }
}

/* Header */
.sm-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: color-mix(in srgb, var(--sm-bg) 92%, transparent);
  backdrop-filter: saturate(1.2) blur(14px);
  -webkit-backdrop-filter: saturate(1.2) blur(14px);
  border-bottom: 1px solid var(--sm-line);
}
.sm-header__inner {
  display: flex;
  align-items: center;
  gap: 28px;
  padding-block: 14px;
  position: relative; /* anchor for the mobile search overlay (absolute child) */
}

/* Logo */
.sm-logo {
  display: inline-flex;
  align-items: baseline;
  font-family: var(--sm-display-font);
  font-weight: 900;
  font-size: 26px;
  letter-spacing: -1px;
  color: var(--sm-ink);
  flex-shrink: 0;
}
.sm-logo__dot { color: var(--sm-accent); }
.sm-logo__img { display: block; max-height: 36px; width: auto; }
.sm-footer__brand .sm-logo__img { max-height: 28px; filter: brightness(0) invert(1); opacity: 0.95; }
.sm-drawer .sm-logo__img { max-height: 28px; }
.custom-logo-link { display: inline-block; line-height: 0; }
.custom-logo-link img { max-height: 40px; width: auto; }

/* Search — `flex:1 1 auto` lets it grow to fill the gap between logo and
 * actions (no awkward void on wide viewports), capped so it never feels
 * like a full-width address bar. `margin-right:auto` on the search +
 * pushing actions sets up: [logo] [search-grows-but-capped] [actions→far right]
 * with leftover space absorbed evenly. */
.sm-search {
  flex: 1 1 auto;
  max-width: 720px;
  background: var(--sm-surface);
  border-radius: 999px;
  border: 1.5px solid var(--sm-line);
  padding: 10px 18px;
  display: flex;
  gap: 12px;
  align-items: center;
  transition: border-color .15s ease;
}
.sm-search:focus-within { border-color: var(--sm-accent); }
.sm-search input {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 0;
  font-size: 14px;
  color: var(--sm-ink);
  min-width: 0;
  appearance: none;
  -webkit-appearance: none;
  box-shadow: none;
}
.sm-search input:focus,
.sm-search input:focus-visible { outline: 0; box-shadow: none; }
.sm-search input::placeholder { color: var(--sm-ink-muted); }
.sm-search input::-webkit-search-decoration,
.sm-search input::-webkit-search-cancel-button,
.sm-search input::-webkit-search-results-button,
.sm-search input::-webkit-search-results-decoration { -webkit-appearance: none; appearance: none; }
.sm-search__kbd {
  font-family: var(--sm-mono-font);
  font-size: 10px;
  color: var(--sm-ink-muted);
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

/* Live search dropdown */
.sm-live-search {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--sm-surface);
  border: 1px solid var(--sm-line);
  border-radius: 16px;
  box-shadow: var(--sm-shadow-lg);
  max-height: 480px;
  overflow-y: auto;
  z-index: 200;
  padding: 6px 6px 10px;
}
.sm-live-search[hidden] { display: none; }
.sm-live-search__group { padding: 6px 4px; }
.sm-live-search__head {
  font-family: var(--sm-mono-font);
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--sm-ink-muted);
  padding: 6px 10px 4px;
}
.sm-live-search__item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--sm-ink);
  transition: background .12s ease;
}
.sm-live-search__item:hover,
.sm-live-search__item.is-active,
.sm-live-search__all.is-active {
  background: var(--sm-surface-alt);
  color: var(--sm-ink);
}
.sm-live-search__item--product { grid-template-columns: 40px 1fr; }
.sm-live-search__thumb {
  width: 40px; height: 40px;
  border-radius: 8px;
  background: var(--sm-chroma, var(--sm-surface-alt));
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sm-live-search__thumb img { width: 100%; height: 100%; object-fit: cover; }
.sm-live-search__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}
.sm-live-search__brand {
  font-family: var(--sm-mono-font);
  font-size: 9px;
  letter-spacing: 0.6px;
  color: var(--sm-ink-muted);
  text-transform: uppercase;
}
.sm-live-search__name {
  font-family: var(--sm-display-font);
  font-weight: 700;
  font-size: 13px;
  line-height: 1.3;
  color: var(--sm-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sm-live-search__price {
  font-family: var(--sm-display-font);
  font-weight: 800;
  font-size: 13px;
  color: var(--sm-accent);
  margin-top: 2px;
}
.sm-live-search__cat {
  font-weight: 600;
  font-size: 13px;
  flex: 1;
}
.sm-live-search__meta {
  font-family: var(--sm-mono-font);
  font-size: 10px;
  color: var(--sm-ink-muted);
}
.sm-live-search__all {
  display: block;
  padding: 12px 14px;
  margin-top: 4px;
  border-top: 1px solid var(--sm-line);
  font-size: 12px;
  font-weight: 600;
  color: var(--sm-accent);
  text-align: center;
  border-radius: 10px;
}
.sm-live-search__empty {
  padding: 20px;
  text-align: center;
  color: var(--sm-ink-muted);
  font-size: 13px;
}

@media (max-width: 900px) {
  .sm-live-search { left: -8px; right: -8px; max-height: 60vh; }
}

/* Header actions row — `margin-left:auto` is a safety net: when the
 * search bar caps at its max-width and the viewport is wider than the
 * combined widths of logo + search + actions, the slack is dumped to
 * the LEFT of the actions cluster, keeping the cluster flush against
 * the wrap's right padding instead of leaving a void on the right. */
.sm-header__actions {
  display: flex;
  gap: 8px;
  align-items: center;
  white-space: nowrap;
  margin-left: auto;
}
.sm-chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--sm-ink);
  transition: background .15s ease, color .15s ease;
  cursor: pointer;
}
.sm-chip-btn:hover { background: var(--sm-surface); color: var(--sm-ink); }

.sm-region {
  border: 1px solid var(--sm-line);
}
.sm-region__flag {
  width: 18px; height: 18px; border-radius: 50%;
  background: linear-gradient(180deg, #DE2910 50%, #FFDE00 50%);
  flex-shrink: 0;
}

/* Wishlist */
.sm-wishlist__ico { position: relative; width: 20px; height: 18px; display: inline-flex; }
.sm-wishlist__ico .sm-ico { position: absolute; inset: 0; margin: auto; }
.sm-badge {
  position: absolute; top: -6px; right: -8px;
  min-width: 16px; height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--sm-accent-2);
  color: var(--sm-accent-ink);
  font-family: var(--sm-mono-font);
  font-size: 9px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--sm-bg);
  box-sizing: border-box;
  line-height: 1;
}

/* Account */
.sm-account-wrap {
  position: relative;
  display: inline-flex;
}
.sm-account {
  padding: 6px 12px 6px 6px;
  border: 1px solid var(--sm-line);
  gap: 8px;
}

/* Account dropdown menu */
.sm-account-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 260px;
  background: var(--sm-surface);
  border: 1px solid var(--sm-line);
  border-radius: 16px;
  box-shadow: var(--sm-shadow-lg);
  padding: 10px;
  z-index: 200;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
}
.sm-account-wrap:hover .sm-account-menu,
.sm-account-wrap:focus-within .sm-account-menu,
.sm-account-wrap.is-open .sm-account-menu {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
/* Hover bridge — prevent gap between trigger and menu from closing it */
.sm-account-wrap::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0; right: 0;
  height: 10px;
  pointer-events: none;
}
.sm-account-wrap:hover::after { pointer-events: auto; }

.sm-account-menu__head {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 10px 14px;
  border-bottom: 1px solid var(--sm-line);
  margin-bottom: 8px;
}
.sm-account-menu__avatar {
  width: 36px; height: 36px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--sm-accent-3), var(--sm-accent));
  color: var(--sm-accent-ink);
  font-family: var(--sm-display-font);
  font-weight: 800;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sm-account-menu__who {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
  min-width: 0;
}
.sm-account-menu__who strong {
  font-family: var(--sm-display-font);
  font-weight: 800;
  font-size: 14px;
  color: var(--sm-ink);
  letter-spacing: -0.1px;
}
.sm-account-menu__who .sm-mono {
  font-size: 10px;
  letter-spacing: 0.4px;
  margin-top: 2px;
}

.sm-account-menu__group {
  display: flex;
  flex-direction: column;
  padding: 4px 0;
  border-bottom: 1px solid var(--sm-line);
}
.sm-account-menu__group:last-of-type { border-bottom: 0; }

.sm-account-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--sm-ink);
  transition: background .12s ease, color .12s ease;
}
.sm-account-menu a:hover {
  background: var(--sm-surface-alt);
  color: var(--sm-accent);
}
.sm-account-menu a .sm-ico {
  color: var(--sm-ink-muted);
  flex-shrink: 0;
}
.sm-account-menu a:hover .sm-ico { color: var(--sm-accent); }
.sm-account-menu__count {
  margin-left: auto;
  min-width: 20px;
  padding: 0 6px;
  height: 18px;
  border-radius: 9px;
  background: var(--sm-accent);
  color: var(--sm-accent-ink);
  font-family: var(--sm-mono-font);
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.sm-account-menu__foot {
  padding-top: 6px;
  margin-top: 4px;
  border-top: 1px solid var(--sm-line);
}
.sm-account-menu__logout:hover { color: var(--sm-danger) !important; }
.sm-account-menu__logout:hover .sm-ico { color: var(--sm-danger) !important; }

.sm-account-menu__ctas {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 4px 6px;
}
.sm-account__avatar {
  width: 26px; height: 26px;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--sm-accent-3) 0%, var(--sm-accent) 100%);
  font-family: var(--sm-display-font);
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.sm-account__avatar img { width: 100%; height: 100%; object-fit: cover; }
.sm-account__text {
  display: inline-flex;
  flex-direction: column;
  line-height: 1.15;
  font-size: 12px;
  font-weight: 700;
}
.sm-account__text .sm-eyebrow {
  font-size: 10px;
  font-family: var(--sm-body-font);
  letter-spacing: 0;
  text-transform: none;
  color: var(--sm-ink-muted);
  font-weight: 400;
}

/* Bag */
.sm-bag-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--sm-accent);
  color: var(--sm-accent-ink);
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
  transition: filter .2s ease, box-shadow .2s ease;
}
.sm-bag-btn:hover { color: var(--sm-accent-ink); filter: brightness(1.05); box-shadow: 0 6px 20px color-mix(in srgb, var(--sm-accent) 40%, transparent); }
.sm-bag-btn__count {
  min-width: 20px; height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: rgba(0,0,0,0.22);
  color: inherit;
  font-family: var(--sm-mono-font);
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Theme toggle */
.sm-theme-toggle {
  position: relative;
  width: 36px; height: 36px;
  border-radius: 18px;
  border: 1px solid var(--sm-line);
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.sm-theme-toggle__icon { position: absolute; transition: opacity .2s, transform .3s; }
.sm-theme-toggle__icon--sun { opacity: 0; transform: rotate(-90deg); }
.sm-theme-toggle__icon--moon { opacity: 1; transform: rotate(0); }
[data-theme="dark"] .sm-theme-toggle__icon--sun { opacity: 1; transform: rotate(0); }
[data-theme="dark"] .sm-theme-toggle__icon--moon { opacity: 0; transform: rotate(90deg); }

/* Mobile burger */
.sm-mobile-burger {
  display: none;
  width: 40px; height: 40px;
  border-radius: 20px;
  border: 1px solid var(--sm-line);
  background: var(--sm-surface);
  align-items: center;
  justify-content: center;
}

/* Mega nav */
.sm-mega {
  border-top: 1px solid var(--sm-line);
}
.sm-mega__inner {
  display: flex;
  gap: 28px;
  align-items: center;
  min-height: 48px;
}
.sm-mega__list {
  display: flex;
  gap: 28px;
  margin: 0;
  padding: 0;
  list-style: none;
  flex: 1;
  white-space: nowrap;
}
.sm-mega__item,
.sm-mega__list > li {
  position: relative;
  padding-block: 14px;
  font-size: 13px;
  font-weight: 600;
}
.sm-mega__list > li > a {
  color: var(--sm-ink);
  border-bottom: 2px solid transparent;
  padding-block: 14px;
  transition: color .15s, border-color .15s;
}
.sm-mega__list > li:hover > a,
.sm-mega__list > li:focus-within > a {
  color: var(--sm-accent);
  border-bottom-color: var(--sm-accent);
}
.sm-mega__list .sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: var(--sm-surface);
  border: 1px solid var(--sm-line);
  border-radius: 10px;
  padding: 16px;
  margin: 0;
  list-style: none;
  box-shadow: var(--sm-shadow-md);
  display: none;
  z-index: 40;
}
.sm-mega__list .sub-menu li {
  padding-block: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--sm-ink-soft);
}
.sm-mega__list > li:hover .sub-menu,
.sm-mega__list > li:focus-within .sub-menu { display: block; }
.sm-mega__promo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--sm-accent);
  white-space: nowrap;
  padding: 6px 12px;
  border: 1px solid color-mix(in srgb, var(--sm-accent) 35%, transparent);
  border-radius: 999px;
  text-decoration: none;
  transition: background .2s, border-color .2s, color .2s;
}
.sm-mega__promo:hover {
  background: color-mix(in srgb, var(--sm-accent) 12%, transparent);
  border-color: var(--sm-accent);
  color: var(--sm-accent-3);
}
.sm-mega__promo-icon { display: inline-flex; }

/* Responsive — collapse actions row on small screens */
@media (max-width: 1200px) {
  .sm-chip-btn span:nth-child(3),
  .sm-account__text,
  .sm-region .sm-muted { display: none; }
}
@media (max-width: 900px) {
  .sm-header__inner { gap: 8px; padding-block: 10px; }
  .sm-logo { font-size: 20px; flex-shrink: 0; }
  /* Search bar collapsed by default on mobile (it'd squeeze everything else
   * off-screen). Tap the search-icon button to reveal it as a full-width
   * dropdown row below the header — see body.sm-mobile-search-open. */
  .sm-search { display: none; }
  .sm-search__kbd { display: none; }
  .sm-header__actions { display: none; }
  .sm-mobile-search-toggle { display: inline-grid; }
  .sm-mobile-burger { display: inline-flex; }
  .sm-mega { display: none; }
  .sm-bag-btn { display: none; }
  .sm-mobile-bag { display: inline-flex; }
  /* Push the action cluster (search + bag + burger) to the right edge so the
   * mobile header reads logo-left / actions-right instead of all clumped left. */
  .sm-mobile-search-toggle { margin-left: auto; }
}

/* ============================================================
 * Mobile search-toggle button + expandable search row
 *
 * Default = visible-on-mobile (inline-grid). Desktop hides it via the
 * `min-width: 901px` rule further down — same pattern as `.sm-mobile-bag`.
 * ============================================================ */
.sm-mobile-search-toggle {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 999px;
  border: 1px solid var(--sm-line);
  background: var(--sm-surface);
  color: var(--sm-ink);
  cursor: pointer;
  flex-shrink: 0;
  transition: background .2s ease, color .2s ease, border-color .2s ease, transform .15s ease;
}
.sm-mobile-search-toggle:hover,
.sm-mobile-search-toggle:focus-visible {
  background: var(--sm-accent);
  color: var(--sm-accent-ink);
  border-color: var(--sm-accent);
  transform: translateY(-1px);
}
.sm-mobile-search-toggle:focus-visible { outline: 2px solid var(--sm-accent); outline-offset: 2px; }
.sm-mobile-search-toggle svg { width: 18px; height: 18px; display: block; }

/* Active state — toggle stays accent-coloured while the search row is open */
body.sm-mobile-search-open .sm-mobile-search-toggle {
  background: var(--sm-accent);
  color: var(--sm-accent-ink);
  border-color: var(--sm-accent);
}

/* ============================================================
 * Mobile search modal — fully self-contained overlay, separate
 * from `.sm-search` so neither inherits the other's chrome.
 * Triggered by toggling [hidden] on .sm-search-modal via JS.
 * ============================================================ */
.sm-search-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 88px 16px 20px;
  pointer-events: auto;
}
.sm-search-modal[hidden] { display: none; }
.sm-search-modal__scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: sm-search-scrim-in .2s ease-out;
}
.sm-search-modal__form {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 540px;
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--sm-surface);
  border: 1.5px solid var(--sm-line-strong);
  border-radius: 999px;
  padding: 4px 4px 4px 18px;
  box-shadow: 0 22px 56px -16px rgba(0, 0, 0, 0.45),
              0 8px 20px -8px rgba(0, 0, 0, 0.18);
  animation: sm-search-modal-in .22s cubic-bezier(.5,0,.2,1);
}
.sm-search-modal__icon {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  color: var(--sm-ink-muted);
}
.sm-search-modal__icon svg { width: 18px; height: 18px; display: block; }
.sm-search-modal__form input[type="search"] {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: none;
  box-shadow: none;
  padding: 0 14px;
  font-family: inherit;
  font-size: 16px; /* 16+ avoids iOS auto-zoom on focus */
  line-height: 1;
  color: var(--sm-ink);
  height: 44px;
  appearance: none;
  -webkit-appearance: none;
}
.sm-search-modal__form input[type="search"]::placeholder { color: var(--sm-ink-muted); }
.sm-search-modal__form input[type="search"]::-webkit-search-decoration,
.sm-search-modal__form input[type="search"]::-webkit-search-cancel-button,
.sm-search-modal__form input[type="search"]::-webkit-search-results-button,
.sm-search-modal__form input[type="search"]::-webkit-search-results-decoration { -webkit-appearance: none; appearance: none; }

.sm-search-modal__close {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 0;
  background: var(--sm-surface-alt);
  color: var(--sm-ink);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.sm-search-modal__close:hover,
.sm-search-modal__close:focus-visible {
  background: var(--sm-accent);
  color: var(--sm-accent-ink);
}
.sm-search-modal__close svg { width: 16px; height: 16px; display: block; }

@keyframes sm-search-scrim-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes sm-search-modal-in {
  from { transform: translateY(-16px); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

/* Desktop never opens this modal — only mobile users tap the toggle. */
@media (min-width: 901px) {
  .sm-search-modal { display: none !important; }
}
@keyframes sm-search-slide-in {
  from { transform: translateY(-8px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* Desktop hides the toggle (search bar is already inline at .sm-header__inner) */
@media (min-width: 901px) {
  .sm-mobile-search-toggle { display: none; }
}

/* ============================================================
 * Mobile cart pill — header-bar bag icon + live total + count badge.
 * Hidden on desktop (which already shows .sm-bag-btn). When the cart
 * is empty the pill collapses to an icon-only round button; once an
 * item lands, it stretches and reveals the running total.
 * ============================================================ */
.sm-mobile-bag {
  /* Default = visible-on-mobile (inline-flex). Desktop hides it via the
   * `min-width: 901px` rule further down — this avoids the source-order
   * bug where putting `display: none` here overrides the media-query
   * `inline-flex` defined earlier in the file. */
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 12px 0 10px;
  border-radius: 999px;
  background: var(--sm-ink);
  color: var(--sm-bg);
  text-decoration: none;
  font-family: var(--sm-display-font);
  font-weight: 700;
  font-size: 13px;
  line-height: 1;
  letter-spacing: 0.02em;
  flex-shrink: 0;
  transition: background .2s ease, color .2s ease, transform .15s ease, padding .2s ease;
  white-space: nowrap;
}
@media (min-width: 901px) {
  /* Desktop already shows .sm-bag-btn — hide the mobile pill */
  .sm-mobile-bag { display: none; }
}
.sm-mobile-bag:hover,
.sm-mobile-bag:focus-visible {
  background: var(--sm-accent);
  color: var(--sm-accent-ink);
  transform: translateY(-1px);
}
.sm-mobile-bag:focus-visible { outline: 2px solid var(--sm-accent); outline-offset: 2px; }

.sm-mobile-bag__icon {
  position: relative;
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
}
.sm-mobile-bag__icon svg { width: 18px; height: 18px; display: block; }

.sm-mobile-bag__badge {
  position: absolute;
  top: -4px;
  right: -8px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--sm-accent);
  color: var(--sm-accent-ink);
  font-family: var(--sm-mono-font);
  font-size: 9px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  border: 1.5px solid var(--sm-ink);
  transition: border-color .2s ease, transform .25s cubic-bezier(.5,1.6,.5,1);
}
.sm-mobile-bag:hover .sm-mobile-bag__badge { border-color: var(--sm-accent); }

.sm-mobile-bag__total {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}
.sm-mobile-bag__total .amount,
.sm-mobile-bag__total bdi,
.sm-mobile-bag__total .woocommerce-Price-currencySymbol {
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
}

/* Empty cart — collapse to icon-only round button (no badge, no total) */
.sm-mobile-bag.is-empty {
  padding: 0;
  width: 38px;
  justify-content: center;
}
.sm-mobile-bag.is-empty .sm-mobile-bag__total,
.sm-mobile-bag.is-empty .sm-mobile-bag__badge { display: none; }

/* Pop animation when count changes (added by JS, see main.js next time it
 * renders the bag fragment — until then, the static class still works) */
.sm-mobile-bag.is-popping .sm-mobile-bag__icon { animation: sm-bag-pop .35s cubic-bezier(.5,1.6,.4,1); }
@keyframes sm-bag-pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.18); }
  100% { transform: scale(1); }
}

@media (max-width: 380px) {
  /* Tightest phones — drop the total text, keep icon + badge only */
  .sm-mobile-bag.has-items {
    padding: 0;
    width: 38px;
    justify-content: center;
  }
  .sm-mobile-bag.has-items .sm-mobile-bag__total { display: none; }
}
