/* ==========================================
   ESTILO DE LA TIENDA
   Colores: azul #0071dc, azul oscuro #004f9a, amarillo #ffc220
   ========================================== */
:root {
    --azul: #0071dc;
    --azul-oscuro: #004f9a;
    --amarillo: #ffc220;
    --texto: #1b1c1d;
    --gris: #6d6e71;
    --borde: #e3e4e5;
    --fondo: #f1f1f2;
    --verde: #2a8703;
    --rojo: #de1c24;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
    background-color: #ffffff;
    color: var(--texto);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ---------- ENCABEZADO ---------- */
.navbar {
    background-color: var(--azul);
    position: sticky;
    top: 0;
    z-index: 50;
    padding: 0.85rem 0;
}

.nav-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.25rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.logo {
    flex-shrink: 0;
    line-height: 0;
}

.logo a { display: inline-block; border-radius: 10px; }
.logo a:focus-visible { outline: 3px solid var(--amarillo); outline-offset: 3px; }

.logo img {
    height: 40px;
    width: auto;
    display: block;
}

.search-box { flex: 1; }

.search-box input {
    width: 100%;
    height: 2.6rem;
    padding: 0 1rem 0 2.8rem;
    border: 2px solid transparent;
    border-radius: 9999px;
    background: #ffffff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%231b1c1d' stroke-width='2.2' stroke-linecap='round'><circle cx='11' cy='11' r='7'/><path d='M20 20l-3.5-3.5'/></svg>") no-repeat 1rem center;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.search-box input::placeholder { color: var(--gris); }

/* Selector de moneda (banderas) */
.selector-moneda {
    display: flex;
    flex-shrink: 0;
    background-color: var(--azul-oscuro);
    border-radius: 9999px;
    padding: 3px;
    gap: 2px;
}

.btn-moneda {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    border: none;
    background: transparent;
    color: #ffffff;
    font-size: 0.88rem;
    font-weight: 800;
    padding: 0.4rem 0.8rem 0.4rem 0.55rem;
    border-radius: 9999px;
    cursor: pointer;
    opacity: 0.75;
    transition: background-color 0.15s, color 0.15s, opacity 0.15s;
}

.btn-moneda:hover { opacity: 1; }

.btn-moneda.activo {
    background-color: #ffffff;
    color: var(--texto);
    opacity: 1;
}

.btn-moneda:focus-visible { outline: 3px solid var(--amarillo); outline-offset: 1px; }

.bandera {
    width: 1.4rem;
    height: auto;
    aspect-ratio: 3 / 2;
    border-radius: 3px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

.search-box input:focus {
    border-color: var(--amarillo);
    box-shadow: 0 0 0 3px rgba(255, 194, 32, 0.4);
}

/* Franja USA -> Nicaragua */
.franja {
    background-color: var(--amarillo);
    color: var(--texto);
    text-align: center;
    font-size: 0.9rem;
    font-weight: 700;
    padding: 0.5rem 1rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.25rem 0.6rem;
}

.franja-item { display: inline-flex; align-items: center; gap: 0.4rem; }
.franja .bandera { width: 1.2rem; }

/* ---------- BOTÓN Y MENÚ DE CATEGORÍAS ---------- */
.logo { order: 0; }
.btn-categorias { order: 1; }
.search-box { order: 2; }
.selector-moneda { order: 3; }

.btn-categorias {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 700;
    padding: 0.55rem 0.8rem;
    border-radius: 9999px;
    cursor: pointer;
    transition: background-color 0.15s;
}
.btn-categorias:hover,
.btn-categorias[aria-expanded="true"] { background-color: var(--azul-oscuro); }
.btn-categorias:focus-visible { outline: 3px solid var(--amarillo); outline-offset: 2px; }
.btn-categorias svg {
    width: 1.25rem; height: 1.25rem;
    fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
}
.btn-categorias .ico-flecha { width: 1rem; height: 1rem; transition: transform 0.2s; }
.btn-categorias[aria-expanded="true"] .ico-flecha { transform: rotate(180deg); }

.overlay-categorias {
    position: fixed;
    inset: var(--alto-header, 68px) 0 0 0;
    background-color: rgba(11, 31, 58, 0.45);
    z-index: 40;
}
.overlay-categorias[hidden], .panel-categorias[hidden] { display: none; }

/* Computadora: panel debajo del encabezado */
.panel-categorias {
    position: fixed;
    top: var(--alto-header, 68px);
    left: max(1.25rem, calc((100vw - 1280px) / 2 + 1.25rem));
    width: min(760px, calc(100vw - 2.5rem));
    max-height: min(70vh, 560px);
    background: #ffffff;
    border-radius: 0 0 0.75rem 0.75rem;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
    z-index: 45;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.panel-cabecera { display: none; }
.panel-cuerpo {
    display: grid;
    grid-template-columns: 290px 1fr;
    min-height: 0;
    overflow: hidden;
}
.lista-categorias {
    list-style: none;
    border-right: 1px solid var(--borde);
    overflow-y: auto;
    padding: 0.5rem 0;
}
.item-cat {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1rem;
    background: none;
    border: none;
    text-align: left;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--texto);
    cursor: pointer;
}
.item-cat .nombre { flex: 1; }
.item-cat:hover, .item-cat.resaltado, .item-cat:focus-visible {
    background-color: #e6f1fc;
    color: var(--azul-oscuro);
    outline: none;
}
.item-todos { border-bottom: 1px solid var(--borde); margin-bottom: 0.35rem; }
.ico-cat, .ico-mas {
    width: 1.4rem; height: 1.4rem; flex-shrink: 0;
    fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
.ico-mas { width: 1rem; height: 1rem; color: var(--gris); transition: transform 0.2s; }
.cuenta {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--gris);
    background: var(--fondo);
    border-radius: 9999px;
    padding: 0.1rem 0.45rem;
}
.acordeon { display: none; }

.lista-subcategorias { padding: 1.1rem 1.4rem; overflow-y: auto; }
.sub-titulo {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem 0.75rem;
    background: none;
    border: none;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--texto);
    cursor: pointer;
    margin-bottom: 0.8rem;
    text-align: left;
}
.sub-titulo span { font-size: 0.85rem; font-weight: 700; color: var(--azul); }
.sub-titulo:hover span { text-decoration: underline; }
.lista-subcategorias ul {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 0.25rem 1rem;
}
.item-sub {
    background: none;
    border: none;
    text-align: left;
    font-size: 0.92rem;
    color: var(--texto);
    padding: 0.45rem 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.item-sub:hover, .item-sub:focus-visible { color: var(--azul); text-decoration: underline; outline: none; }
.sin-subs, .sub-vacio p { color: var(--gris); font-size: 0.9rem; }
.sub-vacio { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.6rem; height: 100%; text-align: center; color: var(--azul); }
.sub-vacio .ico-cat { width: 2.5rem; height: 2.5rem; }
.lista-categorias .vacio { padding: 1rem; color: var(--gris); font-size: 0.9rem; }

.filtros-group { scroll-margin-top: calc(var(--alto-header, 68px) + 0.75rem); }

/* Celular y tablet chica: panel lateral */
@media (max-width: 767px) {
    .overlay-categorias { inset: 0; z-index: 55; }
    .panel-categorias {
        top: 0; left: 0; bottom: 0;
        width: min(88vw, 340px);
        max-height: none;
        border-radius: 0 1rem 1rem 0;
        z-index: 60;
        animation: entrar-izq 0.2s ease-out;
    }
    .panel-cabecera {
        display: flex;
        align-items: center;
        justify-content: space-between;
        background: var(--azul);
        color: #fff;
        padding: 0.9rem 1rem;
        font-size: 1.1rem;
    }
    .btn-cerrar { background: none; border: none; color: #fff; padding: 0.25rem; cursor: pointer; border-radius: 0.4rem; }
    .btn-cerrar svg { width: 1.5rem; height: 1.5rem; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; display: block; }
    .panel-cuerpo { display: block; overflow-y: auto; flex: 1; }
    .lista-categorias { border-right: none; overflow: visible; }
    .lista-subcategorias { display: none; }
    .item-cat { padding: 0.85rem 1rem; }
    .item-cat[aria-expanded="true"] { background-color: #e6f1fc; color: var(--azul-oscuro); }
    .item-cat[aria-expanded="true"] .ico-mas { transform: rotate(90deg); }
    .acordeon { display: block; list-style: none; background: #f7f9fc; padding: 0.25rem 0 0.5rem 3.15rem; }
    .acordeon[hidden] { display: none; }
    .acordeon .item-sub { width: 100%; padding: 0.6rem 1rem 0.6rem 0; }
    .acordeon .ver-todo { color: var(--azul); font-weight: 700; }
    body.menu-abierto { overflow: hidden; }
}
@keyframes entrar-izq { from { transform: translateX(-100%); } to { transform: none; } }

/* ---------- CONTENIDO ---------- */
.main-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1.25rem 1.25rem 0;
    flex-grow: 1;
    width: 100%;
}

/* Cómo pedir */
.como-pedir {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.paso {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    background-color: #e6f1fc;
    border-radius: 0.5rem;
    padding: 0.85rem 1rem;
}

.paso .num {
    flex-shrink: 0;
    width: 1.8rem;
    height: 1.8rem;
    border-radius: 50%;
    background-color: var(--azul);
    color: #fff;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

.paso strong { font-size: 0.95rem; }
.paso p { font-size: 0.82rem; color: var(--gris); margin-top: 0.1rem; }

/* ---------- FILTROS ---------- */
.filtros-group {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    scrollbar-width: none;
}

.filtros-group::-webkit-scrollbar { display: none; }

.btn-filtro {
    flex-shrink: 0;
    padding: 0.5rem 1.1rem;
    border-radius: 9999px;
    font-size: 0.9rem;
    font-weight: 700;
    border: 1px solid var(--texto);
    background-color: #ffffff;
    color: var(--texto);
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
}

.btn-filtro:hover { background-color: var(--fondo); }

.btn-filtro.active {
    background-color: var(--texto);
    color: #ffffff;
}

/* Subcategorías (segunda fila, más chica) */
.subfiltros-group {
    display: flex;
    gap: 0.4rem;
    margin: -0.5rem 0 1.25rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    scrollbar-width: none;
}
.subfiltros-group[hidden] { display: none; }
.subfiltros-group::-webkit-scrollbar { display: none; }

.btn-subfiltro {
    flex-shrink: 0;
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
    font-size: 0.82rem;
    font-weight: 600;
    border: 1px solid var(--borde);
    background-color: var(--fondo);
    color: var(--texto);
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.btn-subfiltro:hover { border-color: var(--azul); }
.btn-subfiltro.active {
    background-color: var(--azul);
    border-color: var(--azul);
    color: #ffffff;
}

.sub-tag { color: var(--gris); font-weight: 600; }

/* ---------- GRILLA ---------- */
.grid-productos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 1rem;
}

/* ---------- TARJETA ---------- */
.card {
    position: relative;
    background-color: #ffffff;
    border: 1px solid var(--borde);
    border-radius: 0.5rem;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.card:hover { box-shadow: 0 2px 10px rgba(0, 0, 0, 0.14); }

.card-agotada .card-image-wrapper img { opacity: 0.45; filter: grayscale(0.6); }

.card-image-wrapper {
    position: relative;
    height: 220px;
    padding: 1rem;
    background-color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-image-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.badge {
    position: absolute;
    top: 0.6rem;
    left: 0.6rem;
    padding: 0.2rem 0.55rem;
    border-radius: 0.25rem;
    font-size: 0.72rem;
    font-weight: 700;
}

.badge.disponible { background-color: #e7f4e0; color: var(--verde); }
.badge.agotado { background-color: #fde8e9; color: var(--rojo); }

.btn-fav {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 2.2rem;
    height: 2.2rem;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-fav svg {
    width: 1.5rem;
    height: 1.5rem;
    fill: none;
    stroke: var(--texto);
    stroke-width: 1.8;
    transition: fill 0.15s, stroke 0.15s;
}

.btn-fav:hover svg { stroke: var(--azul); }
.btn-fav.activo svg { fill: var(--rojo); stroke: var(--rojo); }

.card-body {
    padding: 0 1rem 1rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    gap: 0.5rem;
}

.btn-wssp {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background-color: var(--azul);
    color: #ffffff;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    padding: 0.55rem 1rem;
    border-radius: 9999px;
    transition: background-color 0.15s;
}

.btn-wssp:hover { background-color: var(--azul-oscuro); }

.btn-wssp.secundario {
    background-color: #ffffff;
    color: var(--texto);
    border: 1px solid var(--texto);
}

.btn-wssp.secundario:hover { background-color: var(--fondo); }

.precio {
    display: flex;
    align-items: flex-start;
    font-weight: 800;
    line-height: 1;
    margin-top: 0.25rem;
}

.precio .moneda { font-size: 0.85rem; margin-top: 0.2rem; margin-right: 0.1rem; }
.precio .entero { font-size: 2rem; letter-spacing: -0.02em; }
.precio .centavos { font-size: 0.95rem; margin-top: 0.15rem; }
.precio .sin-precio { font-size: 1rem; font-weight: 700; color: var(--gris); }

.producto-titulo {
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.producto-desc {
    font-size: 0.8rem;
    color: var(--gris);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.producto-desc:empty { display: none; }

.card-pie {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.categoria-tag { font-size: 0.82rem; font-weight: 700; color: var(--azul); }

.item-tag {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--gris);
    background: var(--fondo);
    padding: 2px 6px;
    border-radius: 4px;
}

.txt-corto { display: none; }

/* Aviso para cargar el Excel a mano (solo al abrir con doble clic) */
.carga-manual {
    grid-column: 1 / -1;
    border: 2px dashed var(--azul);
    border-radius: 0.75rem;
    background-color: #f5f9ff;
    padding: 2rem 1.25rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}
.carga-manual.encima { background-color: #e6f1fc; }
.carga-manual p { color: var(--gris); font-size: 0.9rem; max-width: 34rem; }
.carga-manual .pista { font-size: 0.8rem; }
.btn-cargar {
    background-color: var(--azul);
    color: #fff;
    font-weight: 700;
    padding: 0.65rem 1.4rem;
    border-radius: 9999px;
    cursor: pointer;
}
.btn-cargar:hover { background-color: var(--azul-oscuro); }

/* ---------- PIE ---------- */
.footer {
    background-color: var(--fondo);
    border-top: 1px solid var(--borde);
    text-align: center;
    padding: 1.5rem;
    font-size: 0.85rem;
    color: var(--gris);
    margin-top: 3rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.footer a { color: var(--azul); font-weight: 700; }
.footer .copy { font-size: 0.75rem; }

/* ---------- MÓVIL ---------- */
/* Tablet: el buscador pasa a su propia línea para que no quede aplastado */
@media (max-width: 900px) {
    .nav-container { flex-wrap: wrap; gap: 0.6rem; }
    .search-box { flex-basis: 100%; order: 3; }
    .selector-moneda { margin-left: auto; order: 2; }
}

@media (max-width: 480px) {
    .btn-moneda { padding: 0.3rem 0.45rem 0.3rem 0.35rem; font-size: 0.75rem; gap: 0.25rem; }
}

@media (max-width: 640px) {
    .logo img { height: 32px; }
    .btn-categorias { order: -1; padding: 0.4rem; margin-left: -0.3rem; }
    .btn-categorias .txt, .btn-categorias .ico-flecha { display: none; }
    .btn-categorias svg.ico-menu { width: 1.6rem; height: 1.6rem; }
    .como-pedir { grid-template-columns: 1fr; gap: 0.5rem; }
    .paso { padding: 0.6rem 0.8rem; }
    .grid-productos { grid-template-columns: repeat(2, 1fr); gap: 0.6rem; }
    .card-image-wrapper { height: 160px; }
    .card-body { padding: 0 0.7rem 0.8rem; }
    .btn-wssp { align-self: stretch; justify-content: center; text-align: center; font-size: 0.78rem; padding: 0.5rem 0.4rem; white-space: nowrap; }
    .btn-wssp.secundario { white-space: normal; }
    .precio .entero { font-size: 1.6rem; }
}

/* ---------- CELULARES PEQUEÑOS (360px o menos) ---------- */
@media (max-width: 400px) {
    .main-container { padding: 1rem 0.75rem 0; }
    .nav-container { padding: 0 0.75rem; }
    .grid-productos { gap: 0.5rem; }
    .card-image-wrapper { height: 130px; padding: 0.6rem; }
    .card-body { padding: 0 0.6rem 0.7rem; }
    .btn-wssp .txt-largo { display: none; }
    .btn-wssp .txt-corto { display: inline; }
    .btn-wssp, .btn-wssp.secundario { white-space: nowrap; font-size: 0.85rem; }
    .precio { flex-wrap: wrap; }
    .precio .entero { font-size: 1.35rem; }
    .card-pie { flex-wrap: wrap; }
    .producto-titulo { font-size: 0.88rem; }
    .franja { font-size: 0.8rem; }
    .franja .flecha { display: none; }
    .btn-moneda { padding: 0.35rem 0.6rem 0.35rem 0.45rem; font-size: 0.8rem; gap: 0.3rem; }
    .bandera { width: 1.2rem; }
    .logo img { height: 26px; }
    .btn-moneda { padding: 0.3rem 0.45rem 0.3rem 0.35rem; font-size: 0.75rem; gap: 0.25rem; }
    .nav-container { gap: 0.45rem; }
    .btn-categorias { margin-left: -0.35rem; }
}

/* ---------- PANTALLAS MUY ANGOSTAS (menos de 300px) ---------- */
@media (max-width: 300px) {
    .grid-productos { grid-template-columns: 1fr; }
}

/* Celulares muy angostos (320px): logo y moneda caben en una línea */
@media (max-width: 345px) {
    .logo img { height: 21px; }
    .btn-moneda { padding: 0.3rem 0.45rem 0.3rem 0.35rem; font-size: 0.75rem; gap: 0.25rem; }
    .bandera { width: 1.05rem; }
}

/* ==========================================
   OFERTAS Y ETIQUETAS
   ========================================== */
.badge.et-oferta  { background-color: var(--rojo); color: #fff; }
.badge.et-nuevo   { background-color: var(--azul); color: #fff; }
.badge.et-ultimas { background-color: var(--amarillo); color: var(--texto); }
.badge.et-otra    { background-color: var(--texto); color: #fff; }

.precio-oferta { color: var(--verde); }
.precio .ahora {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    margin: 0.2rem 0.35rem 0 0;
    letter-spacing: 0.02em;
}
.precio-antes {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.2rem 0.45rem;
    font-size: 0.8rem;
    color: var(--gris);
    margin-top: -0.2rem;
}
.precio-antes .ahorro {
    background-color: #e7f4e0;
    color: var(--verde);
    font-weight: 700;
    border-radius: 0.25rem;
    padding: 0.05rem 0.35rem;
}

.btn-filtro.chip-ofertas { border-color: var(--rojo); color: var(--rojo); }
.btn-filtro.chip-ofertas:hover { background-color: #fde8e9; }
.btn-filtro.chip-ofertas.active { background-color: var(--rojo); color: #fff; }

/* ==========================================
   BOTÓN AGREGAR / CANTIDAD
   ========================================== */
.zona-boton { min-height: 2.35rem; display: flex; }
.btn-agregar { border: none; cursor: pointer; font-family: inherit; }
.stepper {
    display: inline-flex;
    align-items: center;
    border: 2px solid var(--azul);
    border-radius: 9999px;
    background: #fff;
    overflow: hidden;
    height: 2.35rem;
}
.stepper button {
    width: 2.4rem;
    height: 100%;
    border: none;
    background: transparent;
    color: var(--azul);
    font-size: 1.25rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.stepper button:hover { background-color: #e6f1fc; }
.stepper button svg { width: 1.05rem; height: 1.05rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.stepper .cant { min-width: 1.6rem; text-align: center; font-weight: 800; font-size: 0.95rem; }
.stepper.chico { height: 1.9rem; border-width: 1.5px; }
.stepper.chico button { width: 1.9rem; font-size: 1.05rem; }

/* ==========================================
   BOTÓN "PEDIDO" DEL ENCABEZADO
   ========================================== */
.btn-pedido {
    order: 4;
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    padding: 0.5rem 0.75rem;
    border-radius: 9999px;
    cursor: pointer;
}
.btn-pedido:hover { background-color: var(--azul-oscuro); }
.btn-pedido:focus-visible { outline: 3px solid var(--amarillo); outline-offset: 2px; }
.btn-pedido svg, .barra-icono svg {
    width: 1.5rem; height: 1.5rem;
    fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.contador-pedido {
    position: absolute;
    top: 0.1rem;
    left: 1.65rem;
    min-width: 1.15rem;
    height: 1.15rem;
    padding: 0 0.3rem;
    border-radius: 9999px;
    background: var(--amarillo);
    color: var(--texto);
    font-size: 0.7rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}
.contador-pedido[hidden] { display: none; }
.pulso { animation: pulso 0.35s ease-out; }
@keyframes pulso { 50% { transform: scale(1.12); } }

/* Barra de abajo (solo celular) */
.barra-pedido { display: none; }
@media (max-width: 640px) {
    .btn-pedido { display: none; }
    .barra-pedido {
        position: fixed;
        left: 0.75rem; right: 0.75rem; bottom: 0.75rem;
        z-index: 30;
        display: flex;
        align-items: center;
        gap: 0.75rem;
        background: var(--azul);
        color: #fff;
        border: none;
        border-radius: 0.9rem;
        padding: 0.7rem 1rem;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
        cursor: pointer;
        text-align: left;
        font-family: inherit;
    }
    .barra-pedido[hidden] { display: none; }
    .barra-icono { position: relative; display: flex; }
    .barra-icono .contador-pedido { top: -0.4rem; left: 0.95rem; }
    .barra-texto { display: flex; flex-direction: column; flex: 1; line-height: 1.25; }
    .barra-texto strong { font-size: 0.95rem; }
    .barra-info { font-size: 0.8rem; opacity: 0.9; }
    .barra-flecha { font-size: 1.3rem; font-weight: 700; }
    body:has(#barra-pedido:not([hidden])) { padding-bottom: 5rem; }
}

/* ==========================================
   PANEL DEL PEDIDO
   ========================================== */
.overlay-pedido { position: fixed; inset: 0; background: rgba(11, 31, 58, 0.45); z-index: 65; }
.overlay-pedido[hidden], .panel-pedido[hidden] { display: none; }
.panel-pedido {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: min(92vw, 410px);
    background: #fff;
    z-index: 70;
    display: flex;
    flex-direction: column;
    box-shadow: -8px 0 28px rgba(0, 0, 0, 0.2);
    animation: entrar-der 0.2s ease-out;
}
@keyframes entrar-der { from { transform: translateX(100%); } to { transform: none; } }
.pedido-cabecera {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--azul);
    color: #fff;
    padding: 0.9rem 1rem;
    font-size: 1.1rem;
}
.pedido-cabecera .btn-cerrar { background: none; border: none; color: #fff; padding: 0.25rem; cursor: pointer; border-radius: 0.4rem; display: flex; }
.pedido-cabecera .btn-cerrar svg { width: 1.5rem; height: 1.5rem; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.lista-pedido { flex: 1; overflow-y: auto; padding: 0.5rem 1rem; }
.linea-pedido {
    display: grid;
    grid-template-columns: 56px 1fr auto;
    gap: 0.75rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--borde);
    align-items: start;
}
.linea-pedido img { width: 56px; height: 56px; object-fit: contain; border-radius: 0.4rem; border: 1px solid var(--borde); background: #fff; }
.linea-info { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
.linea-nombre { font-size: 0.9rem; font-weight: 600; line-height: 1.25; }
.linea-precio { font-size: 0.78rem; color: var(--gris); }
.linea-sub { font-weight: 800; font-size: 0.95rem; text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 0.4rem; white-space: nowrap; }
.linea-sub .quitar { background: none; border: none; color: var(--gris); font-size: 0.78rem; text-decoration: underline; cursor: pointer; padding: 0; }
.linea-sub .quitar:hover { color: var(--rojo); }
.pedido-vacio { text-align: center; color: var(--gris); padding: 3rem 1rem; display: flex; flex-direction: column; align-items: center; gap: 0.5rem; font-size: 0.9rem; }
.pedido-vacio svg { width: 3rem; height: 3rem; fill: none; stroke: var(--azul); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.pedido-vacio strong { color: var(--texto); font-size: 1rem; }
.pie-pedido { border-top: 1px solid var(--borde); padding: 1rem; display: flex; flex-direction: column; gap: 0.6rem; background: #fafbfc; }
.pie-pedido[hidden] { display: none; }
.fila-total { display: flex; justify-content: space-between; align-items: baseline; font-size: 1.05rem; }
.fila-total strong { font-size: 1.35rem; text-align: right; }
.nota-moneda { font-size: 0.78rem; color: var(--gris); }
.btn-enviar-pedido {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: #1fa855;
    color: #fff;
    border: none;
    border-radius: 9999px;
    padding: 0.85rem 1rem;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    font-family: inherit;
}
.btn-enviar-pedido:hover { background: #178a45; }
.btn-enviar-pedido svg { width: 1.3rem; height: 1.3rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.btn-vaciar { background: none; border: none; color: var(--gris); font-size: 0.85rem; text-decoration: underline; cursor: pointer; align-self: center; }
body.pedido-abierto { overflow: hidden; }

@media (max-width: 640px) {
    .zona-boton > * { flex: 1; }
    .stepper { justify-content: space-between; }
    .btn-agregar { font-size: 0.85rem; }
}
.linea-info .stepper { align-self: flex-start; flex: none; justify-content: flex-start; }
.aviso-consultar { font-size: 0.78rem; color: var(--rojo); font-weight: 600; }

/* ==========================================
   FOTO CUADRADA CON FONDO BLANCO + LUPA
   ========================================== */
.card-image-wrapper {
    height: auto;
    aspect-ratio: 1 / 1;
    padding: 0.75rem;
    background-color: #ffffff;
    overflow: hidden;
}
.card-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    cursor: zoom-in;
    transition: transform 0.25s ease;
}
.card:hover .card-image-wrapper img { transform: scale(1.04); }
.card-agotada:hover .card-image-wrapper img { transform: none; }

.btn-lupa {
    position: absolute;
    right: 0.5rem;
    bottom: 0.5rem;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 50%;
    border: 1px solid var(--borde);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--texto);
    transition: transform 0.15s, background-color 0.15s, color 0.15s;
}
.btn-lupa:hover, .btn-lupa:focus-visible { transform: scale(1.1); background: var(--azul); color: #fff; outline: none; }
.btn-lupa svg { width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }

/* ==========================================
   VISOR DE FOTO EN GRANDE
   ========================================== */
.visor-foto {
    position: fixed;
    inset: 0;
    z-index: 90;
    background: rgba(11, 31, 58, 0.78);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: aparecer 0.15s ease-out;
}
.visor-foto[hidden] { display: none; }
@keyframes aparecer { from { opacity: 0; } to { opacity: 1; } }
.visor-caja {
    position: relative;
    background: #fff;
    border-radius: 1rem;
    width: min(960px, 100%);
    max-height: calc(100vh - 2rem);
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}
.visor-marco {
    aspect-ratio: 1 / 1;
    max-height: calc(100vh - 2rem);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    cursor: zoom-in;
    background: #fff;
}
.visor-marco img { width: 100%; height: 100%; object-fit: contain; transition: transform 0.25s ease; }
.visor-foto.zoom .visor-marco { cursor: zoom-out; }
.visor-foto.zoom .visor-marco img { transform: scale(2.2); }
.visor-info {
    border-left: 1px solid var(--borde);
    padding: 3.2rem 1.25rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    overflow-y: auto;
}
.visor-nombre { font-size: 1.15rem; line-height: 1.3; }
.visor-precio { font-size: 1.6rem; font-weight: 800; }
.visor-desc { color: var(--gris); font-size: 0.92rem; line-height: 1.45; }
.visor-pista { margin-top: auto; font-size: 0.78rem; color: var(--gris); }
.visor-caja .btn-cerrar {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    z-index: 2;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 50%;
    border: none;
    background: var(--fondo);
    color: var(--texto);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.visor-caja .btn-cerrar:hover { background: var(--borde); }
.visor-caja .btn-cerrar svg { width: 1.4rem; height: 1.4rem; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
body.visor-abierto { overflow: hidden; }

@media (max-width: 720px) {
    .visor-caja { grid-template-columns: 1fr; grid-template-rows: auto auto; overflow-y: auto; }
    .visor-marco { padding: 1rem; max-height: 62vh; }
    .visor-info { border-left: none; border-top: 1px solid var(--borde); padding: 1rem 1.1rem 1.2rem; }
    .visor-precio { font-size: 1.35rem; }
}
@media (max-width: 400px) {
    .card-image-wrapper { padding: 0.5rem; }
    .btn-lupa { width: 1.9rem; height: 1.9rem; right: 0.35rem; bottom: 0.35rem; }
    .btn-lupa svg { width: 1rem; height: 1rem; }
}

/* ==========================================
   INTERRUPTOR DE MODO OSCURO (pie de página)
   ========================================== */
.switch-tema {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0.25rem auto 0.5rem;
    padding: 0.45rem 0.9rem 0.45rem 0.7rem;
    border-radius: 9999px;
    background: var(--superficie, #fff);
    border: 1px solid var(--borde);
    color: var(--texto);
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    user-select: none;
}
.switch-tema input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-tema .riel {
    position: relative;
    width: 3.1rem;
    height: 1.7rem;
    border-radius: 9999px;
    background: #cfd5df;
    transition: background-color 0.2s;
    flex-shrink: 0;
}
.switch-tema .perilla {
    position: absolute;
    top: 0.15rem;
    left: 0.15rem;
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: transform 0.2s ease;
}
.switch-tema .perilla::before { content: "☀️"; }
.switch-tema input:checked + .riel { background: var(--azul); }
.switch-tema input:checked + .riel .perilla { transform: translateX(1.4rem); }
.switch-tema input:checked + .riel .perilla::before { content: "🌙"; }
.switch-tema input:focus-visible + .riel { outline: 3px solid var(--amarillo); outline-offset: 2px; }

/* ==========================================
   MODO OSCURO
   ========================================== */
html[data-tema="oscuro"] {
    color-scheme: dark;
    --texto: #e8ecf3;
    --gris: #9aa4b5;
    --borde: #2c3445;
    --fondo: #222a3b;
    --verde: #5ccf3a;
    --rojo: #ff5a61;
    --azul-oscuro: #0a3d7a;
    --superficie: #171d2b;
    --pagina: #0f1420;
    --azul-suave: #16263f;
    --azul-texto: #5aa9ff;
}
html[data-tema="oscuro"] body { background-color: var(--pagina); }
html[data-tema="oscuro"] .navbar { background-color: #0a4182; }
html[data-tema="oscuro"] .search-box input {
    background: #1d2433 url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23e8ecf3' stroke-width='2.2' stroke-linecap='round'><circle cx='11' cy='11' r='7'/><path d='M20 20l-3.5-3.5'/></svg>") no-repeat 1rem center;
    color: var(--texto);
}
html[data-tema="oscuro"] .franja { background-color: #e0a800; }
html[data-tema="oscuro"] .paso { background-color: var(--azul-suave); }
html[data-tema="oscuro"] .btn-filtro { background-color: var(--superficie); border-color: #4a5468; color: var(--texto); }
html[data-tema="oscuro"] .btn-filtro:hover { background-color: var(--fondo); }
html[data-tema="oscuro"] .btn-filtro.active { background-color: var(--texto); border-color: var(--texto); color: var(--pagina); }
html[data-tema="oscuro"] .btn-filtro.chip-ofertas { border-color: var(--rojo); color: var(--rojo); }
html[data-tema="oscuro"] .btn-filtro.chip-ofertas:hover { background-color: rgba(255, 90, 97, 0.12); }
html[data-tema="oscuro"] .btn-filtro.chip-ofertas.active { background-color: var(--rojo); color: #fff; }
html[data-tema="oscuro"] .btn-subfiltro { background-color: var(--fondo); }

html[data-tema="oscuro"] .card { background-color: var(--superficie); border-color: var(--borde); }
html[data-tema="oscuro"] .card:hover { box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5); }
html[data-tema="oscuro"] .card-image-wrapper { background-color: #ffffff; margin: 0.5rem 0.5rem 0.25rem; border-radius: 0.4rem; }
html[data-tema="oscuro"] .btn-fav { background: rgba(255, 255, 255, 0.9); border-radius: 50%; }
html[data-tema="oscuro"] .badge.disponible { background-color: #1f3d16; color: #7ee05b; }
html[data-tema="oscuro"] .badge.agotado { background-color: #4a1a1d; color: #ff8a8f; }
html[data-tema="oscuro"] .badge.et-otra { background-color: var(--texto); color: var(--pagina); }
html[data-tema="oscuro"] .precio-antes .ahorro { background-color: rgba(92, 207, 58, 0.15); }
html[data-tema="oscuro"] .categoria-tag,
html[data-tema="oscuro"] .sub-titulo span,
html[data-tema="oscuro"] .acordeon .ver-todo,
html[data-tema="oscuro"] .footer a { color: var(--azul-texto); }
html[data-tema="oscuro"] .btn-wssp.secundario { background-color: var(--superficie); color: var(--texto); border-color: var(--texto); }
html[data-tema="oscuro"] .btn-wssp.secundario:hover { background-color: var(--fondo); }
html[data-tema="oscuro"] .stepper { background-color: var(--superficie); border-color: var(--azul-texto); }
html[data-tema="oscuro"] .stepper button { color: var(--azul-texto); }
html[data-tema="oscuro"] .stepper button:hover { background-color: var(--azul-suave); }

html[data-tema="oscuro"] .panel-categorias,
html[data-tema="oscuro"] .panel-pedido,
html[data-tema="oscuro"] .visor-caja { background-color: var(--superficie); }
html[data-tema="oscuro"] .item-cat:hover,
html[data-tema="oscuro"] .item-cat.resaltado,
html[data-tema="oscuro"] .item-cat:focus-visible,
html[data-tema="oscuro"] .item-cat[aria-expanded="true"] { background-color: var(--azul-suave); color: #cfe4ff; }
html[data-tema="oscuro"] .acordeon { background-color: #131926; }
html[data-tema="oscuro"] .item-sub:hover { color: var(--azul-texto); }
html[data-tema="oscuro"] .pie-pedido { background-color: #131926; }
html[data-tema="oscuro"] .pedido-cabecera,
html[data-tema="oscuro"] .panel-cabecera { background-color: #0a4182; }
html[data-tema="oscuro"] .visor-caja .btn-cerrar { background-color: var(--fondo); color: var(--texto); }
html[data-tema="oscuro"] .visor-info { border-color: var(--borde); }
html[data-tema="oscuro"] .carga-manual { background-color: var(--azul-suave); }
html[data-tema="oscuro"] .footer { background-color: #0b101a; border-color: var(--borde); }
html[data-tema="oscuro"] .switch-tema { background: var(--superficie); }
html[data-tema="oscuro"] .switch-tema .riel { background: #3a4357; }
html[data-tema="oscuro"] .switch-tema input:checked + .riel { background: var(--azul); }

/* Transición suave al cambiar de modo */
html.cambiando-tema *, html.cambiando-tema *::before { transition: background-color 0.25s, color 0.25s, border-color 0.25s !important; }
.footer .switch-tema { align-self: center; }
/* Elementos que van sobre fondo blanco: mantienen tinta oscura en modo oscuro */
html[data-tema="oscuro"] .btn-moneda.activo { color: #1b1c1d; }
html[data-tema="oscuro"] .btn-fav svg { stroke: #1b1c1d; }
html[data-tema="oscuro"] .btn-fav.activo svg { stroke: #de1c24; fill: #de1c24; }
html[data-tema="oscuro"] .btn-lupa { color: #1b1c1d; }
html[data-tema="oscuro"] .btn-lupa:hover, html[data-tema="oscuro"] .btn-lupa:focus-visible { color: #fff; }
/* Modo oscuro: botón de Ofertas con color relleno */
html[data-tema="oscuro"] .btn-filtro.chip-ofertas { background-color: #d42a31; border-color: #d42a31; color: #ffffff; }
html[data-tema="oscuro"] .btn-filtro.chip-ofertas:hover { background-color: #e8363d; border-color: #e8363d; }
html[data-tema="oscuro"] .btn-filtro.chip-ofertas.active { background-color: #ff5a61; border-color: #ffffff; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25); color: #ffffff; }
/* Modo oscuro: botones de categorías y subcategorías con color relleno */
html[data-tema="oscuro"] .btn-filtro { background-color: #262f42; border-color: #262f42; color: #e8ecf3; }
html[data-tema="oscuro"] .btn-filtro:hover { background-color: #313c54; border-color: #313c54; }
html[data-tema="oscuro"] .btn-filtro.active { background-color: #e8ecf3; border-color: #e8ecf3; color: #0f1420; }
html[data-tema="oscuro"] .btn-subfiltro { background-color: #1f2737; border-color: #1f2737; color: #e8ecf3; }
html[data-tema="oscuro"] .btn-subfiltro:hover { border-color: var(--azul-texto); }
html[data-tema="oscuro"] .btn-subfiltro.active { background-color: var(--azul); border-color: var(--azul); color: #fff; }

/* ==========================================
   VISOR: GALERÍA DE FOTOS + AGREGAR
   ========================================== */
.visor-galeria { position: relative; display: flex; flex-direction: column; min-width: 0; background: #fff; }
.visor-galeria .visor-marco { max-height: calc(100vh - 2rem - 84px); }
.visor-flecha {
    position: absolute;
    top: calc(50% - 42px);
    transform: translateY(-50%);
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 50%;
    border: 1px solid #e3e4e5;
    background: rgba(255, 255, 255, 0.95);
    color: #1b1c1d;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
}
.visor-flecha.ant { left: 0.75rem; }
.visor-flecha.sig { right: 0.75rem; }
.visor-flecha:hover { background: #0071dc; color: #fff; }
.visor-flecha svg { width: 1.3rem; height: 1.3rem; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.visor-foto.varias .visor-flecha { display: flex; }
.visor-foto.zoom .visor-flecha { display: none; }
.visor-contador {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    background: rgba(27, 28, 29, 0.75);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.15rem 0.55rem;
    border-radius: 9999px;
    z-index: 2;
}
.visor-contador:empty { display: none; }
.visor-miniaturas {
    display: flex;
    gap: 0.5rem;
    padding: 0.6rem 0.9rem 0.9rem;
    overflow-x: auto;
    scrollbar-width: thin;
    background: #fff;
}
.visor-miniaturas:empty { display: none; }
.visor-miniaturas .mini {
    flex: 0 0 auto;
    width: 60px;
    height: 60px;
    padding: 4px;
    border-radius: 0.5rem;
    border: 2px solid #e3e4e5;
    background: #fff;
    cursor: pointer;
    opacity: 0.7;
}
.visor-miniaturas .mini img { width: 100%; height: 100%; object-fit: contain; }
.visor-miniaturas .mini:hover { opacity: 1; }
.visor-miniaturas .mini[aria-selected="true"] { border-color: #0071dc; opacity: 1; }

.visor-info .visor-etiqueta { position: static; align-self: flex-start; }
.visor-precio { font-size: 1.6rem; font-weight: 800; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.5rem; }
.visor-precio .visor-antes { font-size: 0.95rem; font-weight: 500; color: var(--gris); }
.visor-precio .ahorro { font-size: 0.8rem; font-weight: 700; background: #e7f4e0; color: var(--verde); padding: 0.1rem 0.4rem; border-radius: 0.25rem; }
.visor-precio .precio-oferta { color: var(--verde); }
.visor-boton { margin-top: 0.5rem; }
.visor-boton .btn-wssp { font-size: 1rem; padding: 0.7rem 1.4rem; }
.visor-boton .stepper { height: 2.75rem; }
.visor-boton .stepper button { width: 2.9rem; font-size: 1.35rem; }
.visor-boton .stepper .cant { min-width: 2.2rem; font-size: 1.05rem; }
.visor-boton > * { flex: none; }

/* Contador de fotos en la tarjeta */
.pill-fotos {
    position: absolute;
    left: 0.5rem;
    bottom: 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: rgba(27, 28, 29, 0.72);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.15rem 0.45rem;
    border-radius: 9999px;
}
.pill-fotos svg { width: 0.85rem; height: 0.85rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }

@media (max-width: 720px) {
    .visor-galeria .visor-marco { max-height: 48vh; }
    .visor-flecha { width: 2.2rem; height: 2.2rem; }
    .visor-boton > * { flex: 1; }
    .visor-boton .stepper { justify-content: space-between; }
    .visor-miniaturas .mini { width: 52px; height: 52px; }
}

html[data-tema="oscuro"] .visor-precio .ahorro { background: rgba(92, 207, 58, 0.15); }
html[data-tema="oscuro"] .visor-info .badge.disponible { background-color: #1f3d16; color: #7ee05b; }

/* ==========================================
   CONDICIÓN, ETIQUETAS DE BÚSQUEDA Y VIDEO
   ========================================== */
.condicion {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.76rem;
    font-weight: 700;
    align-self: flex-start;
}
.condicion svg { width: 0.95rem; height: 0.95rem; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.condicion.grande { font-size: 0.9rem; }
.condicion.grande svg { width: 1.1rem; height: 1.1rem; }
.cond-nuevo { color: #2a8703; }
.cond-usado { color: #b26b00; }
.cond-reacond { color: #0062c4; }

.visor-tags-bloque { display: flex; flex-direction: column; gap: 0.45rem; margin-top: 0.25rem; }
.visor-tags-bloque[hidden] { display: none; }
.visor-tags-titulo { font-size: 0.75rem; font-weight: 700; color: var(--gris); text-transform: uppercase; letter-spacing: 0.03em; }
.visor-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tag-chip {
    border: 1px solid var(--borde);
    background: var(--fondo);
    color: var(--texto);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.3rem 0.7rem;
    border-radius: 9999px;
    cursor: pointer;
    font-family: inherit;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.tag-chip:hover, .tag-chip:focus-visible { border-color: var(--azul); color: var(--azul); outline: none; }
.tag-chip.tag-cat { background: #e6f1fc; border-color: #e6f1fc; color: var(--azul-oscuro); }
.tag-chip.cond-nuevo { color: #2a8703; }
.tag-chip.cond-usado { color: #b26b00; }
.tag-chip.cond-reacond { color: #0062c4; }

.aviso-busqueda {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    background: #e6f1fc;
    color: var(--texto);
    border-radius: 0.6rem;
    padding: 0.6rem 0.9rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}
.aviso-busqueda[hidden] { display: none; }
.aviso-busqueda button { background: none; border: none; color: var(--azul); font-weight: 700; cursor: pointer; font-size: 0.85rem; font-family: inherit; }
.aviso-busqueda button:hover { text-decoration: underline; }
.search-box input::-webkit-search-cancel-button { cursor: pointer; }

/* Video de YouTube en la galería */
.visor-video { width: 100%; aspect-ratio: 16 / 9; }
.visor-video[hidden] { display: none; }
.visor-video iframe { width: 100%; height: 100%; border: 0; border-radius: 0.5rem; background: #000; }
.visor-foto.en-video .visor-marco { cursor: default; }
.mini-video { position: relative; }
.mini-video img { object-fit: cover !important; border-radius: 0.3rem; }
.mini-video svg {
    position: absolute;
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
    width: 1.6rem; height: 1.6rem;
    padding: 0.3rem;
    border-radius: 50%;
    background: rgba(222, 28, 36, 0.92);
    fill: #fff;
}
.pill-video {
    position: absolute;
    left: 0.5rem;
    bottom: 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    background: rgba(222, 28, 36, 0.9);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.15rem 0.45rem;
    border-radius: 9999px;
}
.pill-video svg { width: 0.8rem; height: 0.8rem; fill: currentColor; }
.pill-fotos + .pill-video { left: 3.4rem; }

/* Modo oscuro */
html[data-tema="oscuro"] .cond-nuevo { color: #7ee05b; }
html[data-tema="oscuro"] .cond-usado { color: #f0b54a; }
html[data-tema="oscuro"] .cond-reacond { color: #5aa9ff; }
html[data-tema="oscuro"] .tag-chip { background: #262f42; border-color: #262f42; }
html[data-tema="oscuro"] .tag-chip.tag-cat { background: var(--azul-suave); border-color: var(--azul-suave); color: #cfe4ff; }
html[data-tema="oscuro"] .tag-chip:hover { border-color: var(--azul-texto); color: var(--azul-texto); }
html[data-tema="oscuro"] .aviso-busqueda { background: var(--azul-suave); }
html[data-tema="oscuro"] .aviso-busqueda button { color: var(--azul-texto); }

/* "Ver más" de la descripción en la ventana del producto */
.visor-desc { white-space: pre-line; }
.ver-mas {
    background: none;
    border: none;
    padding: 0;
    color: var(--azul);
    font-weight: 700;
    font-size: inherit;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
}
.ver-mas:hover { text-decoration: underline; }
html[data-tema="oscuro"] .ver-mas { color: var(--azul-texto); }
