/* Componentes compartidos. Un solo sistema de forma: esquinas rectas. */

/* ---------- Aviso de vista de ejemplo ---------- */
.demo-banner { background: var(--accent); color: var(--accent-ink); text-align: center; font: 700 .8rem/1.35 var(--f-body); padding: 9px var(--gutter); }
.demo-banner a { text-decoration: underline; text-underline-offset: 3px; margin-left: 8px; white-space: nowrap; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 26px; white-space: nowrap;
  font: 700 .95rem/1 var(--f-body); letter-spacing: .02em; text-transform: uppercase;
  border: 1.5px solid transparent; position: relative; isolation: isolate; overflow: hidden;
  transition: color var(--t-fast), background-color var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
}
.btn .ico { width: 1.2em; height: 1.2em; flex: none; }
.btn:active:not(:disabled) { transform: translateY(1px) scale(.99); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn--line { border-color: var(--line-2); color: var(--text); }
.btn--line:hover:not(:disabled) { border-color: var(--text); }
.btn--dark { background: #0d0d0c; color: #f0efe9; }
.btn--dark:hover { background: #26261f; }
.btn--sm { min-height: 42px; padding: 0 18px; font-size: .82rem; }
.btn--block { width: 100%; }

.link-arrow { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: .95rem; border-bottom: 1.5px solid var(--line-2); padding-bottom: 3px; transition: border-color var(--t-fast), gap var(--t-fast); }
.link-arrow .ico { width: 1.1em; height: 1.1em; }
.link-arrow:hover { border-color: var(--accent-text); gap: 12px; }
.link-plain { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; font-size: .9rem; display: inline-flex; align-items: center; gap: 6px; }
.link-plain:hover { color: var(--text); }
.link-plain .ico { width: 1em; height: 1em; }

.ico { width: 1.25rem; height: 1.25rem; fill: currentColor; flex: none; }
.icon-btn { width: 44px; height: 44px; display: inline-grid; place-items: center; color: var(--text); transition: background-color var(--t-fast); }
.icon-btn:hover { background: var(--raise); }

/* ---------- Cabecera ---------- */
.site-header { position: relative; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3); border-bottom: 1px solid transparent; transition: border-color var(--t), background-color var(--t); }
.site-header.is-scrolled { border-bottom-color: var(--line); background: color-mix(in srgb, var(--bg) 94%, transparent); }
.site-header__in { height: var(--header-h); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.brand { justify-self: center; display: block; line-height: 0; }
.brand img { height: 30px; width: auto; }
:root[data-theme="light"] .brand img, :root[data-theme="light"] .footer__brand img { filter: invert(1) hue-rotate(180deg); }
.menu-btn { justify-self: start; margin-left: -10px; }
.nav { display: none; }
.site-header__actions { justify-self: end; display: flex; gap: 2px; margin-right: -10px; }
.bag-btn { position: relative; }
.bag-btn__count { position: absolute; top: 4px; right: 2px; min-width: 19px; height: 19px; padding: 0 5px; background: var(--accent); color: var(--accent-ink); font: 800 .7rem/19px var(--f-body); text-align: center; }
.bag-btn__count.is-bump { animation: bump .5s var(--ease); }
@keyframes bump { 40% { transform: scale(1.35); } }

@media (min-width: 980px) {
  .site-header__in { grid-template-columns: auto 1fr auto; gap: 40px; }
  .menu-btn { display: none; }
  .brand { justify-self: start; }
  .brand img { height: 34px; }
  .nav { display: flex; gap: 6px; }
  .nav a { padding: 10px 14px; font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); position: relative; transition: color var(--t-fast); white-space: nowrap; }
  .nav a::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 4px; height: 2px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform var(--t) var(--ease); }
  .nav a:hover, .nav a[aria-current] { color: var(--text); }
  .nav a:hover::after, .nav a[aria-current]::after { transform: scaleX(1); }
}

/* ---------- Diálogos ---------- */
dialog { border: 0; padding: 0; color: var(--text); background: var(--surface); max-width: none; max-height: none; }
dialog::backdrop { background: var(--scrim); backdrop-filter: blur(4px); }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 12px 14px 22px; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-family: var(--f-display); font-stretch: 78%; font-size: 1.5rem; text-transform: uppercase; font-weight: 800; }

.menu[open], .bag[open] { display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; margin: 0; height: 100dvh; width: min(420px, 92vw); animation: slide-l .38s var(--ease); }
.bag[open] { inset: 0 0 0 auto; width: min(460px, 100vw); animation-name: slide-r; }
@keyframes slide-l { from { transform: translateX(-100%); } }
@keyframes slide-r { from { transform: translateX(100%); } }
.menu__nav { flex: 1; overflow: auto; padding: 8px 22px; display: grid; align-content: start; }
.menu__nav a { display: flex; align-items: baseline; justify-content: space-between; padding: 16px 0; border-bottom: 1px solid var(--line); font-family: var(--f-display); font-stretch: 78%; font-weight: 800; font-size: 1.9rem; text-transform: uppercase; }
.menu__nav small { font: 500 .85rem var(--f-body); color: var(--muted); text-transform: none; }
.menu__foot { padding: 18px 22px 22px; display: grid; gap: 12px; border-top: 1px solid var(--line); }
.theme-toggle { font-size: .9rem; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; justify-self: start; }
.theme-toggle:hover { color: var(--text); }

.search-dialog[open] { position: fixed; inset: 0 0 auto 0; margin: 0; width: 100%; max-height: 90dvh; overflow: auto; animation: slide-d .34s var(--ease); }
@keyframes slide-d { from { transform: translateY(-24px); opacity: 0; } }
.search-dialog form { max-width: 900px; margin-inline: auto; display: flex; align-items: center; gap: 12px; padding: 14px var(--gutter); border-bottom: 1px solid var(--line); }
.search-dialog input { flex: 1; min-width: 0; height: 56px; background: none; border: 0; outline: 0; font: 600 1.4rem var(--f-body); }
.search-dialog__body { max-width: 900px; margin-inline: auto; padding: 24px var(--gutter) 36px; display: grid; gap: 18px; }
.search-results { display: grid; }
.search-result { display: grid; grid-template-columns: 56px 1fr auto; gap: 16px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.search-result img { width: 56px; height: 64px; object-fit: cover; background: var(--raise); }
.search-result__name { font-weight: 700; }
.search-result__meta { font-size: .85rem; color: var(--muted); }

/* ---------- Bolsa ---------- */
.bag__scroll { flex: 1; overflow: auto; padding: 8px 22px; }
.bag__foot { border-top: 1px solid var(--line); padding: 18px 22px 22px; display: grid; gap: 14px; background: var(--surface); max-height: 62dvh; overflow: auto; }
.bag-line { display: grid; grid-template-columns: 84px 1fr; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.bag-line img, .bag-line .ph { width: 84px; height: 96px; object-fit: cover; background: var(--raise); }
.bag-line__name { font-weight: 700; line-height: 1.25; }
.bag-line__meta { font-size: .85rem; color: var(--muted); margin-top: 2px; }
.bag-line__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.bag-line__price { font-weight: 700; font-variant-numeric: tabular-nums; }
.bag-line__price.is-ask { font-weight: 500; color: var(--muted); font-size: .9rem; }
.bag-line__remove { margin-top: 8px; display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--muted); }
.bag-line__remove:hover { color: var(--error); }
.bag-line__remove .ico { width: 1em; height: 1em; }
.totals__row { display: flex; justify-content: space-between; align-items: baseline; }
.totals__row span { color: var(--muted); }
.totals__row strong { font: 800 2rem/1 var(--f-display); font-stretch: 78%; font-variant-numeric: tabular-nums; }
.totals__note { font-size: .82rem; color: var(--muted); margin-top: 6px; }
.confirm-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: .9rem; }

.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--line-2); }
.qty button { width: 40px; height: 40px; display: grid; place-items: center; transition: background-color var(--t-fast); }
.qty button:hover:not(:disabled) { background: var(--raise); }
.qty button:disabled { opacity: .35; cursor: not-allowed; }
.qty output { min-width: 38px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.qty .ico { width: 1rem; height: 1rem; }

/* ---------- Vista rápida ---------- */
.quick[open] { position: fixed; inset: 0; margin: auto; width: min(860px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: auto; animation: pop .34s var(--ease); }
@keyframes pop { from { transform: translateY(16px) scale(.98); opacity: 0; } }
.quick__grid { display: grid; }
.quick__media { position: relative; background: var(--raise); aspect-ratio: 7 / 8; max-height: 46dvh; overflow: hidden; }
.quick__media img, .quick__media .ph { width: 100%; height: 100%; object-fit: cover; }
.quick__close { position: absolute; top: 8px; right: 8px; background: var(--bg); z-index: 2; }
.quick__body { padding: 22px; display: grid; gap: 18px; align-content: start; }
.quick__title { font: 800 2rem/1 var(--f-display); font-stretch: 76%; text-transform: uppercase; }
.quick__actions { display: grid; gap: 14px; }
@media (min-width: 760px) {
  .quick__grid { grid-template-columns: 5fr 6fr; }
  .quick__media { aspect-ratio: auto; max-height: none; min-height: 100%; }
  .quick__body { padding: 32px; }
}

/* ---------- Tarjeta de producto: marco gris suave con la foto al centro ---------- */
/* Regla de forma: las tarjetas y las tallas son suaves (20 px y píldora); el resto del sitio conserva las esquinas rectas. */
:root { --r-card: 20px; --r-pill: 999px; }
.grid-products { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 14px; }
@media (min-width: 700px) { .grid-products { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 44px 22px; } }
@media (min-width: 1100px) { .grid-products { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 52px 26px; } }

.pcard { position: relative; display: flex; flex-direction: column; min-width: 0; }
.pcard__frame { display: grid; place-items: center; aspect-ratio: 1; background: var(--raise); border-radius: var(--r-card); overflow: hidden; }
.pcard__media { position: relative; display: block; height: 100%; aspect-ratio: 7 / 8; overflow: hidden; }
.pcard__media img, .pcard__media .ph { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease), opacity .5s; }
.pcard__media img { opacity: 0; }
.pcard__media.is-loaded img { opacity: 1; }
.pcard__media:not(.is-loaded)::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, color-mix(in srgb, var(--text) 8%, transparent) 50%, transparent 70%); transform: translateX(-100%); animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
@media (hover: hover) { .pcard:hover .pcard__media img { transform: scale(1.04); } }
.pcard.is-soldout .pcard__media img { filter: grayscale(1); opacity: .5; }

.pcard__body { display: grid; gap: 12px; padding-top: 18px; }
.pcard__name { font: 500 .88rem/1.35 var(--f-body); letter-spacing: .09em; text-transform: uppercase; overflow-wrap: anywhere; }
.pcard__name a:hover { text-decoration: underline; text-underline-offset: 4px; }
.pcard__sizes { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-talla { min-width: 40px; height: 32px; padding: 0 12px; border-radius: var(--r-pill); background: var(--raise); font: 500 .78rem/1 var(--f-body); letter-spacing: .04em; transition: background-color var(--t-fast), color var(--t-fast); }
.chip-talla:hover:not(:disabled) { background: var(--text); color: var(--bg); }
.chip-talla:disabled { opacity: .38; text-decoration: line-through; cursor: not-allowed; }
.pcard__brand, .pcard__cat { font: 500 .72rem/1 var(--f-body); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.pcard__price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font: 700 1.05rem/1.2 var(--f-body); letter-spacing: .03em; font-variant-numeric: tabular-nums; }
.pcard__price del { color: var(--muted); font-weight: 400; font-size: .88rem; }
.pcard__price.is-ask, .pcard__soldout { color: var(--muted); font-weight: 500; font-size: .92rem; }
.pcard--sk .pcard__media { animation: pulse 1.4s infinite; background: var(--raise); }
.pcard--sk .sk-line { height: 14px; background: var(--raise); border-radius: 8px; animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .55; } }

.ph { display: grid; place-content: center; text-align: center; gap: 4px; padding: 16px; background: var(--raise); color: var(--muted); font-size: .85rem; }
.ph strong { color: var(--text); font-family: var(--f-display); font-stretch: 78%; text-transform: uppercase; font-size: 1.1rem; }

/* ---------- Tallas ---------- */
.sizes { border: 0; padding: 0; min-width: 0; }
.sizes legend { padding: 0; font-weight: 700; font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 10px; }
.sizes__list { display: flex; flex-wrap: wrap; gap: 8px; }
.size { position: relative; }
.size input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.size span { display: grid; place-items: center; min-width: 58px; min-height: 52px; padding: 6px 10px; border: 1.5px solid var(--line-2); font-weight: 700; transition: background-color var(--t-fast), border-color var(--t-fast), color var(--t-fast); }
.size small { font-weight: 500; font-size: .68rem; color: var(--muted); line-height: 1; margin-top: 2px; }
.size:hover input:not(:disabled) + span { border-color: var(--text); }
.size input:checked + span { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.size input:checked + span small { color: var(--accent-ink); }
.size input:focus-visible + span { outline: 2px solid var(--accent-text); outline-offset: 3px; }
.size input:disabled + span { opacity: .4; cursor: not-allowed; text-decoration: line-through; }
.sizes.has-error .size span { border-color: var(--error); }

/* ---------- Formularios ---------- */
.field { display: grid; gap: 8px; }
.label, .field > label { font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.input, .select, .textarea { width: 100%; min-height: 50px; padding: 12px 14px; background: var(--bg); border: 1.5px solid var(--line-2); color: var(--text); border-radius: 0; transition: border-color var(--t-fast); }
.textarea { min-height: 96px; resize: vertical; }
.select { appearance: none; padding-right: 40px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 55%, calc(100% - 14px) 55%; background-size: 6px 6px; background-repeat: no-repeat; }
.input::placeholder, .textarea::placeholder { color: var(--muted); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--muted); }
.input:focus, .select:focus, .textarea:focus { outline: 0; border-color: var(--accent-text); }
:root:not([data-theme="light"]) .input:focus, :root:not([data-theme="light"]) .select:focus, :root:not([data-theme="light"]) .textarea:focus { border-color: var(--accent); }
.field.has-error .input { border-color: var(--error); }
.field__error { display: flex; align-items: center; gap: 6px; color: var(--error); font-size: .85rem; }
.field__error .ico { width: 1.1em; height: 1.1em; }
.field__hint { font-size: .82rem; color: var(--muted); }

.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line-2); font-size: .88rem; }
.notice .ico { margin-top: 2px; width: 1.1rem; height: 1.1rem; color: var(--accent-text); }
.notice--error { border-color: var(--error); }
.notice--error .ico { color: var(--error); }

/* ---------- Chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 16px; border: 1.5px solid var(--line-2); font-weight: 600; font-size: .9rem; transition: background-color var(--t-fast), border-color var(--t-fast), color var(--t-fast); white-space: nowrap; }
.chip small { font-size: .74rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.chip:hover { border-color: var(--text); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip[aria-pressed="true"] small { color: var(--accent-ink); }

/* ---------- Estados vacíos y avisos ---------- */
.empty { display: grid; gap: 14px; justify-items: start; padding-block: 56px; }
.empty--center { justify-items: center; text-align: center; padding: 48px 8px; }
.empty__actions { display: flex; flex-wrap: wrap; gap: 12px; }

.toasts { position: fixed; z-index: var(--z-toast); left: 50%; bottom: 20px; transform: translateX(-50%); display: grid; gap: 10px; width: min(460px, calc(100vw - 24px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--text); color: var(--bg); font-size: .92rem; font-weight: 500; animation: toast-in .4s var(--ease); box-shadow: 0 12px 40px rgb(0 0 0 / .35); }
.toast .ico { color: inherit; }
.toast--error { background: var(--error); color: #1a0a08; }
.toast span { flex: 1; }
.toast button { font-weight: 800; text-transform: uppercase; font-size: .78rem; letter-spacing: .06em; text-decoration: underline; text-underline-offset: 3px; }
@keyframes toast-in { from { transform: translateY(20px); opacity: 0; } }

/* ---------- Pie ---------- */
.site-footer { border-top: 1px solid var(--line); padding-top: clamp(48px, 7vw, 96px); background: var(--bg-2); }
.footer__top { display: grid; gap: 44px; }
.footer__brand { display: grid; gap: 18px; max-width: 360px; align-content: start; }
.footer__brand img { width: 220px; height: auto; }
.footer__cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 20px; }
.footer__col h2 { font: 700 .78rem var(--f-body); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.footer__col ul { display: grid; gap: 10px; }
.footer__col a, .footer__col button { color: var(--text); }
.footer__col a:hover, .footer__col button:hover { color: var(--accent-text); }
.footer__bottom { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; align-items: center; margin-top: 56px; padding-block: 22px; border-top: 1px solid var(--line); font-size: .85rem; color: var(--muted); }
.to-top { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-weight: 600; }
.to-top .ico { width: 1em; height: 1em; }
@media (min-width: 900px) {
  .footer__top { grid-template-columns: minmax(280px, 1fr) 2fr; gap: 80px; }
  .footer__cols { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- Aparición al desplazar ---------- */
.js-motion .reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: calc(var(--d, 0) * 80ms); }
.js-motion .reveal.in { opacity: 1; transform: none; }
.reveal-words .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .06em; margin-bottom: -.06em; }
.js-motion .reveal-words .w__i { display: inline-block; transform: translateY(110%); transition: transform .8s var(--ease); transition-delay: calc(var(--i, 0) * 60ms); }
.js-motion .reveal-words.in .w__i { transform: none; }

/* ---------- Casilla de autorización (bolsa) ---------- */
.check { display: grid; grid-template-columns: 22px 1fr; gap: 12px; align-items: start; font-size: .85rem; line-height: 1.5; color: var(--muted); cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--accent); cursor: pointer; }
.check a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.field.has-error .check { color: var(--error); }

/* ---------- Pie: enlaces legales y redes ---------- */
.footer__legal { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.footer__legal a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.footer__legal a:hover { color: var(--text); }
/* ---------- Botón flotante de WhatsApp ---------- */
.wa-float { position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 35; width: 58px; height: 58px; display: grid; place-items: center; border-radius: var(--r-pill); background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 28px rgb(0 0 0 / .35); transition: transform .3s var(--ease), opacity .3s, background-color var(--t-fast); }
.wa-float .ico { width: 30px; height: 30px; }
.wa-float:hover { background: var(--accent-hover); transform: translateY(-2px) scale(1.05); }
.wa-float:active { transform: scale(.97); }
.wa-float.is-hidden { opacity: 0; transform: translateY(14px); pointer-events: none; }
@media (prefers-reduced-motion: no-preference) { .wa-float { animation: fab-in .6s var(--ease) 1.2s both; } @keyframes fab-in { from { opacity: 0; transform: translateY(16px) scale(.9); } } }
/* En la ficha de producto, en celular, se sube para no tapar la barra de compra */
@media (max-width: 899px) { body[data-page="producto"] .wa-float { bottom: calc(86px + env(safe-area-inset-bottom)); } }