/* ==========================================================================
   Brico — theme.css
   Tokens, reset, typography, buttons, badges, forms, header and navigation,
   footer, cart drawer, toasts, product cards, stars, chips, pagination.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  /* Colors */
  --c-primary: #d9480f;
  --c-primary-dark: #bf4408;
  --c-primary-soft: #fff4ec;
  --c-ink: #212529;
  --c-muted: #6c757d;
  --c-line: #e9ecef;
  --c-line-strong: #ced4da;
  --c-paper: #f8f9fa;
  --c-surface: #ffffff;
  --c-success: #2f9e44;
  --c-success-soft: #ebfbee;
  --c-info: #1971c2;
  --c-info-soft: #e7f5ff;
  --c-warning: #e8590c;
  --c-warning-soft: #fff4e6;
  --c-star: #fcc419;
  --c-danger: #e03131;
  --c-danger-soft: #fff5f5;

  /* Spacing (4px base) */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-7: 32px;
  --sp-8: 40px;
  --sp-9: 56px;
  --sp-10: 72px;

  /* Radius */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-pill: 999px;

  /* Shadows */
  --sh-1: 0 1px 2px rgba(33, 37, 41, 0.06), 0 1px 3px rgba(33, 37, 41, 0.08);
  --sh-2: 0 8px 24px rgba(33, 37, 41, 0.12);

  /* Type */
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Motion */
  --tr: 160ms ease;
}

/* Alternate accents keep the same five-tone placeholder system. */
body[data-palette="azul"] {
  --c-primary: #1971c2;
  --c-primary-dark: #1864ab;
  --c-primary-soft: #e7f5ff;
}

body[data-palette="verde"] {
  --c-primary: #2f9e44;
  --c-primary-dark: #2b8a3e;
  --c-primary-soft: #ebfbee;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--c-ink);
  background: var(--c-surface);
  -webkit-font-smoothing: antialiased;
}
body.no-scroll { overflow: hidden; }
img, svg, video { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; padding: 0; }
a { color: var(--c-primary); text-decoration: none; }
a:hover { color: var(--c-primary-dark); }
ul[class], ol[class] { list-style: none; padding: 0; }
ul, ol { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4 { line-height: 1.2; text-wrap: balance; font-weight: 800; letter-spacing: -0.02em; }
strong { font-weight: 700; }
hr { border: none; border-top: 1px solid var(--c-line); }
[hidden] { display: none !important; }
::selection { background: var(--c-primary); color: #fff; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Focus ---------- */
:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--c-primary) 55%, transparent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Typography ---------- */
h1 { font-size: clamp(1.9rem, 1.2rem + 2.4vw, 3rem); }
h2 { font-size: clamp(1.45rem, 1.1rem + 1.4vw, 2.1rem); letter-spacing: -0.015em; }
h3 { font-size: 1.2rem; font-weight: 700; }
h4 { font-size: 1.05rem; font-weight: 700; }
p { max-width: 72ch; }
.rich-text a { text-decoration: underline; text-underline-offset: 3px; }
.rich-text > * + * { margin-top: var(--sp-4); }
.rich-text h2, .rich-text h3 { margin-top: var(--sp-7); }
.rich-text ul, .rich-text ol { margin: var(--sp-4) 0; padding-left: 1.35rem; display: grid; gap: var(--sp-2); }
.rich-text ul { list-style: disc; }
.rich-text ol { list-style: decimal; }
.rich-text li::marker { color: var(--c-primary); font-weight: 700; }
.rich-text img { border-radius: var(--r-md); }
.rich-text blockquote {
  padding: var(--sp-5);
  border-left: 4px solid var(--c-primary);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  background: var(--c-primary-soft);
  font-weight: 600;
}

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: var(--sp-4);
}
@media (min-width: 640px) { .container { padding-inline: var(--sp-6); } }

.min-h-main { min-height: 55vh; }

.stack > * + * { margin-top: var(--sp-4); }
.stack--sm > * + * { margin-top: var(--sp-2); }
.stack--lg > * + * { margin-top: var(--sp-7); }

.muted { color: var(--c-muted); }
.u-muted { color: var(--c-muted); }
.u-tiny { font-size: 0.8rem; }
.u-small { font-size: 0.88rem; }
.u-strong { font-weight: 700; }
.u-center { text-align: center; }
.u-hide { display: none !important; }
.u-mt { margin-top: var(--sp-4); }
.u-mt-lg { margin-top: var(--sp-6); }
.u-mb { margin-bottom: var(--sp-4); }
.u-mb-lg { margin-bottom: var(--sp-6); }
.u-right { text-align: right; }
.mt-8 { margin-top: var(--sp-7); }

.icon { width: 20px; height: 20px; flex: none; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Skip link ---------- */
.skip-link {
  position: fixed;
  top: var(--sp-2);
  left: var(--sp-2);
  z-index: 200;
  padding: var(--sp-2) var(--sp-4);
  background: var(--c-ink);
  color: #fff;
  border-radius: var(--r-sm);
  transform: translateY(-200%);
  transition: transform var(--tr);
}
.skip-link:focus { transform: none; color: #fff; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 0.65rem 1.3rem;
  border-radius: 10px;
  border: 1.5px solid transparent;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.4;
  transition: background var(--tr), border-color var(--tr), color var(--tr), transform var(--tr), box-shadow var(--tr);
  text-align: center;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--c-primary); color: #fff; }
.btn-primary:hover { background: var(--c-primary-dark); color: #fff; }
.btn-outline { border-color: var(--c-ink); color: var(--c-ink); background: transparent; }
.btn-outline:hover { background: var(--c-ink); color: #fff; }
.btn-ghost { color: var(--c-ink); background: transparent; border-color: var(--c-line-strong); }
.btn-ghost:hover { background: var(--c-paper); color: var(--c-ink); }
.btn-light { background: #fff; color: var(--c-ink); }
.btn-light:hover { background: var(--c-paper); color: var(--c-ink); }
.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.85rem; border-radius: var(--r-sm); }
.btn-lg { padding: 0.85rem 1.6rem; font-size: 1.05rem; }
.btn-block { display: flex; width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}
.btn .icon { width: 17px; height: 17px; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 0.15rem 0.6rem;
  border-radius: var(--r-pill);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.badge-sale { background: var(--c-danger); color: #fff; }
.badge-new { background: var(--c-info); color: #fff; }
.badge-soldout { background: var(--c-ink); color: #fff; }
.badge-ok { background: var(--c-success-soft); color: var(--c-success); }
.badge-warn { background: var(--c-warning-soft); color: var(--c-warning); }
.badge-err { background: var(--c-danger-soft); color: var(--c-danger); }
.badge-info { background: var(--c-info-soft); color: var(--c-info); }
.badge-muted { background: var(--c-paper); color: var(--c-muted); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: var(--sp-1); margin-bottom: var(--sp-4); }
.field > label { font-weight: 600; font-size: 0.92rem; }
.field-hint { font-size: 0.82rem; color: var(--c-muted); }
.input, .select, textarea.input,
.field input, .field select, .field textarea {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 1.5px solid var(--c-line);
  border-radius: var(--r-sm);
  background: var(--c-surface);
  font-size: 0.95rem;
  transition: border-color var(--tr), box-shadow var(--tr);
}
.field input:hover, .field select:hover { border-color: var(--c-line-strong); }
.field input:focus, .field select:focus, .field textarea:focus,
.input:focus, .select:focus {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px var(--c-primary-soft);
  outline: none;
}
.input::placeholder, .field input::placeholder { color: #adb5bd; }
textarea.input, .field textarea { resize: vertical; min-height: 110px; font-family: inherit; }
.select, .field select {
  appearance: none;
  padding-right: 2.2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%236c757d' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
}
.checkbox, .radio { display: flex; align-items: flex-start; gap: var(--sp-2); font-size: 0.92rem; cursor: pointer; }
.checkbox input, .radio input { width: 1.1rem; height: 1.1rem; margin-top: 0.2rem; accent-color: var(--c-primary); cursor: pointer; }
.input.invalid, .field input.invalid, .is-invalid .input, .is-invalid .field input { border-color: var(--c-danger); }
.field-error { font-size: 0.82rem; color: var(--c-danger); font-weight: 600; display: none; }
.field-error.show, .is-invalid .field-error { display: block; }
.form-grid { display: grid; grid-template-columns: 1fr; gap: 0 var(--sp-4); }
.form-grid--2 > * { min-width: 0; }
@media (min-width: 640px) { .form-grid--2, .form-grid { grid-template-columns: 1fr 1fr; } }
.field-full { grid-column: 1 / -1; }
.form-actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-top: var(--sp-2); }
.form-alert { border-radius: var(--r-sm); padding: var(--sp-3) var(--sp-4); font-size: 0.9rem; font-weight: 500; margin-bottom: var(--sp-4); }
.form-alert.success { background: var(--c-success-soft); color: var(--c-success); }
.form-alert.error { background: var(--c-danger-soft); color: var(--c-danger); }

/* ---------- Announcement bar ---------- */
.announcement { background: var(--c-primary-soft); color: var(--c-primary-dark); font-size: 0.82rem; font-weight: 600; text-align: center; padding-block: var(--sp-2); }
.announcement p { max-width: none; }
.announcement a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Topbar ---------- */
.topbar {
  background: var(--c-ink);
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.8rem;
}
.topbar__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--sp-1) var(--sp-4);
  padding-block: var(--sp-2);
}
.topbar p { max-width: none; }
.topbar a { color: #fff; text-decoration: underline; text-underline-offset: 2px; }
.topbar a:hover { color: #fff; }
.topbar__right { display: flex; align-items: center; gap: var(--sp-2); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-line);
}
/* Header section wrapper must not create a box: .site-header sticks to <body>. */
.tiendy-section-header { display: contents; }

.header-main__inner {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding-block: var(--sp-3);
}
.brand { display: inline-flex; align-items: center; gap: var(--sp-2); color: var(--c-ink); }
.brand:hover { color: var(--c-primary); }
.brand__logo { flex: 0 0 auto; }
.brand__name { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.03em; }
.brand__name span { color: var(--c-primary); }
.logo-img { max-height: 44px; width: auto; }

/* Burger */
.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 9px;
  border-radius: var(--r-sm);
  border: 1.5px solid var(--c-line);
  flex: none;
}
.nav-toggle span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: var(--c-ink);
  transition: transform var(--tr), opacity var(--tr);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
@media (min-width: 960px) { .nav-toggle { display: none; } }

/* Searchbar */
.searchbar {
  flex: 1 1 320px;
  display: flex;
  max-width: 560px;
  margin-inline: auto;
}
.searchbar__input {
  flex: 1;
  min-width: 0;
  padding: 0.55rem 1rem;
  border: 1.5px solid var(--c-line);
  border-radius: var(--r-pill) 0 0 var(--r-pill);
  border-right: none;
  background: var(--c-paper);
  font-size: 0.95rem;
}
.searchbar__input:focus { outline: none; border-color: var(--c-primary); background: var(--c-surface); }
.searchbar__input::-webkit-search-cancel-button { -webkit-appearance: none; }
.searchbar__btn {
  display: inline-flex;
  align-items: center;
  padding-inline: 0.95rem;
  border-radius: 0 var(--r-pill) var(--r-pill) 0;
  background: var(--c-primary);
  color: #fff;
  transition: background var(--tr);
}
.searchbar__btn:hover { background: var(--c-primary-dark); color: #fff; }
@media (max-width: 639px) {
  .header-main__inner { flex-wrap: wrap; }
  .searchbar { order: 5; flex-basis: 100%; max-width: none; }
}

/* Header actions */
.header-actions { display: flex; align-items: center; gap: var(--sp-2); margin-left: auto; }
.icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: var(--r-sm);
  color: var(--c-ink);
  transition: background var(--tr), color var(--tr);
  flex: none;
}
.icon-btn:hover { background: var(--c-paper); color: var(--c-primary); }
.cart-count {
  position: absolute;
  top: 2px;
  right: 0;
  min-width: 18px;
  height: 18px;
  padding-inline: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-pill);
  background: var(--c-primary);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
}

/* Account menu */
.account-wrap { position: relative; }
.account-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 130;
  width: 250px;
  max-width: calc(100vw - 32px);
  padding: var(--sp-2);
  display: none;
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  box-shadow: var(--sh-2);
}
.account-menu.open { display: block; }
.account-menu a {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  color: var(--c-ink);
  font-size: 0.9rem;
  font-weight: 600;
}
.account-menu a:hover { background: var(--c-paper); color: var(--c-primary); }
.account-menu .icon { width: 17px; height: 17px; color: var(--c-muted); }
.account-menu-user {
  display: flex;
  flex-direction: column;
  padding: 10px 12px 12px;
  margin-bottom: var(--sp-1);
  border-bottom: 1px solid var(--c-line);
  min-width: 0;
}
.account-menu-user strong,
.account-menu-user span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-menu-user strong { font-size: 0.92rem; }
.account-menu-user span { font-size: 0.8rem; color: var(--c-muted); }
.account-menu-sep { height: 1px; margin: var(--sp-1) var(--sp-1); background: var(--c-line); }

/* ---------- Main nav (desktop) ---------- */
.mainnav { border-top: 1px solid var(--c-line); display: none; }
@media (min-width: 960px) { .mainnav { display: block; } }
.mainnav__list {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.mainnav__list > li { position: relative; }
.mainnav__list > li > a,
.has-mega__trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: var(--sp-3) var(--sp-2);
  font-weight: 600;
  color: var(--c-ink);
  border-bottom: 2.5px solid transparent;
  transition: color var(--tr), border-color var(--tr);
  font-size: 0.95rem;
}
.mainnav__list > li > a:hover,
.has-mega__trigger:hover { color: var(--c-primary); }
.mainnav__list > li > a[aria-current="page"] { color: var(--c-primary); border-bottom-color: var(--c-primary); }
.has-mega__trigger svg { transition: transform var(--tr); }
.has-mega.is-open .has-mega__trigger { color: var(--c-primary); }
.has-mega.is-open .has-mega__trigger svg { transform: rotate(180deg); }

/* Mega dropdown (2 levels: category > subcategory) */
.mega {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 120;
  min-width: 860px;
  max-width: calc(100vw - 32px);
  padding: var(--sp-6);
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  box-shadow: var(--sh-2);
  visibility: hidden;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--tr), transform var(--tr), visibility var(--tr);
}
.has-mega:hover .mega,
.has-mega.is-open .mega,
.has-mega:focus-within .mega {
  visibility: visible;
  opacity: 1;
  transform: none;
}
.mega__grid {
  display: grid;
  grid-template-columns: repeat(var(--mega-cols, 1), minmax(0, 1fr));
  gap: var(--sp-6);
}
.mega__grid--promo { grid-template-columns: repeat(var(--mega-cols, 1), minmax(0, 1fr)) minmax(0, 1.2fr); }
.mega__grid--promo > .mega__col--promo { grid-column: -2 / -1; grid-row: 1 / span var(--mega-rows, 1); }
.mega__col { min-width: 0; }
.mega__head {
  display: block;
  padding-bottom: var(--sp-2);
  margin-bottom: var(--sp-2);
  border-bottom: 1px solid var(--c-line);
  font-weight: 800;
  font-size: 0.92rem;
  color: var(--c-ink);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.mega__head:hover { color: var(--c-primary); }
.mega__col ul { display: grid; gap: 2px; }
.mega__col ul a {
  display: block;
  padding: 3px 0;
  font-size: 0.9rem;
  color: var(--c-muted);
  transition: color var(--tr), padding-left var(--tr);
}
.mega__col ul a:hover { color: var(--c-primary); padding-left: 4px; }
.mega__col--promo {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-4);
  border-radius: var(--r-sm);
  background: linear-gradient(135deg, var(--c-primary-soft), #ffe8db);
}
.mega__promo-title { font-weight: 800; color: var(--c-primary-dark); }
.mega__promo-text { font-size: 0.85rem; color: var(--c-muted); }

/* Flat dropdown panel (menus without the mega layout) */
.dropdown-panel {
  position: absolute;
  left: -8px;
  top: calc(100% + 6px);
  z-index: 120;
  width: 280px;
  max-width: calc(100vw - 32px);
  padding: var(--sp-2);
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  box-shadow: var(--sh-2);
  visibility: hidden;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--tr), transform var(--tr), visibility var(--tr);
}
.has-mega:hover .dropdown-panel,
.has-mega.is-open .dropdown-panel,
.has-mega:focus-within .dropdown-panel {
  visibility: visible;
  opacity: 1;
  transform: none;
}
.dropdown-panel .mega__col--promo { margin-top: var(--sp-2); }
.menu-level-1, .menu-level-2 { list-style: none; margin: 0; padding: 0; }
.menu-row { display: flex; align-items: center; border-radius: var(--r-sm); transition: background var(--tr); }
.menu-row:hover { background: var(--c-paper); }
.menu-link { flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--sp-3); padding: 9px 10px; border-radius: var(--r-sm); }
.menu-art { width: 38px; height: 38px; border-radius: var(--r-sm); flex: none; overflow: hidden; background: var(--c-paper); }
.menu-art img { width: 100%; height: 100%; object-fit: cover; }
.menu-link-label { flex: 1; min-width: 0; }
.menu-link-label strong { font-size: 0.9rem; font-weight: 700; color: var(--c-ink); }
.menu-level-2 { padding-left: var(--sp-4); display: grid; gap: 1px; }
.menu-level-2 a { display: block; padding: 5px 10px; border-radius: 6px; font-size: 0.88rem; color: var(--c-muted); }
.menu-level-2 a:hover { background: var(--c-paper); color: var(--c-primary); }
.menu-viewall { margin-top: var(--sp-1); border-top: 1px solid var(--c-line); padding-top: var(--sp-1); }
.menu-viewall a { color: var(--c-primary); font-weight: 700; font-size: 0.85rem; }
.menu-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  margin-top: var(--sp-2);
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--c-paper);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--c-ink);
}
.menu-cta:hover { background: var(--c-primary-soft); color: var(--c-primary-dark); }
.menu-cta .icon { width: 16px; height: 16px; }

/* ---------- Mobile nav drawer ---------- */
.mobile-nav {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 150;
  width: min(88vw, 360px);
  padding: var(--sp-5) var(--sp-4) var(--sp-8);
  background: var(--c-surface);
  border-right: 1px solid var(--c-line);
  overflow-y: auto;
  transform: translateX(-102%);
  transition: transform 220ms ease;
  box-shadow: var(--sh-2);
}
.mobile-nav.is-open { transform: none; }
.mobile-nav__search { margin-bottom: var(--sp-5); }
.mobile-nav__list { display: grid; gap: var(--sp-1); }
.mobile-nav__list > li > a {
  display: block;
  padding: var(--sp-3) var(--sp-2);
  border-radius: var(--r-sm);
  font-weight: 600;
  color: var(--c-ink);
}
.mobile-nav__list > li > a:hover,
.mobile-nav__list > li > a[aria-current="page"] { background: var(--c-paper); color: var(--c-primary); }
.mobile-nav__group { border-bottom: 1px solid var(--c-line); }
.mobile-nav__group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-3) var(--sp-2);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.mobile-nav__group summary::-webkit-details-marker { display: none; }
.mobile-nav__group summary::after {
  content: "";
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--c-muted);
  border-bottom: 2px solid var(--c-muted);
  transform: rotate(45deg);
  transition: transform var(--tr);
}
.mobile-nav__group[open] summary::after { transform: rotate(-135deg); }
.mobile-nav__group ul { padding: 0 var(--sp-2) var(--sp-3); display: grid; gap: 2px; }
.mobile-nav__group ul a { display: block; padding: 5px 0 5px var(--sp-3); font-size: 0.92rem; color: var(--c-muted); }
.mobile-nav__group ul a:hover { color: var(--c-primary); }
.mobile-nav__contact {
  margin-top: var(--sp-6);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--c-line);
  font-size: 0.88rem;
  color: var(--c-muted);
}
.mobile-nav__contact p { max-width: none; }
.mobile-nav__contact strong { color: var(--c-ink); }
.mobile-nav__sep { height: var(--sp-2); }
@media (min-width: 960px) { .mobile-nav { display: none; } }

/* Overlay (mobile nav / drawer dim) */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 140;
  background: rgba(33, 37, 41, 0.45);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--tr), visibility var(--tr);
}
.overlay.is-open { opacity: 1; visibility: visible; }

/* ---------- Cart drawer ---------- */
.drawer {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 160;
  width: min(92vw, 400px);
  display: flex;
  flex-direction: column;
  background: var(--c-surface);
  box-shadow: var(--sh-2);
  transform: translateX(102%);
  transition: transform 220ms ease;
  height: 100dvh;
}
.drawer.is-open { transform: none; }
.drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-5);
  border-bottom: 1px solid var(--c-line);
}
.drawer__head h2 { font-size: 1.1rem; }
.drawer__close { display: inline-flex; padding: 6px; border-radius: var(--r-sm); color: var(--c-muted); }
.drawer__close:hover { background: var(--c-paper); color: var(--c-ink); }
.drawer__body { flex: 1; overflow-y: auto; padding: var(--sp-5); display: grid; gap: var(--sp-4); align-content: start; }
.drawer__foot { padding: var(--sp-5); border-top: 1px solid var(--c-line); display: grid; gap: var(--sp-3); }
.drawer__item { display: grid; grid-template-columns: 56px 1fr auto; gap: var(--sp-3); align-items: center; }
.drawer__item .ph { aspect-ratio: 1 / 0.86; }
.drawer__item .ci-media { width: 56px; height: 56px; }
.drawer__item-title { font-size: 0.88rem; font-weight: 700; color: var(--c-ink); }
.drawer__item-title:hover { color: var(--c-primary); }
.drawer__item-meta { font-size: 0.78rem; color: var(--c-muted); }
.drawer__item-price { font-weight: 800; font-size: 0.9rem; }
.drawer-actions { display: grid; gap: var(--sp-2); }
.subtotal { display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-4); font-size: 0.95rem; }
.subtotal strong { font-size: 1.15rem; letter-spacing: -0.01em; }
.drawer-note { font-size: 0.78rem; color: var(--c-muted); max-width: none; }

/* ---------- Cart rows (drawer and cart page) ---------- */
.ci-media { width: 72px; height: 72px; border-radius: var(--r-sm); overflow: hidden; background: var(--c-paper); flex: none; }
.ci-media img { width: 100%; height: 100%; object-fit: cover; }
.ci-info { flex: 1; min-width: 0; }
.ci-name { font-weight: 700; font-size: 0.92rem; display: block; }
.ci-name:hover { color: var(--c-primary); }
.ci-price { font-size: 0.82rem; color: var(--c-muted); }
.ci-right { display: flex; flex-direction: column; align-items: flex-end; gap: var(--sp-2); }
.ci-right strong { font-size: 0.95rem; }

/* ---------- Toasts ---------- */
#toast-container, .toast-region {
  position: fixed;
  bottom: var(--sp-5);
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: grid;
  gap: var(--sp-2);
  width: min(92vw, 420px);
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-sm);
  background: var(--c-ink);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: var(--sh-2);
  animation: toast-in 220ms ease;
}
.toast--ok { background: var(--c-success); }
.toast--err { background: var(--c-danger); }
.toast .icon { flex: 0 0 auto; }
.toast.hide { opacity: 0; transform: translateY(8px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Footer ---------- */
.footer {
  margin-top: var(--sp-10);
  background: var(--c-ink);
  color: rgba(255, 255, 255, 0.78);
}
.footer a { color: rgba(255, 255, 255, 0.78); }
.footer a:hover { color: #fff; }
.footer__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-7);
  padding-block: var(--sp-9) var(--sp-7);
}
@media (min-width: 640px) { .footer__grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 960px) { .footer__grid { grid-template-columns: 2fr 1fr 1fr 1.6fr; } }
.footer .brand, .footer .brand:hover { color: #fff; }
.footer__blurb { margin-top: var(--sp-3); font-size: 0.9rem; max-width: 34ch; }
.footer__contact { margin-top: var(--sp-4); display: grid; gap: 2px; font-size: 0.9rem; }
.footer__contact p { max-width: none; }
.footer h3 {
  color: #fff;
  font-size: 0.95rem;
  margin-bottom: var(--sp-4);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.footer nav ul { display: grid; gap: var(--sp-2); font-size: 0.92rem; }
.footer__news p { font-size: 0.9rem; margin-bottom: var(--sp-4); }
.footer__news form { display: flex; gap: var(--sp-2); }
.footer__news .input {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.footer__news .input::placeholder { color: rgba(255, 255, 255, 0.45); }
.footer__social { display: flex; gap: var(--sp-3); margin-top: var(--sp-5); }
.footer__social a { display: inline-flex; padding: 6px; border-radius: var(--r-sm); }
.footer__social a:hover { background: rgba(255, 255, 255, 0.12); }
.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding-block: var(--sp-5);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.82rem;
}
.footer__bottom p { max-width: none; }
.pay-marks { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.pay-marks li {
  padding: 3px 10px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--r-sm);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}
.footer-legal { display: flex; flex-wrap: wrap; gap: var(--sp-3); }
.footer__bottom-right { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3) var(--sp-5); }
.lang-link.active { color: #fff; font-weight: 700; }
.newsletter-success { color: #8ce99a; font-size: 0.9rem; font-weight: 600; }

/* ---------- Placeholders (.ph) ---------- */
.ph {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 0.86;
  border-radius: var(--r-md);
  color: color-mix(in srgb, var(--ph-ink, #d9480f) 75%, #fff);
  background: linear-gradient(135deg, var(--ph-a, #fff4ec), var(--ph-b, #ffe3d0));
}
.ph svg { width: 44%; height: auto; opacity: 0.9; }
.ph--img { display: block; overflow: hidden; background: #f1f3f5; }
.ph--img img { width: 100%; height: 100%; object-fit: cover; }
.ph--t1 { --ph-a: #fff4ec; --ph-b: #ffe3d0; --ph-ink: #d9480f; }
.ph--t2 { --ph-a: #ebfbee; --ph-b: #d3f9d8; --ph-ink: #2f9e44; }
.ph--t3 { --ph-a: #fff9db; --ph-b: #ffec99; --ph-ink: #e67700; }
.ph--t4 { --ph-a: #e7f5ff; --ph-b: #d0ebff; --ph-ink: #1971c2; }
.ph--t5 { --ph-a: #e6fcf5; --ph-b: #c3fae8; --ph-ink: #0ca678; }
.ph--sm svg { width: 34%; }
.ph--lg { aspect-ratio: 1 / 1; border-radius: var(--r-lg); }
.ph--lg svg { width: 40%; }
.ph--xl { aspect-ratio: 16 / 8; border-radius: var(--r-lg); }
.ph--hero { aspect-ratio: auto; min-height: 260px; padding: var(--sp-6); border-radius: var(--r-lg); }
.ph--hero svg { width: 52%; height: auto; }

/* ---------- Product card ---------- */
.product-card, .card-product {
  display: flex;
  flex-direction: column;
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  overflow: hidden;
  transition: box-shadow var(--tr), transform var(--tr), border-color var(--tr);
}
.product-card:hover, .card-product:hover { box-shadow: var(--sh-2); transform: translateY(-3px); border-color: var(--c-line-strong); }
.product-media, .card-product__media { position: relative; display: block; color: inherit; }
.product-media { aspect-ratio: 1 / 0.86; overflow: hidden; background: var(--c-paper); }
.product-media .ph, .card-product__media .ph { border-radius: 0; aspect-ratio: 1 / 0.86; }
.product-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 300ms ease; }
.product-card:hover .product-media img { transform: scale(1.05); }
.media-link { position: absolute; inset: 0; z-index: 1; }
.card-product__badges, .product-badges {
  position: absolute;
  top: var(--sp-3);
  left: var(--sp-3);
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}
.card-product__body { display: flex; flex-direction: column; gap: 6px; padding: var(--sp-4); flex: 1; }
.card-product__brand, .product-cat {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--c-muted);
}
.card-product__title, .product-name {
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--c-ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.7em;
}
.card-product__title:hover, .product-name a:hover { color: var(--c-primary); }
.card-product__rating, .product-rating { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--c-muted); }
.product-info { display: flex; flex-direction: column; gap: 6px; padding: var(--sp-4); flex: 1; }
.product-top { display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-3); }
.product-meta { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); }
.card-product__price-row { margin-top: auto; display: flex; align-items: baseline; flex-wrap: wrap; gap: var(--sp-2); }
.price { font-size: 1.15rem; font-weight: 800; letter-spacing: -0.01em; color: var(--c-ink); white-space: nowrap; }
.price s, .price-old { font-size: 0.88rem; color: var(--c-muted); text-decoration: line-through; font-weight: 400; }
.price-save { font-size: 0.78rem; font-weight: 700; color: var(--c-danger); }
.card-product__foot { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); padding: 0 var(--sp-4) var(--sp-4); }
.card-product__stock { font-size: 0.78rem; font-weight: 600; }
.card-product__stock--ok, .stock-ok { color: var(--c-success); }
.card-product__stock--out, .stock-out { color: var(--c-danger); }

/* Quick add from a listing */
.quick-add {
  position: absolute;
  right: var(--sp-3);
  bottom: var(--sp-3);
  z-index: 2;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #fff;
  color: var(--c-ink);
  display: grid;
  place-items: center;
  box-shadow: var(--sh-2);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity var(--tr), transform var(--tr), background var(--tr), color var(--tr);
}
.quick-add:hover { background: var(--c-primary); color: #fff; }
.quick-add .icon { width: 16px; height: 16px; }
.product-card:hover .quick-add, .quick-add:focus-visible { opacity: 1; transform: translateY(0); }
@media (hover: none) { .quick-add { opacity: 1; transform: none; } }

/* ---------- Stars ---------- */
.stars { display: inline-flex; gap: 1px; color: var(--c-star); align-items: center; }
.stars svg, .star { width: 14px; height: 14px; fill: currentColor; }
.stars .star { display: inline-flex; }
.stars .star--off, .star.off { color: var(--c-line-strong); fill: var(--c-line-strong); }
.star--half { position: relative; }
.star--half .star__bg { display: inline-flex; color: var(--c-line-strong); }
.star--half .star__fg { position: absolute; inset: 0; width: 50%; overflow: hidden; display: inline-flex; color: var(--c-star); }
.rating-text { font-size: 0.8rem; color: var(--c-muted); }
.rating-link { display: inline-flex; align-items: center; }
.rating-link:hover .rating-text { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Chips ---------- */
.chip-row { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1.5px solid var(--c-line);
  border-radius: var(--r-pill);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--c-muted);
  background: var(--c-surface);
  transition: border-color var(--tr), background var(--tr), color var(--tr);
}
.chip:hover { border-color: var(--c-primary); color: var(--c-primary); }
.chip.active, .chip[aria-current] { background: var(--c-ink); border-color: var(--c-ink); color: #fff; }
.chip-mini { padding: 3px 10px; font-size: 0.75rem; background: var(--c-primary-soft); border-color: transparent; color: var(--c-primary-dark); }

/* ---------- Pagination ---------- */
.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--sp-2); margin-top: var(--sp-8); }
.pagination__link, .page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding-inline: var(--sp-2);
  border: 1.5px solid var(--c-line);
  border-radius: var(--r-sm);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--c-ink);
  background: var(--c-surface);
  transition: border-color var(--tr), background var(--tr), color var(--tr);
}
.pagination__link:hover, .page-btn:hover:not(.active) { border-color: var(--c-primary); color: var(--c-primary); }
.pagination__link[aria-current="page"], .page-btn.active { background: var(--c-primary); border-color: var(--c-primary); color: #fff; pointer-events: none; }
.pagination__link[disabled], .page-btn[aria-disabled="true"] { opacity: 0.4; pointer-events: none; }
.pagination__gap { padding-inline: var(--sp-1); color: var(--c-muted); font-weight: 700; }
.page-btn .icon { width: 17px; height: 17px; }

/* ---------- Breadcrumbs ---------- */
.breadcrumb, .crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  font-size: 0.85rem;
  color: var(--c-muted);
}
.breadcrumb a, .crumbs a { color: var(--c-muted); }
.breadcrumb a:hover, .crumbs a:hover { color: var(--c-primary); }
.crumbs li { display: flex; align-items: center; gap: var(--sp-2); }
.crumbs li + li::before { content: "/"; color: var(--c-line-strong); }
.breadcrumb .crumb-sep { color: var(--c-line-strong); }
.crumb-here, .crumbs [aria-current="page"] { color: var(--c-ink); font-weight: 600; }

/* ---------- Alerts ---------- */
.alert {
  display: flex;
  gap: var(--sp-3);
  align-items: flex-start;
  padding: var(--sp-4);
  border-radius: var(--r-sm);
  font-size: 0.9rem;
  border: 1px solid transparent;
}
.alert p { max-width: none; }
.alert .icon { flex: 0 0 auto; margin-top: 2px; }
.alert--info { background: var(--c-info-soft); color: #1864ab; border-color: #a5d8ff; }
.alert--ok { background: var(--c-success-soft); color: #2b8a3e; border-color: #b2f2bb; }
.alert--err { background: var(--c-danger-soft); color: #c92a2a; border-color: #ffc9c9; }

/* ---------- Empty state ---------- */
.empty-state {
  text-align: center;
  padding: var(--sp-9) var(--sp-5);
  display: grid;
  justify-items: center;
  gap: var(--sp-3);
}
.empty-state .icon, .empty-state svg { width: 56px; height: 56px; color: var(--c-line-strong); }
.empty-state h2 { font-size: 1.3rem; }
.empty-state p { color: var(--c-muted); max-width: 46ch; }

/* ---------- Accordion ---------- */
.accordion { display: grid; gap: var(--sp-3); }
.accordion details, .faq {
  border: 1px solid var(--c-line);
  border-radius: var(--r-sm);
  background: var(--c-surface);
}
.accordion summary, .faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-4);
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.accordion summary::-webkit-details-marker, .faq summary::-webkit-details-marker { display: none; }
.accordion summary::after, .faq summary::after {
  content: "";
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-right: 2.5px solid var(--c-primary);
  border-bottom: 2.5px solid var(--c-primary);
  transform: rotate(45deg);
  transition: transform var(--tr);
}
.accordion details[open] summary::after, .faq[open] summary::after { transform: rotate(225deg); }
.accordion details > div { padding: 0 var(--sp-4) var(--sp-4); color: var(--c-muted); }
.faq p { padding: 0 var(--sp-4) var(--sp-4); color: var(--c-muted); }

/* ---------- Tags ---------- */
.tag {
  display: inline-flex;
  padding: 4px 12px;
  border-radius: var(--r-pill);
  background: var(--c-paper);
  border: 1px solid var(--c-line);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--c-muted);
}
.tag:hover { border-color: var(--c-primary); color: var(--c-primary); }
.tag-row { display: flex; flex-wrap: wrap; gap: var(--sp-2); }

/* ---------- Theme sections (editable in the template editor) ---------- */
.text-section { text-align: center; max-width: 760px; margin-inline: auto; }
.text-section--left { text-align: left; margin-inline: 0; }
.text-section h2 { margin-bottom: var(--sp-3); }
.text-section__text { color: var(--c-muted); margin-bottom: var(--sp-5); }
.text-section__text p + p { margin-top: var(--sp-3); }
.image-with-text { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-8); align-items: center; }
.image-with-text--reverse .image-with-text__media { order: 2; }
.image-with-text__media img, .image-with-text__placeholder {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--r-lg);
}
.image-with-text__placeholder { background: var(--c-paper); border: 1px solid var(--c-line); }
.image-with-text__copy h2 { margin: var(--sp-2) 0 var(--sp-4); }
.image-with-text__text { margin-bottom: var(--sp-5); }
.image-with-text__text > * + * { margin-top: var(--sp-4); }
.image-with-text__text blockquote {
  padding: var(--sp-5);
  border-left: 4px solid var(--c-primary);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  background: var(--c-primary-soft);
  font-weight: 600;
}

/* ---------- Responsive (core) ---------- */
@media (max-width: 900px) {
  .image-with-text { grid-template-columns: 1fr; gap: var(--sp-5); }
  .image-with-text--reverse .image-with-text__media { order: 0; }
}

@media (max-width: 560px) {
  .footer__grid { grid-template-columns: 1fr; gap: var(--sp-6); }
  .topbar { font-size: 0.72rem; }
  .brand__name { font-size: 1.25rem; }
}
