/* ═══════════════════════════════════════════════════════════════
   tarjeta.css — Tarjeta de producto
   ═══════════════════════════════════════════════════════════════ */

.tarjeta {
    background: #fff;
    border-radius: var(--radio);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: transform .22s ease, box-shadow .22s ease;
}

.tarjeta:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, .09);
}

/* ── Imagen (portrait 2:3) ───────────────────────────────────── */
.tarjeta__imagen {
    position: relative;
    width: 100%;
    aspect-ratio: 2 / 3;
    background: #f4f4f5;
    overflow: hidden;
    flex-shrink: 0;
}

.tarjeta__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .4s ease;
}

.tarjeta:hover .tarjeta__img { transform: scale(1.05); }
.tarjeta__img--agotado { filter: grayscale(100%); opacity: .6; }
.tarjeta:hover .tarjeta__img--agotado { transform: none; }

/* Placeholder sin imagen */
.tarjeta__sin-imagen {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tarjeta__sin-imagen-svg {
    width: 2rem;
    height: 2rem;
    color: #d1d5db;
}

/* Badge de descuento (inline, junto al precio) */
.tarjeta__badge-oferta {
    display: inline-flex;
    align-items: center;
    background: #ef4444;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.15rem 0.42rem;
    border-radius: 4px;
    letter-spacing: .03em;
    flex-shrink: 0;
}

/* ── Tarjeta Promoción ───────────────────────────────────────── */
.tarjeta-promo {
    background: linear-gradient(160deg, #fdf4ff 0%, #fff 60%);
    border: 1px solid #e9d5ff;
}

.tarjeta-promo__ribbon {
    background: #7c3aed;
}

.tarjeta-promo__imagen {
    background: #f5f0ff;
}

/* Mosaico de logos de productos cuando no hay imagen propia */
.tarjeta-promo__mosaico {
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 2px;
    overflow: hidden;
}

.tarjeta-promo__mosaico-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tarjeta-promo__mosaico-vacio {
    background: #ede9fe;
}

/* Badge de fecha vencimiento */
.tarjeta-promo__vence {
    position: absolute;
    bottom: 0.5rem;
    left: 0.5rem;
    background: rgba(109, 40, 217, .85);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 600;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    backdrop-filter: blur(3px);
    z-index: 2;
}

/* Lista de productos incluidos */
.tarjeta-promo__items {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin-bottom: 0.25rem;
}

.tarjeta-promo__item {
    display: flex;
    align-items: flex-start;
    gap: 0.3rem;
    font-size: 0.72rem;
    color: var(--color-texto-2);
    line-height: 1.4;
}

.tarjeta-promo__check {
    color: #7c3aed;
    flex-shrink: 0;
    margin-top: 0.15rem;
}

/* Indicador de código requerido */
.tarjeta-promo__code {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.65rem;
    color: #7c3aed;
    font-weight: 500;
}

/* ── Botones de acción ───────────────────────────────────────── */
.tarjeta__acciones {
    position: absolute;
    bottom: 0.625rem;
    left: 0.5rem;
    right: 0.5rem;
    display: flex;
    gap: 0.375rem;
    align-items: center;
    z-index: 4;
}

.tarjeta__btn-carrito {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    background: #111;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0.45rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .18s, transform .1s;
    white-space: nowrap;
}

.tarjeta__btn-carrito:hover:not(:disabled)  { background: #333; }
.tarjeta__btn-carrito:active:not(:disabled) { transform: scale(.96); }

.tarjeta__btn-carrito--agotado,
.tarjeta__btn-carrito--agotado:hover {
    background: #9ca3af;
    cursor: not-allowed;
    opacity: .8;
}

.tarjeta__btn-deseo {
    width: 2.1rem;
    height: 2.1rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .92);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    color: #888;
    transition: color .18s, background .18s, transform .1s;
}

.tarjeta__btn-deseo:hover              { color: #e11d48; background: #fff; }
.tarjeta__btn-deseo--activo            { color: #e11d48; }
.tarjeta__btn-deseo--activo svg        { fill: currentColor; }
.tarjeta__btn-deseo:active             { transform: scale(.9); }

/* ── Cuerpo ──────────────────────────────────────────────────── */
.tarjeta__cuerpo {
    padding: 0.625rem 0.75rem 0.875rem;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    flex: 1;
}

.tarjeta__nombre {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-texto);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Colores ─────────────────────────────────────────────────── */
.tarjeta__colores {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.tarjeta__color {
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, .14);
    display: inline-block;
    flex-shrink: 0;
    cursor: pointer;
    transition: transform .15s, outline-offset .15s;
}

.tarjeta__color--sel {
    outline: 2px solid #111;
    outline-offset: 2px;
    transform: scale(1.2);
}

/* ── Flechas de navegación ───────────────────────────────────── */
.tarjeta__nav {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0.375rem;
    pointer-events: none;
}

.tarjeta__nav-btn {
    width: 1.625rem;
    height: 1.625rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, .88);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #111;
    pointer-events: auto;
    transition: background .15s;
    flex-shrink: 0;
}

.tarjeta__nav-btn:hover { background: #fff; }

/* ── Puntos indicadores ──────────────────────────────────────── */
.tarjeta__dots {
    position: absolute;
    bottom: 0.5rem;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 0.25rem;
    pointer-events: none;
}

.tarjeta__dot {
    width: 0.3rem;
    height: 0.3rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, .5);
    border: none;
    cursor: pointer;
    padding: 0;
    pointer-events: auto;
    transition: background .15s, transform .15s;
}

.tarjeta__dot--activo {
    background: #fff;
    transform: scale(1.4);
}

.tarjeta__color-mas {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--color-texto-muted);
}

/* ── Stock ───────────────────────────────────────────────────── */
.tarjeta__stock {
    font-size: 0.7rem;
    color: var(--color-texto-muted);
    font-weight: 500;
}
.tarjeta__stock--agotado { color: #dc2626; }
.tarjeta__stock--bajo    { color: #d97706; }

/* ── Precio ──────────────────────────────────────────────────── */
.tarjeta__precio-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    margin-top: auto;
    padding-top: 0.25rem;
}

.tarjeta__precio-fila {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    flex-wrap: wrap;
}

.tarjeta__precio {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--color-texto);
    letter-spacing: -.02em;
}

.tarjeta__precio-original {
    font-size: 0.8125rem;
    color: var(--color-texto-muted);
    text-decoration: line-through;
}

/* Botón agregar móvil (oculto en desktop) */
.tarjeta__btn-carrito--movil {
    display: none;
    width: 100%;
    flex: 0 0 2.25rem;
    margin-top: 0.375rem;
}

/* ── Móvil / táctil ──────────────────────────────────────────── */
@media (hover: none) {
    .tarjeta__btn-carrito--movil  { display: flex; }
    .tarjeta__acciones            { display: none !important; }
    .tarjeta__dots                { display: flex !important; }
    .tarjeta__nav                 { display: none !important; }
    .tarjeta:hover                { transform: none; box-shadow: none; }
    .tarjeta:hover .tarjeta__img  { transform: none; }
}
