:root {
    --principal: #67087b;        /* morado del logo */
    --principal-suave: #f3e9f6;  /* morado muy lavado, para fondos */
    --texto: #1c1c1e;
    --texto-gris: #6b7280;
    --texto-gris-oscuro: #4b5563; /* para las migas de pan */
    --borde: #e3e3e6;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background: #f5f5f7;
    color: var(--texto);
    font-family: 'Segoe UI', Arial, sans-serif;
}

/* ============ HEADER ============ */

.contenedor {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

.barra-superior {
    background: var(--principal);
    color: #fff;
    font-size: 12.5px;
}

.barra-superior .contenedor {
    display: flex;
    align-items: center;
    gap: 22px;
    height: 34px;
}

.barra-superior span {
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: .92;
}

.barra-superior .separador {
    opacity: .45;
}

.top-bar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .07);
}

.top-bar .contenedor {
    display: flex;
    align-items: center;
    gap: 24px;
    padding-top: 12px;
    padding-bottom: 12px;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}

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

/* --- buscador --- */

.buscador-wrap {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1;
    max-width: 620px;
    height: 44px;
    background: #ffffff;
    border: 1px solid #d5d5da;
    border-radius: 10px;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.buscador-wrap:focus-within {
    border-color: var(--principal);
    box-shadow: 0 0 0 3px rgba(103, 8, 123, .12);
}

.buscador-wrap .icono-lupa {
    width: 18px;
    height: 18px;
    margin-left: 14px;
    color: #9aa0a6;
    flex-shrink: 0;
}

.buscador {
    flex: 1;
    height: 100%;
    padding: 0 12px;
    border: none;
    outline: none;
    background: transparent;
    font-size: 14.5px;
    color: var(--texto);
    font-family: inherit;
}

.buscador::placeholder {
    color: #9aa0a6;
}

.btn-buscar {
    height: 34px;
    margin-right: 5px;
    padding: 0 20px;
    background: var(--principal);
    border: none;
    border-radius: 7px;
    color: #fff;
    font-size: 13.5px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .15s ease;
}

.btn-buscar:hover {
    background: #550666;
}

/* --- carrito --- */

.carrito-icono {
    position: relative;
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--texto);
    cursor: pointer;
    flex-shrink: 0;
    transition: background .15s ease, color .15s ease;
}

.carrito-icono:hover {
    background: var(--principal-suave);
    color: var(--principal);
}

.carrito-icono svg {
    width: 24px;
    height: 24px;
}

.carrito-badge {
    position: absolute;
    top: 3px;
    right: 2px;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border-radius: 10px;
    background: var(--principal);
    border: 2px solid #fff;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 15px;
    text-align: center;
}

.carrito-badge.vacio {
    display: none;
}

/* --- responsive header --- */

@media (max-width: 720px) {
    .contenedor { padding: 0 16px; }

    .barra-superior .contenedor { gap: 12px; font-size: 11.5px; }
    .barra-superior .ocultar-movil { display: none; }

    .top-bar .contenedor {
        flex-wrap: wrap;
        gap: 12px;
    }

    .logo img { height: 40px; }

    .buscador-wrap {
        order: 3;
        flex-basis: 100%;
        max-width: none;
    }
}

/* ============ /HEADER ============ */

main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px 24px;
}

.titulo-catalogo {
    margin-bottom: 20px;
    font-size: 24px;
}

/* Link para sacar el filtro de categoria, va pegado abajo del titulo */
.aviso-busqueda {
    margin: -14px 0 20px;
}

.link-ampliar {
    padding: 0;
    border: 0;
    background: none;
    color: var(--principal);
    font-size: 14px;
    cursor: pointer;
}

.link-ampliar:hover {
    text-decoration: underline;
}

.grid-productos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

/* Cinco filas fijas: foto, titulo, precio, info y acciones.
   El titulo es el 1fr: se estira y empuja el precio y los botones hacia abajo,
   asi quedan a la misma altura en todas las cards aunque los titulos midan
   distinto. Las filas se dibujan siempre, aun vacias (ver renderItems). */
.card-producto {
    background: #ffffff;
    border: 1px solid var(--borde);
    border-radius: 8px;
    padding: 14px;
    color: inherit;
    display: grid;
    grid-template-rows: auto 1fr auto auto auto;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.card-producto:hover {
    border-color: var(--principal);
    box-shadow: 0 2px 10px rgba(103, 8, 123, .12);
}

/* La card ya no es un <a>, asi que los dos links de adentro se desubrayan aca */
.card-producto .card-foto,
.card-producto .titulo {
    text-decoration: none;
    color: inherit;
}

.card-producto .titulo:hover {
    color: var(--principal);
}

.card-producto img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    background: #ffffff;
    border-radius: 6px;
    margin-bottom: 10px;
    display: block;
}

.card-producto .titulo {
    font-size: 14px;
    line-height: 1.3;
    margin-bottom: 8px;
}

.card-producto .precio {
    font-size: 18px;
    font-weight: 700;
    color: var(--principal);
}

.sin-stock {
    color: var(--texto-gris);
    font-size: 13px;
}

.paginado {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 34px;
}

.paginado.cargando {
    opacity: .5;
    pointer-events: none;
}

.paginado button {
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    background: #ffffff;
    border: 1px solid var(--borde);
    border-radius: 6px;
    color: var(--texto);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease, color .15s ease;
}

.paginado button:hover:not(:disabled) {
    border-color: var(--principal);
    color: var(--principal);
    background: var(--principal-suave);
}

.paginado button.actual:disabled {
    background: var(--principal);
    border-color: var(--principal);
    color: #fff;
    cursor: default;
}

.paginado button.flecha:disabled {
    color: #c4c4ca;
    cursor: default;
}

.paginado .puntos {
    padding: 0 2px;
    color: var(--texto-gris);
}

@media (max-width: 720px) {
    .paginado { gap: 4px; }
    .paginado button { min-width: 34px; height: 34px; padding: 0 7px; font-size: 13px; }
}

.detalle-producto {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px 50px;
    align-items: start;
    max-width: 1100px;
    margin: 0 auto;
}

/* Caracteristicas y descripcion van abajo de todo, ocupando las dos columnas.
   1 / -1 quiere decir "de la primera raya hasta la ultima". */
.detalle-abajo {
    grid-column: 1 / -1;
}

/* La caja de la foto es siempre cuadrada, que es la proporcion que usan casi todas
   las publicaciones. Las que vienen mas altas o mas anchas entran enteras igual
   (object-fit: contain) y quedan con aire a los costados, en vez de estirar la
   pagina para abajo. */
.detalle-producto img.principal {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    background: #ffffff;
    border: 1px solid var(--borde);
    border-radius: 8px;
    padding: 20px;
    cursor: zoom-in;
}

/* --- miniaturas del producto --- */
.miniaturas {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.miniatura {
    width: 62px;
    height: 62px;
    padding: 4px;
    background: #ffffff;
    border: 1px solid var(--borde);
    border-radius: 6px;
    object-fit: contain;
    cursor: pointer;
}

.miniatura:hover {
    border-color: var(--principal);
}

.miniatura.activa {
    border-color: var(--principal);
    box-shadow: 0 0 0 1px var(--principal);
}

/* --- zoom de la foto (lightbox) --- */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .85);
}

/* Sin esto el display:flex de arriba le gana al hidden y queda siempre visible */
.lightbox[hidden] {
    display: none;
}

.lb-img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
}

.lb-cerrar,
.lb-flecha {
    position: absolute;
    border: 0;
    background: none;
    color: #ffffff;
    line-height: 1;
    cursor: pointer;
}

.lb-cerrar {
    top: 14px;
    right: 20px;
    font-size: 38px;
}

.lb-flecha {
    top: 50%;
    transform: translateY(-50%);
    padding: 10px 16px;
    font-size: 50px;
}

.lb-antes {
    left: 6px;
}

.lb-despues {
    right: 6px;
}

.lb-contador {
    position: absolute;
    bottom: 16px;
    color: #ffffff;
    font-size: 14px;
}

/* Mientras el zoom esta abierto, la pagina de atras no scrollea */
body.sin-scroll {
    overflow: hidden;
}

/* --- migas de pan --- */
.migas {
    margin-bottom: 10px;
    font-size: 18px;
    color: var(--texto-gris-oscuro);
}

.migas a {
    color: var(--texto-gris-oscuro);
    text-decoration: none;
}

.migas a:hover {
    color: var(--principal);
    text-decoration: underline;
}

/* --- cantidad + agregar --- */
.compra {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

/* Caja con - 1 + para elegir cuantas unidades van al carrito */
.stepper {
    display: inline-flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid var(--borde);
    border-radius: 10px;
}

.stepper-btn {
    width: 50px;
    height: 56px;
    background: none;
    border: none;
    border-radius: 10px;
    color: var(--texto);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.stepper-btn:hover:not(:disabled) {
    background: var(--principal-suave);
    color: var(--principal);
}

.stepper-btn:disabled {
    color: #c4c4ca;
    cursor: default;
}

/* Ancho fijo para que la caja no se mueva al pasar de 9 a 10 */
.stepper-valor {
    min-width: 38px;
    text-align: center;
    color: var(--principal);
    font-size: 17px;
    font-weight: 700;
}

.cantidad-wrap {
    font-size: 14px;
    color: var(--texto-gris);
}

.cantidad {
    margin-left: 6px;
    padding: 12px 10px;
    background: #ffffff;
    border: 1px solid var(--borde);
    border-radius: 6px;
    font-size: 15px;
    cursor: pointer;
}

.btn-compartir {
    display: block;
    margin-top: 14px;
    padding: 12px 22px;
    background: none;
    border: 1px solid var(--borde);
    border-radius: 8px;
    color: var(--texto);
    font-size: 15px;
    cursor: pointer;
}

.btn-compartir:hover {
    border-color: var(--principal);
    color: var(--principal);
}

/* --- caracteristicas, abajo de las fotos --- */
/* El margen de arriba ya lo pone el gap de la grilla */
.atributos {
    margin-top: 0;
}

.atributos-titulo {
    margin-bottom: 14px;
    font-size: 19px;
}

/* La tabla va dentro de una caja blanca redondeada. El overflow es para que las
   filas de color no se escapen por las esquinas. */
.tabla-atributos {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid var(--borde);
    border-radius: 10px;
    font-size: 14px;
}

.tabla-atributos th,
.tabla-atributos td {
    padding: 13px 18px;
    text-align: left;
    vertical-align: top;
    line-height: 1.4;
}

/* Angosta, porque ahora la tabla ocupa todo el ancho de la pagina */
.tabla-atributos th {
    width: 26%;
    color: var(--texto-gris);
    font-weight: 400;
}

.tabla-atributos td {
    font-weight: 600;
}

/* Rayita separadora entre filas, menos arriba de la primera */
.tabla-atributos tr + tr th,
.tabla-atributos tr + tr td {
    border-top: 1px solid #f0f0f2;
}

.tabla-atributos tr:nth-child(even) {
    background: #fafafb;
}

.link-ampliar {
    display: inline-block;
    margin-top: 12px;
    padding: 0;
    background: none;
    border: none;
    color: var(--principal);
    font-size: 14px;
    cursor: pointer;
}

.link-ampliar:hover {
    text-decoration: underline;
}

/* --- descripcion, abajo de las caracteristicas --- */
.bloque-descripcion {
    margin-top: 40px;
}

.descripcion-titulo {
    margin-bottom: 14px;
    font-size: 19px;
}

/* --- productos relacionados --- */
.relacionados {
    max-width: 1100px;
    margin: 50px auto 0;
}

.relacionados-titulo {
    margin-bottom: 16px;
    font-size: 18px;
}

.grid-relacionados {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
}

.card-chica {
    display: block;
    padding: 12px;
    background: #ffffff;
    border: 1px solid var(--borde);
    border-radius: 8px;
    color: var(--texto);
    text-decoration: none;
}

.card-chica:hover {
    border-color: var(--principal);
}

.card-chica img {
    width: 100%;
    height: 120px;
    object-fit: contain;
}

.card-chica-titulo {
    margin-top: 8px;
    font-size: 13px;
    line-height: 1.3;
    /* Corta el titulo en dos lineas para que las cards queden parejas */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-chica-precio {
    margin-top: 6px;
    font-size: 16px;
    font-weight: 700;
}

/* --- favoritos --- */
.favoritos-icono {
    position: relative;
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    color: var(--texto);
    flex-shrink: 0;
    transition: background .15s ease, color .15s ease;
}

.favoritos-icono:hover {
    background: var(--principal-suave);
    color: var(--principal);
}

.favoritos-icono svg {
    width: 24px;
    height: 24px;
}

/* Con los dos iconos juntos, el margen automatico lo tiene que poner solo el primero */
.favoritos-icono + .carrito-icono {
    margin-left: 0;
}

/* El corazon va flotando arriba a la derecha de la card */
.card-producto,
.card-favorito {
    position: relative;
}

.corazon {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: rgba(255, 255, 255, .9);
    border: 1px solid var(--borde);
    border-radius: 50%;
    cursor: pointer;
}

.corazon svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: var(--texto-gris);
    stroke-width: 1.8;
}

.corazon:hover svg {
    stroke: var(--principal);
}

.corazon.activo svg {
    fill: var(--principal);
    stroke: var(--principal);
}

/* En la pagina de producto no flota: va al lado del boton de compartir */
.corazon-grande {
    position: static;
    width: 40px;
    height: 40px;
}

.corazon-grande svg {
    width: 21px;
    height: 21px;
}

.acciones {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
}

.acciones .btn-compartir {
    margin-top: 0;
}

.favoritos-vacio {
    color: var(--texto-gris);
}

/* Navegador que no deja guardar: no se muestra nada de favoritos */
body.sin-favoritos .corazon,
body.sin-favoritos .favoritos-icono {
    display: none;
}

.detalle-producto h1 {
    font-size: 27px;
    line-height: 1.3;
    margin-bottom: 22px;
}

/* 42px + 30% */
.detalle-producto .precio {
    font-size: 54.6px;
    font-weight: 700;
    line-height: 1.1;
    color: var(--principal);
    text-align: center;
    margin-bottom: 6px;
}

/* Centrado respecto del titulo: como es un bloque, ocupa el mismo ancho que el
   h1 y el text-align lo deja al medio de esa misma caja. */
.precio-sin-iva {
    margin-bottom: 28px;
    color: var(--texto-gris);
    font-size: 19.5px;
    text-align: center;
}

.detalle-producto .descripcion {
    white-space: pre-line;
    color: #444;
    line-height: 1.5;
}

/* --- variantes: una foto chica por variante, debajo del precio --- */
.variantes {
    margin-bottom: 24px;
}

.variantes-titulo {
    margin-bottom: 10px;
    color: var(--texto-gris);
    font-size: 15px;
}

.variantes-titulo strong {
    color: var(--texto);
}

.variantes-fila {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.variante {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 72px;
    padding: 4px;
    background: #ffffff;
    border: 1px solid var(--borde);
    border-radius: 6px;
    font: inherit;
    cursor: pointer;
}

/* Sin esto el display de arriba le gana al atributo hidden y no se esconden */
.stepper[hidden],
.variante[hidden] {
    display: none;
}

/* Las hermanas de familia son links a otra publicacion */
a.variante {
    text-decoration: none;
}

.variante img {
    width: 100%;
    height: 56px;
    object-fit: contain;
}

.variante-nombre {
    color: var(--texto);
    font-size: 12px;
    line-height: 1.2;
    text-align: center;
    word-break: break-word;
}

.variante:hover {
    border-color: var(--principal);
}

.variante.activa {
    border-color: var(--principal);
    box-shadow: 0 0 0 1px var(--principal);
}

.variante.sin-stock img {
    opacity: 0.4;
}

.variante.sin-stock .variante-nombre {
    color: var(--texto-gris);
    text-decoration: line-through;
}

.btn-agregar {
    flex: 1;
    min-width: 220px;
    padding: 17px 28px;
    background: var(--principal);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-weight: 700;
    font-size: 17px;
    cursor: pointer;
}

.btn-agregar:disabled {
    background: #c4c4ca;
    cursor: default;
}

@media (max-width: 800px) {
    .detalle-producto { grid-template-columns: 1fr; }
}

.btn-agregar-card {
    margin-top: 10px;
    padding: 9px 12px;
    width: 100%;
    background: var(--principal);
    border: none;
    border-radius: 6px;
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
}

.btn-agregar-card:disabled {
    background: #2d6a3f;
    cursor: default;
}

.entrega {
    margin-top: 6px;
    font-size: 12px;
    color: var(--texto-gris);
}

.envio-gratis {
    margin-top: 4px;
    font-size: 13px;
    font-weight: 700;
    color: #00a650;
}

.envio-gratis.grande {
    font-size: 16px;
    margin-top: 0;
    margin-bottom: 18px;
}

/* ============ MENU DE CATEGORIAS ============ */

.layout-catalogo {
    display: grid;
    grid-template-columns: 230px 1fr;
    gap: 28px;
    align-items: start;
}

.menu-categorias {
    position: sticky;
    top: 84px;
    background: #ffffff;
    border: 1px solid var(--borde);
    border-radius: 8px;
    padding: 16px 14px;
}

.menu-titulo {
    font-size: 15px;
    margin-bottom: 10px;
    color: var(--texto);
}

.lista-categorias {
    list-style: none;
}

.cat-item {
    display: flex;
    align-items: baseline;
    gap: 6px;
    width: 100%;
    padding: 7px 8px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--texto);
    font-size: 13.5px;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}

.cat-item:hover {
    background: var(--principal-suave);
    color: var(--principal);
}

.cat-item.activa {
    background: var(--principal-suave);
    color: var(--principal);
    font-weight: 700;
}

.cat-nombre {
    flex: 1;
    line-height: 1.3;
}

.cat-cantidad {
    color: var(--texto-gris);
    font-size: 12px;
    font-weight: 400;
    flex-shrink: 0;
}

.cat-item.activa .cat-cantidad {
    color: var(--principal);
}

.btn-ver-mas {
    margin-top: 8px;
    padding: 6px 8px;
    background: transparent;
    border: none;
    color: var(--principal);
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
}

.btn-ver-mas:hover {
    text-decoration: underline;
}

/* En movil el menu pasa a ser una fila de chips que se desliza */
@media (max-width: 900px) {
    .layout-catalogo {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .menu-categorias {
        position: static;
        padding: 12px;
    }

    .menu-titulo {
        margin-bottom: 8px;
    }

    .lista-categorias {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .cat-item {
        width: auto;
        white-space: nowrap;
        border: 1px solid var(--borde);
        padding: 7px 12px;
    }
}

/* ============ FOOTER ============ */

.pie {
    background: #ffffff;
    border-top: 1px solid var(--borde);
    margin-top: 48px;
}

.pie-grilla {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    padding-top: 36px;
    padding-bottom: 32px;
}

.pie-logo {
    height: 38px;
    width: auto;
    display: block;
    margin-bottom: 12px;
}

.pie-texto {
    color: var(--texto-gris);
    font-size: 13.5px;
    line-height: 1.6;
    max-width: 380px;
}

.pie-titulo {
    font-size: 14px;
    color: var(--texto);
    margin-bottom: 12px;
}

.pie-lista {
    list-style: none;
}

.pie-lista li {
    margin-bottom: 8px;
}

.pie-lista a {
    color: var(--texto-gris);
    text-decoration: none;
    font-size: 13.5px;
}

.pie-lista a:hover {
    color: var(--principal);
}

.pie-abajo {
    border-top: 1px solid var(--borde);
    background: var(--principal-suave);
}

.pie-abajo .contenedor {
    display: flex;
    align-items: center;
    min-height: 46px;
    font-size: 12.5px;
    color: var(--texto-gris);
}

@media (max-width: 900px) {
    .pie-grilla {
        grid-template-columns: 1fr 1fr;
        gap: 28px;
    }

    .pie-marca {
        grid-column: 1 / -1;
    }
}

@media (max-width: 560px) {
    .pie-grilla {
        grid-template-columns: 1fr;
        gap: 24px;
        padding-top: 28px;
    }

    .pie-abajo .contenedor {
        min-height: 42px;
        font-size: 12px;
    }
}

/* ============ WHATSAPP ============ */

/* La fila de abajo de la tarjeta: el Agregar se estira y el de WhatsApp
   queda cuadrado a la derecha. Si no hay numero, el Agregar ocupa todo. */
.acciones-card {
    display: flex;
    align-items: stretch;
    gap: 8px;
    margin-top: 10px;
}

.acciones-card .btn-agregar-card {
    flex: 1;
    margin-top: 0;
    width: auto;
}

.btn-wa-card {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 36px;
    background: #25d366;
    border-radius: 6px;
    text-decoration: none;
}

.btn-wa-card:hover {
    background: #1eb855;
}

.btn-wa-card svg {
    width: 19px;
    height: 19px;
    fill: #ffffff;
}

/* Sin stock: no hay boton Agregar, el texto ocupa el lugar y el de WhatsApp
   queda igual a la derecha. Es justo cuando mas sirve preguntar. */
.acciones-card .sin-stock {
    flex: 1;
    align-self: center;
}

/* Pagina de producto: va en la fila de Compartir y el corazon */
.btn-wa-grande {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 14px;
    height: 40px;
    background: #25d366;
    border-radius: 6px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.btn-wa-grande:hover {
    background: #1eb855;
}

.btn-wa-grande svg {
    width: 19px;
    height: 19px;
    fill: #ffffff;
}

/* Flotante abajo a la derecha. Se queda fijo aunque se scrollee. */
.btn-wa-flotante {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    background: #25d366;
    border-radius: 50%;
    box-shadow: 0 3px 12px rgba(0, 0, 0, .25);
}

.btn-wa-flotante:hover {
    background: #1eb855;
}

.btn-wa-flotante svg {
    width: 30px;
    height: 30px;
    fill: #ffffff;
}

@media (max-width: 700px) {
    .btn-wa-flotante {
        right: 14px;
        bottom: 14px;
        width: 48px;
        height: 48px;
    }
}

/* ============ PAGINA DEL CARRITO ============ */

/* El icono del header ahora es un link a carrito.php */
a.carrito-icono {
    text-decoration: none;
}

.carrito-actualizando {
    color: var(--texto-gris);
    margin-bottom: 14px;
}

.carrito-avisos {
    background: #fff8e1;
    border: 1px solid #f3d27a;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 18px;
    font-size: 14px;
    line-height: 1.5;
}

/* Lista a la izquierda y resumen fijo a la derecha */
.carrito-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 24px;
    align-items: start;
}

.carrito-lista {
    background: #fff;
    border: 1px solid var(--borde);
    border-radius: 12px;
}

.carrito-renglon {
    display: grid;
    grid-template-columns: 96px 1fr auto 130px;
    gap: 18px;
    align-items: center;
    padding: 18px;
    border-bottom: 1px solid var(--borde);
}

.carrito-renglon:last-child {
    border-bottom: none;
}

.carrito-foto img {
    width: 96px;
    height: 96px;
    object-fit: contain;
    display: block;
}

.carrito-titulo {
    color: var(--texto);
    text-decoration: none;
    font-size: 16px;
    line-height: 1.35;
}

.carrito-titulo:hover {
    color: var(--principal);
}

.carrito-unitario {
    color: var(--texto-gris);
    font-size: 14px;
    margin-top: 6px;
}

.carrito-estado {
    color: #b45309;
    font-size: 14px;
    margin-top: 6px;
}

.carrito-quitar {
    margin-top: 8px;
    padding: 0;
    background: none;
    border: none;
    color: var(--principal);
    font-size: 14px;
    cursor: pointer;
}

.carrito-quitar:hover {
    text-decoration: underline;
}

/* Stepper mas bajo que el de la pagina de producto */
.carrito-cant .stepper-btn {
    width: 40px;
    height: 42px;
}

.carrito-total-renglon {
    text-align: right;
    font-size: 18px;
    font-weight: 700;
}

.carrito-renglon.no-suma img {
    opacity: .5;
}

.carrito-resumen {
    background: #fff;
    border: 1px solid var(--borde);
    border-radius: 12px;
    padding: 20px;
    position: sticky;
    top: 20px;
}

.carrito-resumen h2 {
    font-size: 20px;
    margin-bottom: 16px;
}

.resumen-fila {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 16px;
}

.resumen-gris {
    color: var(--texto-gris);
}

.resumen-total {
    border-top: 1px solid var(--borde);
    margin-top: 8px;
    padding-top: 14px;
    font-size: 22px;
    font-weight: 700;
}

@media (max-width: 900px) {
    .carrito-layout {
        grid-template-columns: 1fr;
    }

    .carrito-resumen {
        position: static;
    }
}

@media (max-width: 560px) {
    .carrito-renglon {
        grid-template-columns: 72px 1fr;
        gap: 12px;
    }

    .carrito-foto img {
        width: 72px;
        height: 72px;
    }

    .carrito-cant {
        grid-column: 2;
    }

    .carrito-total-renglon {
        grid-column: 2;
        text-align: left;
    }
}

.resumen-gratis {
    color: #00a650;
    font-weight: 700;
}

/* Cantidad de un renglon que no suma (sin stock, pausado...) */
.carrito-cant-texto {
    color: var(--texto-gris);
    font-size: 15px;
}

/* Burbuja "Agregado al carrito" que sale debajo del icono del header */
.burbuja-agregado {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    padding: 9px 14px;
    background: var(--principal);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    transition: opacity .25s ease, transform .25s ease;
}

/* Piquito que apunta al icono */
.burbuja-agregado::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 16px;
    border: 6px solid transparent;
    border-top: none;
    border-bottom-color: var(--principal);
}

.burbuja-agregado.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Caja de envio en la pagina de producto, debajo de Compartir / Consultar */
.caja-envio {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 20px;
    padding: 18px 20px;
    background: #fff;
    border: 1px solid var(--borde);
    border-radius: 10px;
}

.caja-envio-titulo {
    font-size: 17px;
    font-weight: 700;
}

.caja-envio-sub {
    margin-top: 4px;
    font-size: 14px;
    color: var(--texto-gris);
}

.envio-gratis-texto {
    color: #00a650;
}

.btn-calcular-envio {
    padding: 12px 22px;
    background: var(--principal);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.btn-calcular-envio:disabled {
    background: #c4c4ca;
    cursor: default;
}

.caja-envio-resultado {
    font-size: 17px;
}

/* ============ CARRITO: ENVIO Y FACTURACION ============ */

.btn-continuar {
    width: 100%;
    margin-top: 16px;
    padding: 14px 20px;
    background: var(--principal);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

.btn-continuar:hover {
    opacity: .9;
}

/* Va debajo de la lista, con el mismo ancho (el resumen ocupa 340px + 24px de separacion) */
.checkout {
    margin-top: 24px;
    max-width: calc(100% - 364px);
}

.ck-bloque {
    background: #fff;
    border: 1px solid var(--borde);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 18px;
}

.ck-bloque h2 {
    font-size: 19px;
    margin-bottom: 16px;
}

.ck-cp {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 16px;
}

.ck-grilla {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 18px;
}

.ck-grilla + .ck-grilla,
#ck-fact-campos {
    margin-top: 14px;
}

.ck-campo {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ck-completo {
    grid-column: 1 / -1;
}

.ck-etiqueta {
    font-size: 14px;
    color: var(--texto-gris-oscuro);
}

.ck-campo input,
.ck-campo select {
    padding: 11px 12px;
    border: 1px solid var(--borde);
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    background: #fff;
}

.ck-campo input:focus,
.ck-campo select:focus {
    outline: none;
    border-color: var(--principal);
}

.ck-cp-fijo {
    padding: 11px 0;
    font-size: 15px;
}

.ck-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 14px 0;
    font-size: 15px;
    cursor: pointer;
}

/* Cada forma de envio es una fila elegible */
.ck-opcion {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid var(--borde);
    border-radius: 10px;
    margin-bottom: 10px;
    cursor: pointer;
}

.ck-opcion.elegida {
    border-color: var(--principal);
    background: var(--principal-suave);
}

.ck-opcion.deshabilitada {
    cursor: default;
    opacity: .55;
}

.ck-opcion input {
    accent-color: var(--principal);
    width: 18px;
    height: 18px;
}

.ck-opcion-texto {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ck-opcion-texto small {
    font-size: 14px;
    color: var(--texto-gris);
    line-height: 1.4;
}

.ck-opcion-precio {
    font-size: 16px;
    font-weight: 700;
    white-space: nowrap;
}

.ck-error {
    color: #c62828;
    font-size: 14px;
    margin-bottom: 12px;
}

.ck-errores,
.ck-ok {
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 14px;
    font-size: 14px;
    line-height: 1.5;
}

.ck-errores {
    background: #fdecea;
    border: 1px solid #f5c2c0;
}

.ck-errores ul {
    margin: 6px 0 0 18px;
}

.ck-ok {
    background: #e8f7ee;
    border: 1px solid #a8dfbe;
}

.ck-total {
    font-size: 20px;
    text-align: right;
}

.checkout[hidden],
.checkout [hidden] {
    display: none !important;
}

@media (max-width: 900px) {
    .checkout {
        max-width: none;
    }
}

@media (max-width: 560px) {
    .ck-grilla {
        grid-template-columns: 1fr;
    }

    .ck-cp {
        flex-wrap: wrap;
    }
}
