/* ============================================================
   shop.css — vitrinas públicas: Singles (catalog.php) y Productos (productos.php)

   Un solo lenguaje visual para las dos: fondo claro, mucho aire, líneas finas en vez de cajas,
   el rojo de la marca solo donde hay una acción o algo seleccionado, y el dorado reservado para
   las cartas gradeadas. Tipografía de la marca (Space Grotesk + IBM Plex Sans).

   Prefijo shp-  ·  .shp = página completa  ·  .shp-embed = solo las fichas dentro de otra página
   ============================================================ */

.shp, .shp-embed {
    --ink: #16151A;
    --ink-2: #4A4740;
    --mute: #86817A;
    --line: #E9E5DC;
    --line-2: #F2EFE8;
    --paper: #FBFAF7;
    --tile: #F2F0EA;
    --white: #FFFFFF;
    --accent: #C90101;
    --accent-dk: #9E0000;
    --gold: #B8873F;
    --gold-bg: #FBF3E3;
    --ok: #0F7B5A;
    --warn: #B45309;
    --f-display: 'Space Grotesk', -apple-system, 'Segoe UI', sans-serif;
    --f-body: 'IBM Plex Sans', -apple-system, 'Segoe UI', sans-serif;
    font-family: var(--f-body);
    color: var(--ink);
}
/* Fichas dentro de otra página (productos relacionados): heredan la tipografía de esa página */
.shp-embed { --f-display: var(--tcg-font, inherit); --f-body: var(--tcg-font, inherit); }
.shp { background: var(--paper); min-height: 70vh; padding-bottom: 72px; }
.shp *, .shp-embed * { box-sizing: border-box; }
.shp a, .shp-embed a { text-decoration: none; }
.shp button { font-family: inherit; }
.shp [hidden] { display: none !important; }

.shp-wrap { max-width: 1320px; margin: 0 auto; padding: 40px 28px 0; }

/* ---------- Encabezado ---------- */
.shp-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 18px 32px; flex-wrap: wrap; margin-bottom: 30px; }
.shp-title { font: 600 clamp(2rem, 3.6vw, 2.7rem)/1.04 var(--f-display); letter-spacing: -.035em; margin: 0; }
.shp-sub { margin: 10px 0 0; color: var(--mute); font-size: .95rem; max-width: 52ch; }
.shp-head__right { display: flex; align-items: center; gap: 10px; flex: 1 1 340px; justify-content: flex-end; }

.shp-search { position: relative; flex: 1 1 320px; max-width: 440px; }
.shp-search__icon { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--mute); font-size: .95rem; pointer-events: none; }
.shp-search input {
    width: 100%; height: 44px; padding: 0 40px 0 42px;
    border: 1px solid var(--line); border-radius: 10px; background: var(--white);
    font: 400 .95rem var(--f-body); color: var(--ink);
    transition: border-color .15s, box-shadow .15s;
    -webkit-appearance: none; appearance: none;
}
.shp-search input::placeholder { color: var(--mute); }
.shp-search input:focus { outline: 0; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(22,21,26,.07); }
.shp-search input::-webkit-search-cancel-button { display: none; }
.shp-search__clear {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    width: 28px; height: 28px; border: 0; border-radius: 50%; background: transparent; color: var(--mute);
    display: grid; place-items: center; font-size: .78rem; cursor: pointer;
}
.shp-search__clear:hover { background: var(--tile); color: var(--ink); }

/* ---------- Botones ---------- */
.shp-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 40px; padding: 0 18px; border-radius: 10px; border: 1px solid var(--line);
    background: var(--white); color: var(--ink); font: 500 .88rem var(--f-body);
    cursor: pointer; transition: background .15s, border-color .15s, color .15s;
}
.shp-btn:hover { border-color: var(--ink); }
.shp-btn--solid { background: var(--ink); border-color: var(--ink); color: #fff; }
.shp-btn--solid:hover { background: #000; }
.shp-btn--ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.shp-btn--ghost:hover { border-color: transparent; color: var(--accent); }
.shp-btn:focus-visible, .shp-tab:focus-visible, .shp-chip:focus-visible, .shp-link:focus-visible,
.shp-quick__btn:focus-visible, .shp-pager a:focus-visible, .shp-pager button:focus-visible,
.shp-preset:focus-visible, .shp-search__clear:focus-visible, .shp-select:focus-visible {
    outline: 2px solid var(--accent); outline-offset: 2px;
}
.shp-link { background: none; border: 0; padding: 0; color: var(--ink-2); font: 500 .84rem var(--f-body); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line); }
.shp-link:hover { color: var(--accent); text-decoration-color: currentColor; }

/* ---------- Pestañas (juegos / categorías) ---------- */
.shp-tabs {
    display: flex; gap: 30px; overflow-x: auto; border-bottom: 1px solid var(--line);
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.shp-tabs::-webkit-scrollbar { display: none; }
.shp-tab {
    position: relative; flex: none; display: inline-flex; align-items: baseline; gap: 7px;
    padding: 13px 0 14px; background: none; border: 0; cursor: pointer; white-space: nowrap;
    font: 500 .96rem var(--f-body); color: var(--mute); transition: color .15s;
}
.shp-tab small { font-size: .76rem; font-weight: 400; color: var(--mute); font-variant-numeric: tabular-nums; }
.shp-tab i { font-size: .9rem; align-self: center; }
.shp-tab:hover { color: var(--ink); }
.shp-tab.is-active { color: var(--ink); font-weight: 600; }
.shp-tab.is-active::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--accent); }

/* ---------- Estructura: panel de filtros + resultados ---------- */
.shp-layout { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 52px; align-items: start; padding-top: 28px; }

.shp-side { position: sticky; top: 98px; max-height: calc(100vh - 118px); overflow-y: auto; padding-right: 4px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.shp-side__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 14px; }
.shp-side__title { font: 600 1.05rem var(--f-display); letter-spacing: -.01em; margin: 0; }
.shp-side__close, .shp-side__foot, .shp-backdrop { display: none; }

/* Grupos plegables (<details>) */
.shp-group { border-top: 1px solid var(--line); }
.shp-group > summary {
    list-style: none; display: flex; align-items: center; gap: 8px; padding: 15px 0;
    cursor: pointer; user-select: none; font: 600 .9rem var(--f-body); color: var(--ink);
}
.shp-group > summary::-webkit-details-marker { display: none; }
.shp-group > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.shp-group__name { flex: 1; }
.shp-group__n {
    min-width: 19px; height: 19px; padding: 0 6px; border-radius: 10px; background: var(--ink); color: #fff;
    font: 600 .68rem var(--f-body); display: inline-grid; place-items: center;
}
.shp-group > summary .bi { font-size: .72rem; color: var(--mute); transition: transform .2s; }
.shp-group[open] > summary .bi { transform: rotate(180deg); }
.shp-group__body { padding: 0 0 18px; }

/* Opciones con casilla */
.shp-opt { position: relative; display: flex; align-items: center; gap: 11px; padding: 6px 0; cursor: pointer; user-select: none; font-size: .9rem; color: var(--ink-2); }
.shp-opt:hover { color: var(--ink); }
.shp-opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.shp-opt__tick {
    flex: none; width: 17px; height: 17px; border: 1.5px solid #C6C1B5; border-radius: 5px; background: var(--white);
    display: grid; place-items: center; transition: background .12s, border-color .12s;
}
.shp-opt__tick::after {
    content: ''; width: 8px; height: 4px; margin-top: -1px; border-left: 2px solid #fff; border-bottom: 2px solid #fff;
    transform: rotate(-45deg); opacity: 0; transition: opacity .1s;
}
.shp-opt input:checked + .shp-opt__tick { background: var(--ink); border-color: var(--ink); }
.shp-opt input:checked + .shp-opt__tick::after { opacity: 1; }
.shp-opt input:focus-visible + .shp-opt__tick { outline: 2px solid var(--accent); outline-offset: 2px; }
.shp-opt input:checked ~ .shp-opt__label { color: var(--ink); font-weight: 500; }
.shp-opt__label { flex: 1; min-width: 0; display: flex; align-items: center; gap: 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shp-opt__n { font-size: .78rem; color: var(--mute); font-variant-numeric: tabular-nums; }
.shp-more { margin-top: 6px; }

/* Interruptor (sí / no) */
.shp-sw { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 0; cursor: pointer; user-select: none; font-size: .9rem; color: var(--ink-2); }
.shp-sw input { position: absolute; opacity: 0; width: 0; height: 0; }
.shp-sw__track { flex: none; width: 34px; height: 20px; border-radius: 999px; background: #D5D0C4; position: relative; transition: background .15s; }
.shp-sw__track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.shp-sw input:checked + .shp-sw__track { background: var(--ink); }
.shp-sw input:checked + .shp-sw__track::after { transform: translateX(14px); }
.shp-sw input:focus-visible + .shp-sw__track { outline: 2px solid var(--accent); outline-offset: 2px; }
.shp-sw:hover { color: var(--ink); }
.shp-sw--gold input:checked + .shp-sw__track { background: var(--gold); }

/* Precio */
.shp-range { display: flex; align-items: center; gap: 8px; }
.shp-range__dash { color: var(--mute); }
.shp-field { position: relative; flex: 1; min-width: 0; }
.shp-field span { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--mute); font-size: .86rem; pointer-events: none; }
.shp-field input {
    width: 100%; height: 38px; padding: 0 8px 0 24px; border: 1px solid var(--line); border-radius: 9px; background: var(--white);
    font: 400 .88rem var(--f-body); color: var(--ink); -moz-appearance: textfield;
}
.shp-field input::-webkit-outer-spin-button, .shp-field input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.shp-field input:focus { outline: 0; border-color: var(--ink); }
.shp-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.shp-preset {
    height: 28px; padding: 0 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--white);
    font: 400 .78rem var(--f-body); color: var(--ink-2); cursor: pointer; white-space: nowrap; transition: all .12s;
}
.shp-preset:hover { border-color: var(--ink); color: var(--ink); }
.shp-preset.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }

/* Select */
.shp-select {
    width: 100%; height: 40px; padding: 0 34px 0 12px; border: 1px solid var(--line); border-radius: 10px; background-color: var(--white);
    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.5l5 5 5-5' fill='none' stroke='%2386817A' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center;
    font: 400 .88rem var(--f-body); color: var(--ink); cursor: pointer; -webkit-appearance: none; appearance: none;
}
.shp-select:focus { outline: 0; border-color: var(--ink); }

/* ---------- Barra de resultados ---------- */
.shp-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px 18px; flex-wrap: wrap; margin-bottom: 16px; min-height: 40px; }
.shp-count { font-size: .9rem; color: var(--mute); }
.shp-count strong { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.shp-main { min-width: 0; }
.shp-bar__right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.shp-sort { width: auto; min-width: 190px; }
.shp-filter-btn { display: none; position: relative; }
.shp-filter-btn__n { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; font: 600 .68rem var(--f-body); display: inline-grid; place-items: center; }

.shp .tcgv-switch { background: transparent; border: 1px solid var(--line); border-radius: 10px; padding: 2px; gap: 0; }
.shp .tcgv-switch__btn { padding: 8px 10px; border-radius: 8px; color: var(--mute); }
.shp .tcgv-switch__btn span { display: none; }
.shp .tcgv-switch__btn i { font-size: 1.02rem; }
.shp .tcgv-switch__btn:hover { color: var(--ink); }
.shp .tcgv-switch__btn.is-active { background: var(--ink); color: #fff; box-shadow: none; }

/* Franja de ofertas: dice cuántas cartas hay en descuento y activa el filtro */
.shp-promo { display: flex; align-items: center; gap: 14px; margin: 0 0 20px; padding: 11px 14px 11px 12px; border: 1px solid #F1D5D0; border-radius: 12px; background: #FFF6F4; transition: background .15s, border-color .15s; }
.shp-promo__icon { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--accent); color: #fff; font-size: .95rem; }
.shp-promo__txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.shp-promo__txt strong { font: 600 .98rem var(--f-display); letter-spacing: -.01em; }
.shp-promo__txt span { font-size: .82rem; color: var(--ink-2); }
.shp-promo__fin { font-weight: 700; color: var(--accent); }
@media (max-width: 360px) { .shp-promo__cnt { display: none; } }
.shp-promo__btn { flex: none; height: 36px; padding: 0 16px; border-color: #E8BEB7; }
.shp-promo__btn:hover { border-color: var(--accent); color: var(--accent); }
.shp-promo.is-on { background: #FDECE9; border-color: var(--accent); }
.shp-promo.is-on .shp-promo__btn { background: var(--ink); border-color: var(--ink); color: #fff; }

/* Filtros aplicados */
.shp-applied { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 20px; }
.shp-chip {
    display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 6px 0 12px;
    border: 1px solid var(--line); border-radius: 999px; background: var(--white); color: var(--ink);
    font: 400 .82rem var(--f-body); cursor: pointer; transition: border-color .12s;
}
.shp-chip:hover { border-color: var(--ink); }
.shp-chip .tcgv-flag { margin-right: 2px; }
.shp-chip__x { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font-size: .68rem; color: var(--mute); transition: all .12s; }
.shp-chip:hover .shp-chip__x { background: var(--ink); color: #fff; }

/* ---------- Grilla ---------- */
.shp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 34px 20px; }
.shp-grid[data-view="gallery"] { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 46px 28px; }
.shp-grid[data-view="list"] { grid-template-columns: 1fr; gap: 0; border-top: 1px solid var(--line); }

.shp-item { position: relative; display: flex; flex-direction: column; min-width: 0; color: inherit; }
.shp-item__media {
    position: relative; display: grid; place-items: center; aspect-ratio: .74; padding: 11px;
    border-radius: 12px; background: var(--tile); overflow: hidden; transition: box-shadow .2s;
}
.shp-item--prod .shp-item__media { aspect-ratio: 1; padding: 16px; }
.shp-item:hover .shp-item__media { box-shadow: 0 14px 28px -18px rgba(22,21,26,.5); }
.shp-item__media.is-loading::before {
    content: ''; position: absolute; inset: 0; z-index: 1;
    background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.65) 50%, transparent 70%); background-size: 220% 100%;
    animation: shp-shimmer 1.3s ease-in-out infinite;
}
@keyframes shp-shimmer { from { background-position: 220% 0; } to { background-position: -220% 0; } }
.shp-item__img { position: relative; z-index: 2; width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity .35s ease, transform .35s cubic-bezier(.2,.7,.2,1); }
.shp-item__img.is-loaded, .shp-item--prod .shp-item__img { opacity: 1; }
.shp-item:hover .shp-item__img.is-loaded, .shp-item--prod:hover .shp-item__img { transform: scale(1.035); }
.shp-item.is-out .shp-item__img { opacity: .4; filter: grayscale(.7); }
/* Carta agotada: etiqueta + invitación a pedir el aviso (la tarjeta entera lleva a su página) */
.shp-out { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 10px; font-size: .78rem; }
.shp-out__tag { color: var(--mute); }
.shp-out__cta { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--white); color: var(--ink); font-weight: 500; transition: background .15s, color .15s, border-color .15s; }
.shp-item:hover .shp-out__cta { background: var(--ink); border-color: var(--ink); color: #fff; }
.shp-grid[data-view="list"] .shp-out { padding: 0; width: 150px; flex: none; justify-content: flex-end; }
.shp-grid[data-view="list"] .shp-out__tag { display: none; }

.shp-item--graded .shp-item__media { box-shadow: inset 0 0 0 1.5px var(--gold); }
.shp-item--graded:hover .shp-item__media { box-shadow: inset 0 0 0 1.5px var(--gold), 0 14px 28px -18px rgba(184,135,63,.7); }

/* Brillo que sigue al cursor en las cartas foil */
.shp-item--foil .shp-item__media::after {
    content: ''; position: absolute; inset: 0; z-index: 3; pointer-events: none; opacity: 0; transition: opacity .2s; mix-blend-mode: overlay;
    background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.6) 45%, rgba(184,135,63,.4) 50%, transparent 65%);
    background-size: 250% 250%; background-position: var(--mx, 50%) var(--my, 50%);
}
.shp-item--foil:hover .shp-item__media::after { opacity: 1; }

/* Etiquetas sobre la imagen */
.shp-pill {
    position: absolute; z-index: 4; display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 9px; border-radius: 999px;
    background: rgba(255,255,255,.94); color: var(--ink); font: 600 .68rem var(--f-body); white-space: nowrap; box-shadow: 0 1px 3px rgba(0,0,0,.14);
}
.shp-pill--tl { top: 9px; left: 9px; }
.shp-pill--tr { top: 9px; right: 9px; }
.shp-pill--bl { bottom: 9px; left: 9px; }
.shp-pill--dark { background: var(--ink); color: #fff; }
.shp-pill--gold { background: var(--ink); color: #E3B66C; box-shadow: inset 0 0 0 1px var(--gold); }
.shp-pill--warn { background: #FEF3C7; color: #92400E; }
.shp-pill--star { background: var(--gold-bg); color: #7A5320; }
.shp-pill--pre { background: #EDE9FE; color: #5B21B6; }
.shp-item__lang { position: absolute; z-index: 4; left: 9px; bottom: 9px; }

.shp-item__body { display: flex; flex-direction: column; flex: 1; gap: 2px; padding: 13px 2px 0; min-width: 0; }
.shp-item__info { min-width: 0; }
.shp-item__name {
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    font: 500 .93rem/1.3 var(--f-body); color: var(--ink);
}
a.shp-item__name:hover { color: var(--accent); }
.shp-item__sub { margin-top: 3px; font-size: .78rem; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shp-item__dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.shp-item__tags { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 6px; }
.shp-tag { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px; background: var(--line-2); color: var(--ink-2); font: 500 .68rem var(--f-body); letter-spacing: .02em; }
.shp-tag--foil { background: var(--gold-bg); color: #7A5320; text-transform: capitalize; }
.shp-tag--grade { background: var(--ink); color: #E3B66C; }
.shp-item__pre { margin-top: 4px; font-size: .76rem; color: #6D28D9; font-weight: 500; }
.shp-item__row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 8px; }
.shp-item__price { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; font: 600 1.06rem var(--f-display); letter-spacing: -.01em; font-variant-numeric: tabular-nums; color: var(--ink); }
.shp-price__line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 1px 7px; }

/* Descuento propio de la carta.
   En la foto: el porcentaje (lo que se ve al recorrer el catálogo). En el precio: el de venta en rojo, el normal tachado y cuánto se ahorra. */
.shp-off {
    position: absolute; z-index: 4; right: 9px; bottom: 9px; display: inline-flex; align-items: center; gap: 5px;
    height: 26px; padding: 0 10px 0 8px; border-radius: 7px; background: var(--accent); color: #fff;
    font: 700 .84rem var(--f-display); letter-spacing: -.01em; font-variant-numeric: tabular-nums; white-space: nowrap;
    box-shadow: 0 3px 10px -3px rgba(158,0,0,.6);
}
.shp-off i { font-size: .7rem; opacity: .9; }
.shp-item__price.is-sale .shp-price__now { color: var(--accent); }
.shp-item__old { font: 500 .78rem var(--f-body); color: var(--mute); text-decoration: line-through; letter-spacing: 0; }
.shp-item__save { margin-top: 1px; font: 500 .75rem var(--f-body); letter-spacing: 0; color: var(--ok); }
/* Porcentaje en línea con el precio: solo en la vista Lista (en las otras va sobre la foto) */
.shp-sale { align-self: center; padding: 2px 8px; border-radius: 6px; background: var(--accent); color: #fff; font: 700 .74rem var(--f-display); letter-spacing: 0; }
.shp-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.shp-item__stock { font-size: .76rem; color: var(--mute); }
.shp-item__stock--low { color: var(--warn); }
.shp-item__list-only { display: none; }
.shp-grid[data-view="list"] .shp-item__grid-only { display: none; }

/* Botón de agregar (y selector de cantidad) */
.shp-quick { padding-top: 12px; }
.shp-quick__btn {
    width: 100%; height: 38px; display: flex; align-items: center; justify-content: center; gap: 7px;
    border: 1px solid var(--line); border-radius: 10px; background: var(--white); color: var(--ink);
    font: 500 .84rem var(--f-body); cursor: pointer; transition: background .15s, border-color .15s, color .15s;
}
.shp-quick__btn:hover:not(:disabled) { background: var(--ink); border-color: var(--ink); color: #fff; }
.shp-quick__btn:disabled { background: var(--tile); color: var(--mute); border-color: transparent; cursor: not-allowed; }
.shp-quick__btn.is-added { border-color: var(--ok); background: #ECFDF5; color: var(--ok); }
.shp-quick__stepper { display: none; align-items: stretch; height: 38px; border: 1px solid var(--ink); border-radius: 10px; overflow: hidden; background: var(--white); }
.shp-quick.is-open .shp-quick__btn { display: none; }
.shp-quick.is-open .shp-quick__stepper { display: flex; }
.shp-quick__step { width: 34px; flex: none; border: 0; background: var(--white); color: var(--ink); font-size: 1.05rem; cursor: pointer; display: grid; place-items: center; }
.shp-quick__step:hover:not(:disabled) { background: var(--tile); }
.shp-quick__step:disabled { opacity: .3; cursor: not-allowed; }
.shp-quick__qty { flex: 1; display: grid; place-items: center; font: 600 .9rem var(--f-display); font-variant-numeric: tabular-nums; min-width: 0; }
.shp-quick__ok { width: 40px; flex: none; border: 0; background: var(--accent); color: #fff; font-size: 1rem; cursor: pointer; display: grid; place-items: center; }
.shp-quick__ok:hover { background: var(--accent-dk); }
.shp-quick--maxed .shp-quick__btn { background: var(--tile); color: var(--mute); border-color: transparent; cursor: default; }

/* ---------- Vista Galería: carta grande, casi sin texto ---------- */
.shp-grid[data-view="gallery"] .shp-item__media { border-radius: 16px; padding: 16px; }
.shp-grid[data-view="gallery"] .shp-item--prod .shp-item__media { padding: 24px; }
.shp-grid[data-view="gallery"] .shp-item__sub,
.shp-grid[data-view="gallery"] .shp-item__tags,
.shp-grid[data-view="gallery"] .shp-item__pre { display: none; }
.shp-grid[data-view="gallery"] .shp-item__name { min-height: 0; -webkit-line-clamp: 1; font-size: 1.04rem; }
.shp-grid[data-view="gallery"] .shp-item__price { font-size: 1.3rem; }
.shp-grid[data-view="gallery"] .shp-off { right: 12px; bottom: 12px; height: 31px; padding: 0 12px 0 10px; border-radius: 8px; font-size: 1rem; }
.shp-grid[data-view="gallery"] .shp-item__old { font-size: .88rem; }
.shp-grid[data-view="gallery"] .shp-item__save { font-size: .82rem; }
.shp-grid[data-view="gallery"] .shp-quick__btn, .shp-grid[data-view="gallery"] .shp-quick__stepper { height: 42px; }
.shp-grid[data-view="gallery"] .shp-pill { height: 25px; font-size: .74rem; padding: 0 11px; }

/* ---------- Vista Lista: una fila por artículo, para comparar ---------- */
.shp-grid[data-view="list"] .shp-item { flex-direction: row; align-items: center; gap: 20px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.shp-grid[data-view="list"] .shp-item:hover { background: rgba(22,21,26,.025); }
.shp-grid[data-view="list"] .shp-item__media { width: 58px; flex: none; aspect-ratio: .74; padding: 3px; border-radius: 6px; box-shadow: none !important; }
.shp-grid[data-view="list"] .shp-item--prod .shp-item__media { aspect-ratio: 1; padding: 5px; }
.shp-grid[data-view="list"] .shp-item:hover .shp-item__img { transform: none; }
.shp-grid[data-view="list"] .shp-pill,
.shp-grid[data-view="list"] .shp-item__lang { display: none; }
.shp-grid[data-view="list"] .shp-item__body { flex-direction: row; align-items: center; gap: 24px; padding: 0; flex: 1; min-width: 0; }
.shp-grid[data-view="list"] .shp-item__info { flex: 1; }
.shp-grid[data-view="list"] .shp-item__name { min-height: 0; -webkit-line-clamp: 1; font-size: .96rem; }
.shp-grid[data-view="list"] .shp-item__tags { margin-top: 5px; }
.shp-grid[data-view="list"] .shp-item__list-only { display: inline-flex; }
.shp-grid[data-view="list"] .shp-item__stock.shp-item__list-only { display: block; min-width: 92px; text-align: right; }
.shp-grid[data-view="list"] .shp-item__row { margin: 0; padding: 0; min-width: 210px; justify-content: flex-end; }
.shp-grid[data-view="list"] .shp-off { display: none; }
.shp-grid[data-view="list"] .shp-item__price { align-items: flex-end; text-align: right; }
.shp-grid[data-view="list"] .shp-price__line { justify-content: flex-end; }
.shp-grid[data-view="list"] .shp-sale { display: inline-block; }
.shp-grid[data-view="list"] .shp-quick { padding: 0; width: 150px; flex: none; }

/* ---------- Estados ---------- */
.shp-skel__img { aspect-ratio: .74; border-radius: 12px; background: var(--tile); position: relative; overflow: hidden; }
.shp-skel__img::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.7) 50%, transparent 70%); background-size: 220% 100%; animation: shp-shimmer 1.3s ease-in-out infinite; }
.shp-skel__line { height: 11px; border-radius: 6px; background: var(--tile); margin-top: 12px; width: 82%; }
.shp-skel__line + .shp-skel__line { width: 48%; margin-top: 8px; }
.shp-grid[data-view="list"] .shp-skel { display: flex; align-items: center; gap: 18px; padding: 14px 4px; border-bottom: 1px solid var(--line); }
.shp-grid[data-view="list"] .shp-skel__img { width: 58px; flex: none; }
.shp-grid[data-view="list"] .shp-skel__body { flex: 1; }
.shp-grid[data-view="list"] .shp-skel__line { margin-top: 8px; }

.shp-empty { grid-column: 1 / -1; text-align: center; padding: 72px 20px; color: var(--mute); }
.shp-empty .bi { display: block; font-size: 2.2rem; margin-bottom: 14px; opacity: .45; }
.shp-empty strong { display: block; color: var(--ink); font: 600 1.1rem var(--f-display); margin-bottom: 6px; }
.shp-empty p { margin: 0 0 20px; font-size: .92rem; }
.shp-error { grid-column: 1 / -1; padding: 16px 18px; border: 1px solid #F3C7C7; border-radius: 10px; background: #FEF3F3; color: #991B1B; font-size: .9rem; }

/* ---------- Paginación ---------- */
.shp-pager { display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; margin-top: 52px; }
.shp-pager a, .shp-pager button, .shp-pager span {
    min-width: 40px; height: 40px; padding: 0 10px; display: inline-grid; place-items: center; border: 0; border-radius: 10px;
    background: transparent; color: var(--ink-2); font: 500 .9rem var(--f-body); font-variant-numeric: tabular-nums; cursor: pointer; transition: background .12s;
}
.shp-pager a:hover, .shp-pager button:hover { background: var(--tile); color: var(--ink); }
.shp-pager .is-current { background: var(--ink); color: #fff; cursor: default; }
.shp-pager .is-gap { cursor: default; color: var(--mute); }

/* ---------- Aviso al agregar al carrito ---------- */
/* (se agrega al <body>, fuera de .shp: por eso las variables llevan valor de respaldo) */
.shp-toast {
    position: fixed; left: 50%; bottom: 26px; z-index: 9999; transform: translate(-50%, 18px); max-width: 90vw;
    padding: 12px 20px; border-radius: 12px; background: var(--ink, #16151A); color: #fff; font: 500 .9rem var(--f-body, 'IBM Plex Sans', -apple-system, 'Segoe UI', sans-serif);
    box-shadow: 0 14px 34px -10px rgba(0,0,0,.45); opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
}
.shp-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.shp-toast--warn { box-shadow: inset 3px 0 0 #F59E0B, 0 14px 34px -10px rgba(0,0,0,.45); }
.shp-toast--error { background: #991B1B; }
.shp-mini-spin { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: shp-spin .6s linear infinite; }
@keyframes shp-spin { to { transform: rotate(360deg); } }

/* ---------- Escritorio angosto y tablet ---------- */
@media (max-width: 1180px) {
    .shp-layout { gap: 36px; }
    .shp-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 30px 16px; }
}

/* ---------- Celular y tablet: los filtros pasan a una hoja inferior ---------- */
@media (max-width: 959px) {
    .shp-wrap { padding-top: 30px; }
    .shp-layout { grid-template-columns: minmax(0, 1fr); gap: 0; padding-top: 20px; }
    .shp-filter-btn { display: inline-flex; }

    body.shp-drawer-open { overflow: hidden; }
    .shp-side {
        position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 1210; max-height: 88vh; padding: 0;
        display: flex; flex-direction: column; background: #fff; border-radius: 20px 20px 0 0;
        box-shadow: 0 -24px 60px -10px rgba(0,0,0,.35);
        transform: translateY(104%); visibility: hidden; transition: transform .28s cubic-bezier(.2,.8,.2,1), visibility 0s .28s;
    }
    body.shp-drawer-open .shp-side { transform: none; visibility: visible; transition: transform .28s cubic-bezier(.2,.8,.2,1), visibility 0s; }
    .shp-side__head { padding: 18px 20px 14px; border-bottom: 1px solid var(--line); flex: none; }
    .shp-side__close { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--tile); color: var(--ink); font-size: .95rem; cursor: pointer; }
    .shp-side__scroll { flex: 1; overflow-y: auto; padding: 0 20px; overscroll-behavior: contain; }
    .shp-group:first-child { border-top: 0; }
    .shp-side__foot { display: block; flex: none; padding: 14px 20px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #fff; }
    .shp-side__foot .shp-btn { width: 100%; height: 46px; }
    .shp-backdrop {
        display: block; position: fixed; inset: 0; z-index: 1200; background: rgba(15,15,18,.52);
        opacity: 0; pointer-events: none; transition: opacity .25s;
    }
    body.shp-drawer-open .shp-backdrop { opacity: 1; pointer-events: auto; }
    .shp-opt, .shp-sw { padding: 9px 0; }
}

@media (max-width: 640px) {
    .shp-wrap { padding: 24px 16px 0; }
    .shp-head { margin-bottom: 22px; }
    .shp-head__right { flex-basis: 100%; justify-content: stretch; }
    .shp-search { max-width: none; }
    .shp-tabs { gap: 24px; margin: 0 -16px; padding: 0 16px; }
    .shp-count { flex-basis: 100%; order: -1; }
    .shp-bar { gap: 10px; }
    .shp-bar__right { flex: 1; justify-content: flex-end; }
    .shp-sort { min-width: 0; width: auto; flex: 1 1 0; max-width: 220px; text-overflow: ellipsis; }
    .shp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 12px; }
    .shp-grid[data-view="gallery"] { grid-template-columns: 1fr; gap: 36px; }
    .shp-item__media { padding: 8px; }
    .shp-pill--star .shp-pill__txt { display: none; }   /* en tarjetas angostas el destacado queda solo con la estrella */
    .shp-pill--star { padding: 0 8px; }
    .shp-item__name { font-size: .88rem; }
    .shp-item__price { font-size: 1rem; }
    .shp-off { right: 7px; bottom: 7px; height: 24px; padding: 0 8px 0 7px; font-size: .78rem; }
    .shp-promo { gap: 10px; padding: 10px 10px 10px 12px; }
    .shp-promo__btn { padding: 0 14px; }
    .shp-grid[data-view="list"] .shp-item { flex-wrap: wrap; gap: 10px 14px; }
    .shp-grid[data-view="list"] .shp-item__body { flex-wrap: wrap; gap: 6px 12px; flex: 1 1 0; }
    .shp-grid[data-view="list"] .shp-item__info { flex: 1 1 100%; }
    .shp-grid[data-view="list"] .shp-item__row { justify-content: flex-start; min-width: 0; }
    .shp-grid[data-view="list"] .shp-item__price { align-items: flex-start; text-align: left; }
    .shp-grid[data-view="list"] .shp-price__line { justify-content: flex-start; }
    .shp-grid[data-view="list"] .shp-item__stock.shp-item__list-only { text-align: left; min-width: 0; }
    .shp-grid[data-view="list"] .shp-quick { width: 100%; }
    .shp-pager { margin-top: 38px; }
}

@media (prefers-reduced-motion: reduce) {
    .shp-item__media.is-loading::before, .shp-skel__img::after { animation: none; }
    .shp-item__img, .shp-side, .shp-backdrop, .shp-toast { transition: none; }
    .shp-item:hover .shp-item__img.is-loaded, .shp-item--prod:hover .shp-item__img { transform: none; }
}
