/* =====================================================================
   Moda Sin Género — Base
   ===================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
}

body {
    margin: 0;
    font-family: var(--font-sans);
    font-weight: var(--fw-regular);
    font-size: var(--fs-base);
    line-height: var(--lh-normal);
    color: var(--text);
    background: var(--bg);
    min-height: 100dvh;
    overflow-x: hidden;
    transition: background var(--t-base), color var(--t-base);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-sans);
    font-weight: var(--fw-bold);
    line-height: var(--lh-tight);
    color: var(--text);
    margin: 0 0 var(--sp-3);
}

h1 { font-size: var(--fs-3xl); letter-spacing: -.02em; }
h2 { font-size: var(--fs-2xl); letter-spacing: -.015em; }
h3 { font-size: var(--fs-xl); letter-spacing: -.01em; }
h4 { font-size: var(--fs-md); font-weight: var(--fw-semibold); }

p { margin: 0 0 var(--sp-4); }
a { color: var(--accent); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--accent-hover); }

img, svg, video { display: block; max-width: 100%; height: auto; }
button { font-family: inherit; }

/* ---- Contenedor ---- */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding-inline: var(--sp-4);
}

/* =====================================================================
   APP SHELL — estructura tipo aplicación nativa
   ===================================================================== */

.app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: var(--z-header);
    height: calc(var(--header-h) + var(--safe-top));
    padding-top: var(--safe-top);
    display: flex;
    align-items: center;
    background: color-mix(in oklab, var(--bg-elev) 88%, transparent);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--border);
}

.app-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding-inline: var(--sp-4);
    gap: var(--sp-3);
}

.app-header__brand {
    font-weight: var(--fw-bold);
    font-size: var(--fs-md);
    letter-spacing: -.01em;
    color: var(--text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: var(--sp-2);
}

.app-header__actions {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
}

.app-main {
    flex: 1;
    padding-block: var(--sp-5) calc(var(--bottom-nav-h) + var(--safe-bottom) + var(--sp-6));
}

/* Bottom navigation — patrón app móvil */
/* =====================================================================
   BOTTOM NAV — app-style con círculo activo
   ===================================================================== */
.app-bottomnav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: var(--z-bottomnav);
    height: calc(var(--bottom-nav-h) + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    display: flex;
    align-items: stretch;
    background: color-mix(in oklab, var(--bg-elev) 78%, var(--accent) 14%);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-top: 1px solid color-mix(in oklab, var(--border) 60%, var(--accent) 40%);
    box-shadow: 0 -8px 24px color-mix(in oklab, var(--accent) 8%, transparent);
}

.app-bottomnav__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--text-subtle);
    text-decoration: none;
    transition: color var(--t-base);
    -webkit-tap-highlight-color: transparent;
    position: relative;
    padding: 6px 4px 8px;
    background: transparent;
    border: 0;
    cursor: pointer;
    font-family: inherit;
}

.app-bottomnav__icon {
    position: relative;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: var(--r-full);
    font-size: 20px;
    line-height: 1;
    color: inherit;
    transition:
        background var(--t-base),
        color var(--t-base),
        transform var(--t-base),
        box-shadow var(--t-base);
}

/* Hover elegante — solo donde hay cursor */
@media (hover: hover) {
    .app-bottomnav__item:hover .app-bottomnav__icon {
        background: color-mix(in oklab, var(--accent) 14%, transparent);
        color: var(--accent);
        transform: translateY(-1px);
    }
}

/* Active — círculo relleno con elevación sutil */
.app-bottomnav__item.is-active .app-bottomnav__icon {
    background: var(--accent);
    color: var(--accent-contrast);
    transform: translateY(-3px);
    box-shadow: 0 8px 18px color-mix(in oklab, var(--accent) 45%, transparent);
}

/* Punto indicador debajo del círculo */
.app-bottomnav__item.is-active::after {
    content: "";
    position: absolute;
    bottom: 4px;
    width: 5px;
    height: 5px;
    border-radius: var(--r-full);
    background: var(--accent);
    animation: bottomnav-dot 200ms cubic-bezier(.2,.7,.3,1);
}

@keyframes bottomnav-dot {
    from { transform: scale(0); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

.app-bottomnav__label {
    font-size: 10px;
    font-weight: var(--fw-medium);
    letter-spacing: .02em;
    transition: color var(--t-base), font-weight var(--t-base);
}

.app-bottomnav__item.is-active .app-bottomnav__label {
    color: var(--accent);
    font-weight: var(--fw-semibold);
}

/* Reducir animaciones si el usuario las evita */
@media (prefers-reduced-motion: reduce) {
    .app-bottomnav__icon,
    .app-bottomnav__item.is-active::after { transition: none; animation: none; }
}

/* =====================================================================
   COMPONENTES
   ===================================================================== */

/* Botones */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    min-height: 44px;
    padding: 10px var(--sp-5);
    font-family: inherit;
    font-size: var(--fs-base);
    font-weight: var(--fw-medium);
    line-height: 1;
    border-radius: var(--r-full);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.btn:active { transform: scale(.97); }
.btn:focus-visible { outline: 2px solid var(--accent-ring); outline-offset: 2px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn--primary {
    background: var(--accent);
    color: var(--accent-contrast);
}
.btn--primary:hover { background: var(--accent-hover); color: var(--accent-contrast); }

.btn--ghost {
    background: transparent;
    color: var(--text);
    border-color: var(--border-strong);
}
.btn--ghost:hover { background: var(--surface-2); }

.btn--soft {
    background: var(--accent-soft);
    color: var(--accent);
}
.btn--soft:hover { background: color-mix(in oklab, var(--accent-soft) 88%, var(--accent)); }

.btn--icon {
    width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    border-radius: var(--r-full);
}

/* Tarjetas */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: var(--sp-5);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--t-base), border-color var(--t-base);
}

/* Inputs */
.field {
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
    margin-bottom: var(--sp-4);
}
.field label {
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    color: var(--text-muted);
}
.field input,
.field select,
.field textarea {
    font-family: inherit;
    font-size: var(--fs-base);
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-md);
    padding: 12px var(--sp-4);
    min-height: 48px;
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: 0;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Swatches — selector de acento */
.swatches {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: var(--sp-3);
}

.swatch {
    aspect-ratio: 1;
    border-radius: var(--r-md);
    border: 2px solid var(--border);
    cursor: pointer;
    position: relative;
    transition: transform var(--t-fast), border-color var(--t-fast);
    -webkit-tap-highlight-color: transparent;
    padding: 0;
}
.swatch:hover { transform: translateY(-2px); }
.swatch[aria-pressed="true"] {
    border-color: var(--text);
    box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--text);
}
.swatch::after {
    content: attr(data-label);
    position: absolute;
    left: 50%;
    bottom: -20px;
    transform: translateX(-50%);
    font-size: 10px;
    color: var(--text-subtle);
    white-space: nowrap;
    font-weight: var(--fw-medium);
}

/* Segment control — para Light/Dark/System */
.segment {
    display: inline-flex;
    background: var(--surface-2);
    border-radius: var(--r-full);
    padding: 4px;
    gap: 2px;
    border: 1px solid var(--border);
}
.segment button {
    border: 0;
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-weight: var(--fw-medium);
    font-size: var(--fs-sm);
    padding: 8px var(--sp-4);
    border-radius: var(--r-full);
    cursor: pointer;
    transition: background var(--t-fast), color var(--t-fast);
    -webkit-tap-highlight-color: transparent;
}
.segment button[aria-pressed="true"] {
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-sm);
}

/* Toast */
.toast {
    position: fixed;
    left: 50%;
    bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + var(--sp-4));
    transform: translateX(-50%) translateY(20px);
    background: var(--text);
    color: var(--bg);
    padding: 12px var(--sp-5);
    border-radius: var(--r-full);
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    opacity: 0;
    pointer-events: none;
    z-index: var(--z-toast);
    transition: opacity var(--t-base), transform var(--t-base);
    box-shadow: var(--shadow-lg);
}
.toast.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Utilidades */
.stack > * + * { margin-top: var(--sp-4); }
.grid-gap { display: grid; gap: var(--sp-4); }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.mt-6 { margin-top: var(--sp-6); }
.mb-4 { margin-bottom: var(--sp-4); }


.auth-page {
    max-width: 420px;
    margin-inline: auto;
    padding-top: var(--sp-4);
}
.auth-page__head {
    text-align: center;
    margin-bottom: var(--sp-6);
}
.auth-page__head h1 {
    font-size: var(--fs-2xl);
    margin-bottom: var(--sp-2);
}
.auth-form { padding: var(--sp-6); }
.btn--block { width: 100%; margin-top: var(--sp-2); }
.form-error {
    background: color-mix(in oklab, #b23434 12%, var(--surface));
    color: #b23434;
    padding: var(--sp-3) var(--sp-4);
    border-radius: var(--r-md);
    font-size: var(--fs-sm);
    margin-bottom: var(--sp-4);
    border: 1px solid color-mix(in oklab, #b23434 30%, transparent);
}
.form-error ul { margin: 0; padding-left: var(--sp-5); }


/* =====================================================================
   HEADER tintado (ya no blanco)
   ===================================================================== */
.app-header {
    background: color-mix(in oklab, var(--bg-elev) 82%, var(--accent) 8%);
    backdrop-filter: saturate(180%) blur(16px);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    border-bottom: 1px solid var(--border);
}

/* =====================================================================
   HERO — bloque sólido con motivo cultural
   ===================================================================== */
.hero {
    position: relative;
    overflow: hidden;
    border-radius: var(--r-xl);
    padding: var(--sp-8) var(--sp-6);
    color: var(--accent-contrast);
    background:
        linear-gradient(135deg,
            var(--accent) 0%,
            color-mix(in oklab, var(--accent) 65%, var(--accent-2)) 100%);
    isolation: isolate;
    margin-bottom: var(--sp-6);
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-color: var(--accent-contrast);
    -webkit-mask-image: var(--pattern-mask);
            mask-image: var(--pattern-mask);
    -webkit-mask-size: var(--pattern-size);
            mask-size: var(--pattern-size);
    -webkit-mask-repeat: repeat;
            mask-repeat: repeat;
    opacity: .10;
    z-index: -1;
    pointer-events: none;
}

.hero h1, .hero h2, .hero h3 { color: inherit; }
.hero p { color: color-mix(in oklab, var(--accent-contrast) 85%, transparent); }

.hero--secondary {
    background: linear-gradient(135deg, var(--accent-2) 0%, var(--accent-3) 100%);
}

/* =====================================================================
   BLOQUE SÓLIDO — franja decorativa
   ===================================================================== */
.block-accent {
    position: relative;
    background: var(--accent);
    color: var(--accent-contrast);
    padding: var(--sp-5) var(--sp-5);
    border-radius: var(--r-lg);
    overflow: hidden;
    isolation: isolate;
}
.block-accent::before {
    content: "";
    position: absolute;
    inset: 0;
    background-color: var(--accent-contrast);
    -webkit-mask-image: var(--pattern-mask);
            mask-image: var(--pattern-mask);
    -webkit-mask-size: var(--pattern-size);
            mask-size: var(--pattern-size);
    opacity: .08;
    z-index: -1;
    pointer-events: none;
}
.block-accent--2 { background: var(--accent-2); }
.block-accent--3 { background: var(--accent-3); }

/* Chip / etiqueta sobre bloque */
.chip {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    padding: 4px var(--sp-3);
    font-size: var(--fs-xs);
    font-weight: var(--fw-medium);
    border-radius: var(--r-full);
    background: color-mix(in oklab, var(--accent-contrast) 18%, transparent);
    color: inherit;
}

/* =====================================================================
   TARJETA con tinte cultural (opcional, para uso selectivo)
   ===================================================================== */
.card--tinted {
    background: linear-gradient(180deg,
        color-mix(in oklab, var(--surface) 88%, var(--accent-2-soft) 12%) 0%,
        var(--surface) 100%);
    border-color: color-mix(in oklab, var(--border) 70%, var(--accent) 20%);
}

/* =====================================================================
   DIVISOR con motivo
   ===================================================================== */
.divider-culture {
    height: 6px;
    margin-block: var(--sp-6);
    border-radius: var(--r-full);
    background-color: var(--accent);
    -webkit-mask-image: var(--pattern-mask);
            mask-image: var(--pattern-mask);
    -webkit-mask-size: var(--pattern-size);
            mask-size: var(--pattern-size);
    -webkit-mask-repeat: repeat-x;
            mask-repeat: repeat-x;
    opacity: .55;
}

/* =====================================================================
   BOTTOM NAV tintado
   ===================================================================== */
.app-bottomnav {
    background: color-mix(in oklab, var(--bg-elev) 82%, var(--accent) 6%);
    backdrop-filter: saturate(180%) blur(18px);
    -webkit-backdrop-filter: saturate(180%) blur(18px);
    border-top: 1px solid var(--border);
}

/* =====================================================================
   SWATCH — más grande, con nombre visible
   ===================================================================== */
.swatches {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
    gap: var(--sp-3);
}
.swatch {
    aspect-ratio: 1;
    border-radius: var(--r-md);
    border: 2px solid var(--border);
    cursor: pointer;
    position: relative;
    transition: transform var(--t-fast), border-color var(--t-fast);
    -webkit-tap-highlight-color: transparent;
    padding: 0;
}
.swatch[aria-pressed="true"] {
    border-color: var(--text);
    box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--text);
    transform: scale(1.04);
}
.swatch__name {
    position: absolute;
    inset: auto 0 0 0;
    font-size: 10px;
    font-weight: var(--fw-medium);
    color: #fff;
    background: linear-gradient(0deg, rgba(0,0,0,.55) 0%, transparent 100%);
    padding: 12px 4px 5px;
    border-radius: 0 0 calc(var(--r-md) - 2px) calc(var(--r-md) - 2px);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.1;
}


.form-success {
    background: color-mix(in oklab, var(--accent) 12%, var(--surface));
    color: var(--accent);
    padding: var(--sp-3) var(--sp-4);
    border-radius: var(--r-md);
    font-size: var(--fs-sm);
    margin-bottom: var(--sp-4);
    border: 1px solid color-mix(in oklab, var(--accent) 30%, transparent);
}


/* =====================================================================
   PRODUCT GRID — cards sólidas con borde tenue
   ===================================================================== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--sp-3);
    margin-top: var(--sp-4);
}
@media (min-width: 540px) {
    .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-4); }
}
@media (min-width: 900px) {
    .product-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-5); }
}

.product-card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
    transition:
        transform var(--t-base),
        box-shadow var(--t-base),
        border-color var(--t-base);
    position: relative;
    isolation: isolate;
}

.product-card:hover {
    transform: translateY(-4px);
    border-color: color-mix(in oklab, var(--border) 40%, var(--accent) 60%);
    box-shadow:
        0 1px 2px color-mix(in oklab, var(--text) 6%, transparent),
        0 12px 32px color-mix(in oklab, var(--accent) 14%, transparent),
        0 24px 48px color-mix(in oklab, var(--text) 8%, transparent);
}

.product-card.is-out { opacity: .78; }
.product-card.is-out:hover { transform: none; box-shadow: none; }

.product-card__link {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    flex: 1;
}

.product-card__media {
    position: relative;
    aspect-ratio: 4 / 5;
    background: var(--surface-2);
    overflow: hidden;
    border-bottom: 1px solid var(--border);
}

.product-card__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity var(--t-slow), transform var(--t-slow);
}
.product-card__img--hover { opacity: 0; }
.product-card:hover .product-card__img--hover { opacity: 1; }
.product-card:hover .product-card__img--primary { transform: scale(1.04); }

.product-card__placeholder {
    display: grid;
    place-items: center;
    width: 100%; height: 100%;
    font-size: 44px;
    color: var(--text-subtle);
    background:
        radial-gradient(circle at 30% 30%,
            color-mix(in oklab, var(--accent) 14%, var(--surface-2)) 0%,
            var(--surface-3) 100%);
}

.product-card__badge {
    position: absolute;
    top: var(--sp-3);
    left: var(--sp-3);
    padding: 5px 10px;
    font-size: 10px;
    font-weight: var(--fw-semibold);
    text-transform: uppercase;
    letter-spacing: .06em;
    border-radius: var(--r-full);
    z-index: 2;
}
.product-card__badge--sale { background: var(--accent); color: var(--accent-contrast); }
.product-card__badge--out  { background: var(--text); color: var(--bg); }

.product-card__star {
    position: absolute;
    top: var(--sp-3);
    right: var(--sp-3);
    width: 26px; height: 26px;
    display: grid; place-items: center;
    font-size: 12px;
    border-radius: var(--r-full);
    background: color-mix(in oklab, var(--bg-elev) 82%, transparent);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--accent);
    z-index: 2;
}

.product-card__body {
    padding: var(--sp-3);
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
}

.product-card__cat {
    font-size: 10px;
    font-weight: var(--fw-medium);
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-subtle);
}

.product-card__title {
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    line-height: 1.28;
    color: var(--text);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card__price {
    margin-top: auto;
    padding-top: var(--sp-2);
    display: flex;
    gap: var(--sp-2);
    align-items: baseline;
    flex-wrap: wrap;
}
.product-card__price-now {
    font-size: var(--fs-base);
    font-weight: var(--fw-bold);
    color: var(--text);
}
.product-card__price-was {
    color: var(--text-subtle);
    font-weight: var(--fw-regular);
    font-size: var(--fs-xs);
}

/* Botón "Añadir" dentro de la card */
.product-card__add {
    margin: 0 var(--sp-3) var(--sp-3);
    min-height: 38px;
    padding: 8px 12px;
    border-radius: var(--r-full);
    border: 0;
    background: var(--accent-soft);
    color: var(--accent);
    font-family: inherit;
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
    letter-spacing: .02em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition:
        background var(--t-fast),
        color var(--t-fast),
        transform var(--t-fast);
    -webkit-tap-highlight-color: transparent;
}
.product-card__add:hover:not(:disabled) {
    background: var(--accent);
    color: var(--accent-contrast);
    transform: scale(1.02);
}
.product-card__add:active:not(:disabled) { transform: scale(.97); }
.product-card__add--disabled {
    background: var(--surface-2);
    color: var(--text-subtle);
    cursor: not-allowed;
}

/* =====================================================================
   CATEGORÍAS — pills horizontales
   ===================================================================== */
.cat-row {
    display: flex; gap: var(--sp-2);
    overflow-x: auto;
    padding-bottom: var(--sp-2);
    scrollbar-width: none;
}
.cat-row::-webkit-scrollbar { display: none; }
.cat-pill {
    flex-shrink: 0;
    padding: 10px var(--sp-5);
    border-radius: var(--r-full);
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    text-decoration: none;
    transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.cat-pill:hover, .cat-pill.is-active {
    background: var(--accent); color: var(--accent-contrast); border-color: var(--accent);
}

/* =====================================================================
   FILTROS
   ===================================================================== */
.filters {
    display: flex; flex-direction: column; gap: var(--sp-3);
    margin-block: var(--sp-5);
    padding: var(--sp-4);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
}
.filters__row { display: flex; gap: var(--sp-2); flex-wrap: wrap; align-items: center; }
.filters__search {
    flex: 1; min-width: 160px;
    padding: 10px var(--sp-4);
    border-radius: var(--r-md);
    border: 1px solid var(--border-strong);
    background: var(--surface-2);
    color: var(--text);
    font-family: inherit;
    font-size: var(--fs-sm);
    min-height: 44px;
}
.filters select {
    padding: 10px var(--sp-3);
    border-radius: var(--r-md);
    border: 1px solid var(--border-strong);
    background: var(--surface-2);
    color: var(--text);
    font-family: inherit;
    font-size: var(--fs-sm);
    min-height: 44px;
}
.filters__tags { display: flex; gap: var(--sp-2); overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.filters__tags::-webkit-scrollbar { display: none; }
.tag-pill {
    flex-shrink: 0;
    padding: 6px var(--sp-4);
    border-radius: var(--r-full);
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: var(--fs-xs);
    font-weight: var(--fw-medium);
    text-decoration: none;
    transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.tag-pill:hover, .tag-pill.is-active {
    background: var(--accent-soft);
    color: var(--accent);
    border-color: color-mix(in oklab, var(--accent) 40%, transparent);
}
.tag-pill--static { cursor: default; }
.filter-check {
    display: inline-flex; align-items: center; gap: var(--sp-2);
    font-size: var(--fs-sm); color: var(--text-muted);
    cursor: pointer;
}

/* =====================================================================
   PAGINACIÓN
   ===================================================================== */
.pagination {
    display: flex; justify-content: space-between; align-items: center;
    gap: var(--sp-3); margin-top: var(--sp-8);
    flex-wrap: wrap;
}
.pagination span { font-size: var(--fs-sm); }

/* =====================================================================
   BREADCRUMB
   ===================================================================== */
.breadcrumb {
    display: flex; gap: var(--sp-2); align-items: center;
    font-size: var(--fs-xs);
    color: var(--text-subtle);
    margin-block: var(--sp-3) var(--sp-5);
    flex-wrap: wrap;
}
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }

/* =====================================================================
   PRODUCT DETAIL
   ===================================================================== */
/* =====================================================================
   PDP — Product Detail Page
   ===================================================================== */
.pdp {
    display: grid;
    gap: var(--sp-5);
    margin-bottom: var(--sp-10);
}
@media (min-width: 900px) {
    .pdp {
        grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
        gap: var(--sp-8);
        align-items: start;
    }
}

/* Galería */
.pdp__gallery {
    display: grid;
    gap: var(--sp-3);
}
@media (min-width: 640px) and (max-width: 899px) {
    .pdp__gallery { grid-template-columns: 72px 1fr; align-items: start; }
}
@media (min-width: 900px) {
    .pdp__gallery { grid-template-columns: 80px 1fr; gap: var(--sp-4); }
}

.pdp__thumbs {
    display: flex;
    flex-direction: row;
    gap: var(--sp-2);
    overflow-x: auto;
    scrollbar-width: none;
    order: 2;
}
.pdp__thumbs::-webkit-scrollbar { display: none; }
@media (min-width: 640px) {
    .pdp__thumbs {
        flex-direction: column;
        overflow-x: visible;
        overflow-y: auto;
        max-height: 640px;
        order: 0;
    }
}

.pdp__thumb {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    padding: 0;
    border: 2px solid var(--border);
    background: var(--surface-2);
    border-radius: var(--r-md);
    cursor: pointer;
    overflow: hidden;
    transition: border-color var(--t-fast), transform var(--t-fast);
}
@media (min-width: 640px) { .pdp__thumb { width: 72px; height: 72px; } }
@media (min-width: 900px) { .pdp__thumb { width: 80px; height: 80px; } }
.pdp__thumb:hover { border-color: var(--border-strong); }
.pdp__thumb.is-active { border-color: var(--accent); }
.pdp__thumb img { width: 100%; height: 100%; object-fit: cover; }

.pdp__stage {
    position: relative;
    aspect-ratio: 4 / 5;
    background: var(--surface-2);
    border-radius: var(--r-xl);
    overflow: hidden;
    border: 1px solid var(--border);
}
.pdp__stage img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform var(--t-slow);
}
@media (min-width: 900px) {
    .pdp__stage:hover img { transform: scale(1.05); }
}

.pdp__badge {
    position: absolute;
    top: var(--sp-4); left: var(--sp-4);
    background: var(--accent);
    color: var(--accent-contrast);
    padding: 6px 14px;
    border-radius: var(--r-full);
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
    letter-spacing: .04em;
}

/* Info */
.pdp__info { display: flex; flex-direction: column; gap: var(--sp-5); }
@media (min-width: 900px) {
    .pdp__info { position: sticky; top: calc(var(--header-h) + var(--sp-4)); }
}

.pdp__cat {
    font-size: var(--fs-xs);
    font-weight: var(--fw-medium);
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-subtle);
}
.pdp__title {
    font-size: var(--fs-2xl);
    line-height: 1.15;
    letter-spacing: -.02em;
    margin: var(--sp-2) 0 var(--sp-4);
}
.pdp__price {
    display: flex;
    align-items: baseline;
    gap: var(--sp-3);
    flex-wrap: wrap;
    margin-bottom: var(--sp-3);
}
.pdp__price-now {
    font-size: var(--fs-2xl);
    font-weight: var(--fw-bold);
    letter-spacing: -.01em;
}
.pdp__price-was {
    color: var(--text-subtle);
    font-size: var(--fs-md);
    text-decoration: line-through;
}
.pdp__price-save {
    display: inline-block;
    padding: 3px 10px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: var(--fs-xs);
    font-weight: var(--fw-medium);
    border-radius: var(--r-full);
}
.pdp__lead {
    color: var(--text-muted);
    font-size: var(--fs-base);
    line-height: var(--lh-snug);
    margin: 0;
}

/* Variantes */
.pdp__variants { display: flex; flex-direction: column; gap: var(--sp-2); }
.pdp__label {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    color: var(--text-muted);
}
.pdp__variant-name { color: var(--text); font-weight: var(--fw-semibold); }
.pdp__stock {
    font-size: var(--fs-xs);
    color: var(--text-subtle);
    margin: var(--sp-1) 0 0;
}
.variant-list { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.variant {
    padding: 10px var(--sp-5);
    border-radius: var(--r-full);
    border: 1.5px solid var(--border-strong);
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    cursor: pointer;
    transition: all var(--t-fast);
    min-height: 44px;
    min-width: 56px;
}
.variant:hover:not(.is-disabled) { border-color: var(--accent); }
.variant.is-active {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-contrast);
}
.variant.is-disabled {
    opacity: .35;
    cursor: not-allowed;
    text-decoration: line-through;
}

/* CTA */
.pdp__cta { margin-top: var(--sp-2); }
.btn--lg { min-height: 52px; padding: 14px var(--sp-6); font-size: var(--fs-md); }

/* Trust */
.pdp__trust {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
    font-size: var(--fs-sm);
    color: var(--text-muted);
}
.pdp__trust li { display: flex; gap: var(--sp-2); align-items: center; }
.pdp__trust span { color: var(--accent); font-size: 12px; }

/* Acordeón */
.pdp__accordion {
    border-top: 1px solid var(--border);
    margin-top: var(--sp-2);
}
.pdp__panel {
    border-bottom: 1px solid var(--border);
}
.pdp__panel summary {
    padding: var(--sp-4) 0;
    cursor: pointer;
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    color: var(--text);
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.pdp__panel summary::-webkit-details-marker { display: none; }
.pdp__panel summary::after {
    content: "+";
    font-size: var(--fs-lg);
    color: var(--text-subtle);
    transition: transform var(--t-base);
}
.pdp__panel[open] summary::after { transform: rotate(45deg); }
.pdp__panel-body {
    padding-bottom: var(--sp-4);
    font-size: var(--fs-sm);
    color: var(--text-muted);
    line-height: var(--lh-normal);
}

/* Variantes */
.variant-list { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-top: var(--sp-2); }
.variant {
    padding: 10px var(--sp-4);
    border-radius: var(--r-md);
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    font-size: var(--fs-sm);
    cursor: pointer;
    transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
    min-height: 44px;
}
.variant:hover:not(.is-disabled) { border-color: var(--accent); }
.variant.is-active {
    background: var(--accent); border-color: var(--accent);
    color: var(--accent-contrast);
}
.variant.is-disabled { opacity: .4; cursor: not-allowed; text-decoration: line-through; }


/* =====================================================================
   NAV PROGRESS BAR
   ===================================================================== */
.nav-progress {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--accent);
    transform-origin: left;
    transform: scaleX(0);
    transition: transform 240ms cubic-bezier(.2,.7,.3,1);
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
}
.nav-progress.is-active { opacity: 1; }
.nav-progress.is-done { opacity: 0; transition: opacity 240ms, transform 240ms; }

/* =====================================================================
   VIEW TRANSITIONS
   ===================================================================== */
::view-transition-old(root) {
    animation: msg-fade-out 180ms cubic-bezier(.2,.7,.3,1) both;
}
::view-transition-new(root) {
    animation: msg-fade-in 220ms cubic-bezier(.2,.7,.3,1) both;
}

@keyframes msg-fade-out {
    to { opacity: 0; }
}
@keyframes msg-fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Elementos persistentes que NO deben animarse entre páginas */
.app-header   { view-transition-name: msg-header; }
.app-bottomnav { view-transition-name: msg-bottomnav; }
.admin-sidebar { view-transition-name: msg-sidebar; }

.app-main { view-transition-name: msg-main; }

@media (prefers-reduced-motion: reduce) {
    ::view-transition-old(root),
    ::view-transition-new(root) { animation: none; }
}

/* =====================================================================
   DRAWER (base reutilizable)
   ===================================================================== */
.drawer {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--t-base);
}
.drawer.is-open {
    opacity: 1;
    pointer-events: auto;
}
.drawer__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.5);
    backdrop-filter: blur(2px);
}
.drawer__panel {
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    width: min(420px, 100vw);
    background: var(--bg-elev);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform var(--t-slow);
    box-shadow: -12px 0 40px rgba(0,0,0,.2);
    padding-bottom: var(--safe-bottom);
}
.drawer.is-open .drawer__panel { transform: translateX(0); }

.drawer__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--sp-4) var(--sp-5);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.drawer__title { font-size: var(--fs-md); font-weight: var(--fw-semibold); margin: 0; }
.drawer__body {
    flex: 1;
    overflow-y: auto;
    padding: var(--sp-4) var(--sp-5);
}
.drawer__footer {
    padding: var(--sp-4) var(--sp-5);
    border-top: 1px solid var(--border);
    background: var(--surface);
    flex-shrink: 0;
}


/* =====================================================================
   CART DRAWER
   ===================================================================== */
.cart-drawer-item {
    display: grid;
    grid-template-columns: 72px 1fr auto;
    gap: var(--sp-3);
    padding: var(--sp-3) 0;
    border-bottom: 1px solid var(--border);
}
.cart-drawer-item:last-child { border-bottom: 0; }
.cart-drawer-item__img {
    width: 72px; height: 72px;
    border-radius: var(--r-md);
    object-fit: cover;
    background: var(--surface-2);
}
.cart-drawer-item__info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cart-drawer-item__name {
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    color: var(--text);
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.cart-drawer-item__variant { font-size: var(--fs-xs); color: var(--text-subtle); }
.cart-drawer-item__price { font-size: var(--fs-sm); font-weight: var(--fw-semibold); margin-top: auto; }
.cart-drawer-item__qty {
    display: inline-flex;
    align-items: center;
    gap: 0;
    border: 1px solid var(--border-strong);
    border-radius: var(--r-full);
    overflow: hidden;
    align-self: start;
    background: var(--surface);
    height: 32px;
}
.cart-drawer-item__qty button {
    width: 28px;
    height: 100%;
    border: 0;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
}
.cart-drawer-item__qty button:hover { background: var(--surface-2); color: var(--text); }
.cart-drawer-item__qty span {
    min-width: 26px;
    text-align: center;
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    padding: 0 var(--sp-1);
}
.cart-drawer-item__remove {
    background: transparent;
    border: 0;
    color: var(--text-subtle);
    cursor: pointer;
    font-size: var(--fs-xs);
    padding: 4px 0;
    text-align: left;
    font-family: inherit;
    align-self: start;
}
.cart-drawer-item__remove:hover { color: #b23434; }

.cart-summary {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: var(--sp-2);
}

/* Cart page */
.cart-page {
    display: grid;
    gap: var(--sp-5);
    margin-top: var(--sp-5);
}
@media (min-width: 900px) {
    .cart-page { grid-template-columns: minmax(0, 1fr) 340px; gap: var(--sp-8); }
}
.cart-page__items { display: flex; flex-direction: column; }
.cart-page__summary {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: var(--sp-5);
    height: fit-content;
    position: sticky;
    top: calc(var(--header-h) + var(--sp-4));
}
.cart-page__summary h3 { font-size: var(--fs-md); margin: 0 0 var(--sp-4); }
.cart-summary-row {
    display: flex;
    justify-content: space-between;
    font-size: var(--fs-sm);
    padding: var(--sp-2) 0;
}
.cart-summary-row--muted { color: var(--text-subtle); font-size: var(--fs-xs); }
.cart-summary-row--total {
    font-size: var(--fs-md);
    font-weight: var(--fw-bold);
    padding-top: var(--sp-3);
}

/* Cart page items */
.cart-item {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: var(--sp-4);
    padding: var(--sp-4) 0;
    border-bottom: 1px solid var(--border);
}
.cart-item:first-child { padding-top: 0; }
.cart-item__img { width: 100px; height: 100px; border-radius: var(--r-md); object-fit: cover; background: var(--surface-2); }
.cart-item__info { display: flex; flex-direction: column; gap: var(--sp-2); }
.cart-item__name { font-size: var(--fs-base); font-weight: var(--fw-semibold); color: var(--text); text-decoration: none; }
.cart-item__name:hover { color: var(--accent); }
.cart-item__variant { font-size: var(--fs-sm); color: var(--text-muted); }
.cart-item__row { display: flex; justify-content: space-between; align-items: center; margin-top: auto; gap: var(--sp-3); flex-wrap: wrap; }
.cart-item__price { font-size: var(--fs-md); font-weight: var(--fw-bold); }
.cart-item__qty {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--border-strong);
    border-radius: var(--r-full);
    overflow: hidden;
    background: var(--surface);
    height: 36px;
}
.cart-item__qty button { width: 36px; height: 100%; border: 0; background: transparent; color: var(--text-muted); cursor: pointer; font-family: inherit; }
.cart-item__qty button:hover { background: var(--surface-2); color: var(--text); }
.cart-item__qty span { min-width: 32px; text-align: center; font-size: var(--fs-sm); font-weight: var(--fw-medium); }
.cart-item__remove { background: transparent; border: 0; color: var(--text-subtle); cursor: pointer; font-family: inherit; font-size: var(--fs-xs); }
.cart-item__remove:hover { color: #b23434; }
.cart-item__warning {
    font-size: var(--fs-xs);
    color: #b23434;
    background: color-mix(in oklab, #b23434 12%, var(--surface));
    padding: 4px 10px;
    border-radius: var(--r-full);
    display: inline-block;
    width: fit-content;
}


.cart-btn { position: relative; }
.cart-btn__count {
    position: absolute;
    top: -2px; right: -2px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: var(--r-full);
    background: var(--accent);
    color: var(--accent-contrast);
    font-size: 10px;
    font-weight: var(--fw-bold);
    display: grid;
    place-items: center;
    border: 2px solid var(--bg-elev);
}