/* ===== RESET & VARIABLES ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --color-bg: #ffffff;
    --color-bg-alt: #f7f7f7;
    --color-border: #e5e5e5;
    --color-text: #111111;
    --color-muted: #767676;
    --color-accent: #000000;
    --color-danger: #ff2e51;
    --color-wa: #25d366;
    --radius: 8px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.06);
    --shadow-md: 0 4px 16px rgba(0,0,0,.10);
    --header-h: 150px;
}

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    padding-top: var(--header-h);
    overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input { font-family: inherit; }

/* ===== HEADER ===== */
.header {
    position: fixed;
    top: 0; left: 0; right: 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    z-index: 100;
    padding: 10px 14px 0;
    padding-top: max(10px, env(safe-area-inset-top));
}

.header__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px; height: 38px;
    border-radius: 50%;
    position: relative;
    transition: background .2s;
}
.icon-btn:hover { background: var(--color-bg-alt); }

.logo {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -.02em;
    flex: 1;
    text-align: center;
}
.logo span { color: var(--color-danger); }

.cart-count {
    position: absolute;
    top: -2px; right: -2px;
    min-width: 18px; height: 18px;
    background: var(--color-danger);
    color: #fff;
    font-size: .68rem;
    font-weight: 700;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    transform: scale(0);
    transition: transform .2s cubic-bezier(.34,1.56,.64,1);
}
.cart-count.active { transform: scale(1); }

/* Búsqueda */
.search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 8px 12px;
    margin-bottom: 10px;
    transition: border-color .2s;
}
.search-bar:focus-within { border-color: var(--color-text); }
.search-bar svg { color: var(--color-muted); flex-shrink: 0; }
.search-bar input {
    flex: 1;
    border: none;
    background: none;
    outline: none;
    font-size: .92rem;
}
.search-bar input::placeholder { color: var(--color-muted); }

/* Categorías */
.categories {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 10px;
    scrollbar-width: none;
}
.categories::-webkit-scrollbar { display: none; }
.cat-chip {
    flex-shrink: 0;
    padding: 6px 14px;
    font-size: .82rem;
    font-weight: 600;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: var(--color-bg);
    color: var(--color-text);
    transition: all .2s;
    white-space: nowrap;
}
.cat-chip:hover { border-color: var(--color-text); }
.cat-chip.active {
    background: var(--color-text);
    color: #fff;
    border-color: var(--color-text);
}

/* ===== BANNER ===== */
.promo-banner {
    margin: 14px;
    border-radius: 12px;
    padding: 22px 20px;
    background: linear-gradient(135deg, #111 0%, #333 100%);
    color: #fff;
    position: relative;
    overflow: hidden;
}
.promo-banner::after {
    content: '';
    position: absolute;
    right: -30px; top: -30px;
    width: 140px; height: 140px;
    background: var(--color-danger);
    border-radius: 50%;
    opacity: .25;
    filter: blur(30px);
}
.promo-banner__tag {
    display: inline-block;
    background: var(--color-danger);
    font-size: .72rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
    margin-bottom: 8px;
}
.promo-banner h2 { font-size: 1.1rem; margin-bottom: 4px; }
.promo-banner p { font-size: .85rem; opacity: .8; }

/* ===== SECCIÓN / GRID ===== */
main { padding: 0 14px 40px; }

.section-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 18px 0 12px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (min-width: 640px) {
    .products-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
}
@media (min-width: 960px) {
    .products-grid { grid-template-columns: repeat(4, 1fr); }
    main, .promo-banner { max-width: 1280px; margin-left: auto; margin-right: auto; }
}
@media (min-width: 1280px) {
    .products-grid { grid-template-columns: repeat(5, 1fr); }
}

/* ===== CARD PRODUCTO ===== */
.product-card {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform .2s, box-shadow .2s;
    animation: fadeIn .35s ease both;
}
.product-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.product-card__media {
    position: relative;
    aspect-ratio: 3 / 4;
    background: var(--color-bg-alt);
    overflow: hidden;
}
.product-card__media img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform .5s ease;
}
.product-card:hover .product-card__media img { transform: scale(1.05); }

.product-tag {
    position: absolute;
    top: 8px; left: 8px;
    font-size: .65rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.tag--new { background: #111; color: #fff; }
.tag--best { background: var(--color-danger); color: #fff; }
.tag--sale { background: #ffce00; color: #111; }

.product-card__info {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}
.product-card__name {
    font-size: .82rem;
    font-weight: 500;
    color: var(--color-text);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.1em;
}
.product-card__prices {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
}
.price-current {
    font-size: 1rem;
    font-weight: 800;
    color: var(--color-text);
}
.price-old {
    font-size: .78rem;
    color: var(--color-muted);
    text-decoration: line-through;
}
.price-discount {
    font-size: .72rem;
    color: var(--color-danger);
    font-weight: 700;
}

.product-card__btn {
    margin-top: auto;
    background: var(--color-accent);
    color: #fff;
    font-size: .8rem;
    font-weight: 600;
    padding: 9px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: background .2s, transform .1s;
}
.product-card__btn:hover { background: #333; }
.product-card__btn:active { transform: scale(.97); }

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--color-muted);
    font-size: .95rem;
}

/* ===== FOOTER ===== */
.footer {
    text-align: center;
    padding: 24px 14px;
    border-top: 1px solid var(--color-border);
    font-size: .8rem;
    color: var(--color-muted);
}

/* ===== OVERLAY ===== */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s;
}
.overlay.active { opacity: 1; pointer-events: auto; }

/* ===== CARRITO SIDEBAR ===== */
.cart-sidebar {
    position: fixed;
    top: 0; right: 0;
    width: 100%;
    max-width: 420px;
    height: 100dvh;
    background: var(--color-bg);
    z-index: 300;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform .3s cubic-bezier(.4,0,.2,1);
    box-shadow: -4px 0 24px rgba(0,0,0,.12);
}
.cart-sidebar.active { transform: translateX(0); }

.cart-sidebar__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    padding-top: max(16px, env(safe-area-inset-top));
    border-bottom: 1px solid var(--color-border);
}
.cart-sidebar__header h2 { font-size: 1.05rem; font-weight: 700; }
.cart-sidebar__header span { color: var(--color-muted); font-weight: 500; }

.cart-sidebar__body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
    -webkit-overflow-scrolling: touch;
}

.cart-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--color-muted);
    font-size: .9rem;
}
.cart-empty svg { margin-bottom: 12px; opacity: .4; }

/* Item carrito */
.cart-item {
    display: grid;
    grid-template-columns: 74px 1fr auto;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid var(--color-border);
    animation: fadeIn .25s ease both;
}
.cart-item__img {
    width: 74px; height: 92px;
    border-radius: 6px;
    object-fit: cover;
    background: var(--color-bg-alt);
}
.cart-item__info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.cart-item__name {
    font-size: .82rem;
    font-weight: 500;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.cart-item__price { font-size: .88rem; font-weight: 700; }

.qty-controls {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    overflow: hidden;
    align-self: flex-start;
    margin-top: 2px;
}
.qty-controls button {
    width: 26px; height: 26px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem;
    font-weight: 600;
    transition: background .15s;
}
.qty-controls button:hover { background: var(--color-bg-alt); }
.qty-controls span {
    width: 30px;
    text-align: center;
    font-size: .82rem;
    font-weight: 600;
}

.cart-item__remove {
    color: var(--color-muted);
    align-self: flex-start;
    padding: 2px;
    transition: color .2s;
}
.cart-item__remove:hover { color: var(--color-danger); }

.cart-sidebar__footer {
    padding: 16px;
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--color-border);
    background: var(--color-bg);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1rem;
    margin-bottom: 12px;
}
.cart-total strong { font-size: 1.25rem; font-weight: 800; }

.btn-whatsapp {
    width: 100%;
    background: var(--color-wa);
    color: #fff;
    font-size: .92rem;
    font-weight: 700;
    padding: 14px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: filter .2s, transform .1s;
}
.btn-whatsapp:hover { filter: brightness(1.05); }
.btn-whatsapp:active { transform: scale(.98); }
.btn-whatsapp:disabled {
    background: var(--color-border);
    color: var(--color-muted);
    cursor: not-allowed;
}

/* ===== TOAST ===== */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--color-text);
    color: #fff;
    font-size: .85rem;
    font-weight: 500;
    padding: 11px 20px;
    border-radius: 999px;
    z-index: 400;
    opacity: 0;
    transition: all .3s cubic-bezier(.34,1.56,.64,1);
    box-shadow: var(--shadow-md);
    pointer-events: none;
    max-width: 90vw;
    text-align: center;
}
.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ===== ANIMACIONES ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
/* Logo MAYLEX */
.logo { font-size: 1.5rem; }
.logo span { color: var(--color-danger); }

/* Tag agotado */
.tag--out { background: #333; color: #fff; }

/* Badge "últimas unidades" */
.stock-badge {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: #f59e0b;
    color: #fff;
    font-size: .68rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
    letter-spacing: .02em;
}

/* Tarjeta agotada */
.product-card.is-out .product-card__media img {
    filter: grayscale(.6);
    opacity: .7;
}
.product-card__btn--disabled {
    background: #d4d4d4 !important;
    color: #888 !important;
    cursor: not-allowed;
}
.product-card__btn--disabled:hover {
    background: #d4d4d4 !important;
}
/* Logo MAYLEX */
.logo { font-size: 1.5rem; }
.logo span { color: var(--color-danger); }

/* Tag agotado */
.tag--out { background: #333; color: #fff; }

/* Badge "últimas unidades" */
.stock-badge {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: #f59e0b;
    color: #fff;
    font-size: .68rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
    letter-spacing: .02em;
}

/* Tarjeta agotada */
.product-card.is-out .product-card__media img {
    filter: grayscale(.6);
    opacity: .7;
}
.product-card__btn--disabled {
    background: #d4d4d4 !important;
    color: #888 !important;
    cursor: not-allowed;
}
.product-card__btn--disabled:hover {
    background: #d4d4d4 !important;
}

/* Loader */
.loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 60px 20px;
    gap: 16px;
    color: var(--color-muted);
}
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-danger);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
/* ===== Tarjeta con múltiples imágenes (indicador) ===== */
.product-card__media .img-count-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0,0,0,.7);
    color: #fff;
    font-size: .68rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    gap: 3px;
    z-index: 2;
}

/* ===== Modal de producto ===== */
.product-modal {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s;
    padding: 16px;
}
.product-modal.active {
    opacity: 1;
    pointer-events: auto;
}
.product-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.6);
    backdrop-filter: blur(3px);
}
.product-modal__content {
    position: relative;
    background: #fff;
    border-radius: 14px;
    max-width: 980px;
    width: 100%;
    max-height: 92vh;
    overflow-y: auto;
    display: grid;
    grid-template-columns: 1fr;
    z-index: 1;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
    animation: modalIn .3s cubic-bezier(.34,1.3,.64,1);
}
@keyframes modalIn {
    from { transform: scale(.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
@media (min-width: 720px) {
    .product-modal__content {
        grid-template-columns: 1fr 1fr;
    }
}
.product-modal__close {
    position: absolute;
    top: 12px; right: 12px;
    width: 36px; height: 36px;
    background: rgba(255,255,255,.95);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
    transition: background .2s;
}
.product-modal__close:hover { background: #f0f0f0; }

/* Galería modal */
.product-modal__gallery {
    background: var(--color-bg-alt);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.product-modal__main {
    position: relative;
    aspect-ratio: 3/4;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
}
.product-modal__main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s;
}
.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px; height: 36px;
    background: rgba(255,255,255,.9);
    border-radius: 50%;
    font-size: 1.4rem;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.modal-nav:hover { background: #fff; }
.modal-nav--prev { left: 8px; }
.modal-nav--next { right: 8px; }
.modal-counter {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,.7);
    color: #fff;
    font-size: .72rem;
    padding: 3px 10px;
    border-radius: 999px;
    z-index: 2;
}
.product-modal__thumbs {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
}
.product-modal__thumbs img {
    aspect-ratio: 1;
    border-radius: 6px;
    object-fit: cover;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color .2s;
}
.product-modal__thumbs img.active {
    border-color: var(--color-danger);
}

/* Info modal */
.product-modal__info {
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.product-modal__cat {
    font-size: .74rem;
    font-weight: 700;
    color: var(--color-danger);
    text-transform: uppercase;
    letter-spacing: .05em;
}
.product-modal__info h2 {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.25;
    margin: 0;
}
.product-modal__prices {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
}
.product-modal__prices .price-current {
    font-size: 1.6rem;
    font-weight: 800;
}
.product-modal__prices .price-old {
    font-size: 1rem;
    text-decoration: line-through;
    color: var(--color-muted);
}
.product-modal__prices .price-discount {
    font-size: .9rem;
    font-weight: 700;
    color: var(--color-danger);
}
.product-modal__desc {
    font-size: .9rem;
    color: var(--color-muted);
    line-height: 1.6;
}
.product-modal__meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: .85rem;
}
.product-modal__meta .meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.product-modal__meta .badge {
    font-size: .72rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
}
.product-modal__meta .badge--ok { background: #dcfce7; color: #16a34a; }
.product-modal__meta .badge--low { background: #fef3c7; color: #b45309; }
.product-modal__meta .badge--out { background: #fee2e2; color: #dc2626; }

.product-modal__btn {
    background: var(--color-accent);
    color: #fff;
    font-size: .95rem;
    font-weight: 700;
    padding: 14px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: auto;
    transition: background .2s, transform .1s;
}
.product-modal__btn:hover { background: #333; }
.product-modal__btn:active { transform: scale(.98); }
.product-modal__btn:disabled {
    background: #d4d4d4;
    color: #888;
    cursor: not-allowed;
}

/* Click en tarjeta = abrir modal */
.product-card__media,
.product-card__name {
    cursor: pointer;
}
/* ===== LOGO EN HEADER ===== */
.logo-link {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    text-decoration: none;
    height: 56px;
    max-width: 260px;
    margin: 0 auto;
}
.logo-img {
    height: 100%;
    width: auto;
    max-height: 56px;
    object-fit: contain;
    display: block;
}

/* Móvil pequeño */
@media (max-width: 480px) {
    .logo-link { max-width: 180px; height: 48px; }
    .logo-img  { max-height: 48px; }
}

/* Móvil grande */
@media (min-width: 481px) and (max-width: 959px) {
    .logo-link { max-width: 220px; height: 52px; }
    .logo-img  { max-height: 52px; }
}

/* Escritorio */
@media (min-width: 960px) {
    .logo-link { max-width: 300px; height: 64px; }
    .logo-img  { max-height: 64px; }
}

/* Escritorio grande */
@media (min-width: 1280px) {
    .logo-link { max-width: 340px; height: 72px; }
    .logo-img  { max-height: 72px; }
}

/* NOTA: Si el logo tiene fondo negro y quieres integrarlo mejor,
   descomenta esta línea para redondearlo: */
/*
.logo-img { border-radius: 6px; }
/* ===== BOTÓN FAVORITO EN TARJETA ===== */
.fav-toggle {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 38px;
    height: 38px;
    background: rgba(255,255,255,.95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4;
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
    transition: transform .2s, background .2s, color .2s;
    color: #c4c4c4;
    backdrop-filter: blur(4px);
    -webkit-tap-highlight-color: transparent;
}
.fav-toggle:hover { 
    transform: scale(1.08); 
    background: #fff;
}
.fav-toggle:active {
    transform: scale(0.92);
}
.fav-toggle.is-fav { 
    color: #ff2e51; 
}
.fav-toggle.is-fav svg path { 
    fill: #ff2e51; 
}
.fav-toggle:not(.is-fav) svg path { 
    fill: none; 
    stroke: #999; 
    stroke-width: 2; 
}
.fav-toggle:hover { transform: scale(1.1); }
.fav-toggle.is-fav { color: #ff2e51; }
.fav-toggle.is-fav svg path { fill: #ff2e51; }
.fav-toggle:not(.is-fav) svg path { fill: none; stroke: #999; stroke-width: 2; }

/* ===== BOTÓN FAVORITO EN MODAL ===== */
.modal-fav-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1.5px solid var(--color-border);
    border-radius: 8px;
    font-size: .88rem;
    font-weight: 600;
    color: var(--color-muted);
    background: #fff;
    transition: all .2s;
    align-self: flex-start;
}
.modal-fav-btn:hover { border-color: var(--color-danger); color: var(--color-danger); }
.modal-fav-btn.is-fav {
    background: #fff5f7;
    border-color: var(--color-danger);
    color: var(--color-danger);
}
.modal-fav-btn svg path {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}
.modal-fav-btn.is-fav svg path {
    fill: currentColor;
    stroke: currentColor;
}
/* ===== BARRA DE FILTROS ===== */
.filters-bar {
    display: flex;
    gap: 8px;
    padding: 0 0 10px;
}
.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: #fff;
    font-size: .82rem;
    font-weight: 600;
    color: var(--color-text);
    transition: all .2s;
    position: relative;
}
.filter-btn:hover { border-color: var(--color-text); }
.filter-badge {
    background: var(--color-danger);
    color: #fff;
    font-size: .68rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 1px 6px;
    min-width: 18px;
    text-align: center;
}

/* ===== PANEL DE FILTROS ===== */
.filters-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 400;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s;
}
.filters-overlay.active { opacity: 1; pointer-events: auto; }

.filters-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 20px 20px 0 0;
    z-index: 401;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform .3s cubic-bezier(.4,0,.2,1);
    box-shadow: 0 -8px 30px rgba(0,0,0,.15);
}
.filters-panel.active { transform: translateY(0); }

@media (min-width: 640px) {
    .filters-panel {
        left: auto;
        right: 20px;
        bottom: 20px;
        width: 380px;
        border-radius: 16px;
        max-height: 80vh;
    }
}

.filters-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-border);
}
.filters-panel__header h3 { font-size: 1rem; font-weight: 700; }

.filters-panel__body {
    padding: 16px 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.filter-group { display: flex; flex-direction: column; gap: 8px; }
.filter-label {
    font-size: .82rem;
    font-weight: 600;
    color: var(--color-text);
}
.price-range {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 8px;
    align-items: center;
}
.price-range span { color: var(--color-muted); }

.filters-panel__footer {
    padding: 16px 20px;
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--color-border);
}
/* ===== VISOR DE ZOOM ===== */
.zoom-viewer {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.95);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}
.zoom-viewer.active { display: flex; }

.zoom-viewer__stage {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: zoom-in;
    touch-action: none;
}
.zoom-viewer__stage img {
    max-width: 90%;
    max-height: 90%;
    user-select: none;
    -webkit-user-drag: none;
    transition: transform .1s ease-out;
}

.zoom-viewer__close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: rgba(255,255,255,.15);
    color: #fff;
    border-radius: 50%;
    font-size: 1.2rem;
    z-index: 2;
    backdrop-filter: blur(6px);
}
.zoom-viewer__close:hover { background: rgba(255,255,255,.25); }

.zoom-viewer__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background: rgba(255,255,255,.15);
    color: #fff;
    border-radius: 50%;
    font-size: 1.6rem;
    font-weight: 700;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
}
.zoom-viewer__nav:hover { background: rgba(255,255,255,.25); }
.zoom-viewer__nav--prev { left: 20px; }
.zoom-viewer__nav--next { right: 20px; }

.zoom-viewer__hint {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,.7);
    font-size: .78rem;
    text-align: center;
    padding: 0 20px;
    pointer-events: none;
}
.modal-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1.5px solid var(--color-border);
    border-radius: 8px;
    font-size: .88rem;
    font-weight: 600;
    color: var(--color-muted);
    background: #fff;
    transition: all .2s;
    margin-left: 8px;
}
.modal-share-btn:hover { border-color: var(--color-text); color: var(--color-text); }
/* ===== VISTOS RECIENTEMENTE ===== */
.recent-section {
    padding: 0 14px 20px;
    max-width: 1280px;
    margin: 0 auto;
}
.recent-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: thin;
}
.recent-scroll::-webkit-scrollbar { height: 6px; }
.recent-scroll::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 999px; }

.recent-card {
    flex-shrink: 0;
    width: 130px;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: transform .2s, box-shadow .2s;
}
.recent-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}
.recent-card img {
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
    background: var(--color-bg-alt);
}
.recent-card__info { padding: 8px; }
.recent-card__name {
    font-size: .78rem;
    font-weight: 500;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2em;
}
.recent-card__price {
    font-size: .84rem;
    font-weight: 700;
    margin-top: 4px;
    display: block;
}
/* ===== CARRUSEL DE PROMOCIONES ===== */
.promo-carousel {
    margin: 14px;
    border-radius: 14px;
    overflow: hidden;
    position: relative;
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
    box-shadow: 0 4px 20px rgba(0,0,0,.08);
}
.promo-carousel__track {
    display: flex;
    transition: transform .5s cubic-bezier(.4,0,.2,1);
}
.promo-slide {
    flex: 0 0 100%;
    padding: 26px 22px;
    color: #fff;
    position: relative;
    overflow: hidden;
    min-height: 130px;
}
.promo-slide__content { position: relative; z-index: 2; }
.promo-slide__tag {
    display: inline-block;
    font-size: .72rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
    margin-bottom: 8px;
    backdrop-filter: blur(4px);
}
.promo-slide h2 { font-size: 1.15rem; margin-bottom: 4px; }
.promo-slide p { font-size: .85rem; opacity: .9; }

.promo-slide__blob {
    position: absolute;
    right: -40px;
    top: -40px;
    width: 160px;
    height: 160px;
    background: rgba(255,255,255,.15);
    border-radius: 50%;
    filter: blur(20px);
}

.promo-carousel__dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 3;
}
.promo-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,.4);
    transition: all .3s;
}
.promo-dot.active {
    background: #fff;
    width: 22px;
    border-radius: 999px;
}
/* ===== BADGE DE LIKES EN TARJETA ===== */
.likes-badge {
    position: absolute;
    bottom: 8px;
    left: 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255,255,255,.95);
    color: #ff2e51;
    font-size: .72rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
    z-index: 2;
    box-shadow: 0 2px 6px rgba(0,0,0,.12);
    backdrop-filter: blur(4px);
    pointer-events: none;
}
.likes-badge svg {
    display: block;
}
/* ===== BADGE DE LIKES EN MODAL ===== */
.modal-likes-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: .78rem;
    font-weight: 600;
    color: #ff2e51;
    background: #fff5f7;
    border-radius: 999px;
    padding: 4px 10px;
    margin-bottom: 8px;
    align-self: flex-start;
}

/* =========================================================
   ANIMACIÓN "POP" DEL CORAZÓN
   ========================================================= */

/* Pop al agregar a favoritos */
@keyframes heartPop {
    0%   { transform: scale(1);   }
    25%  { transform: scale(1.4); }
    50%  { transform: scale(0.9); }
    75%  { transform: scale(1.15);}
    100% { transform: scale(1);   }
}

/* Pop al quitar de favoritos */
@keyframes heartPopOut {
    0%   { transform: scale(1);   }
    40%  { transform: scale(0.75);}
    70%  { transform: scale(1.1); }
    100% { transform: scale(1);   }
}

/* Corazón de la tarjeta */
.fav-toggle.pop {
    animation: heartPop 0.5s cubic-bezier(.34,1.56,.64,1);
}
.fav-toggle.pop-out {
    animation: heartPopOut 0.4s ease-out;
}

/* Corazón del modal */
.modal-fav-btn.pop {
    animation: heartPop 0.5s cubic-bezier(.34,1.56,.64,1);
}
.modal-fav-btn.pop-out {
    animation: heartPopOut 0.4s ease-out;
}

/* Asegura que el corazón pueda transformarse sin problemas */
.fav-toggle,
.modal-fav-btn {
    transform-origin: center;
    will-change: transform;
}

/* =========================================================
   ESTALLIDO DE PARTÍCULAS (opcional, muy bonito)
   ========================================================= */
.fav-toggle.is-fav::before,
.fav-toggle.is-fav::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ff2e51;
    opacity: 0;
    pointer-events: none;
}
.fav-toggle.pop::before {
    animation: burstA 0.55s ease-out;
}
.fav-toggle.pop::after {
    animation: burstB 0.55s ease-out;
}

@keyframes burstA {
    0%   { opacity: 1; transform: translate(0, 0) scale(1); }
    100% { opacity: 0; transform: translate(-14px, -14px) scale(0.2); }
}
@keyframes burstB {
    0%   { opacity: 1; transform: translate(0, 0) scale(1); }
    100% { opacity: 0; transform: translate(14px, -14px) scale(0.2); }
}