/**
 * Tanuki Fase 2.3 — Skeleton screens (Cart y Checkout)
 *
 * CSS puro con shimmer effect. Sin librerías.
 * El JS en tanuki-fase2-skeleton.js inyecta los skeletons y los elimina
 * cuando WooCommerce confirma que el contenido está listo.
 *
 * REVERTIR: comentar los enqueues de "tanuki-fase2-skeleton" en el bloque
 * TANUKI-PERF-FASE2 de functions.php y eliminar este archivo y su .js.
 */

/* ── Animación shimmer ───────────────────────────────────────────────────── */
@keyframes tnk-shimmer {
    0%   { background-position: -800px 0; }
    100% { background-position:  800px 0; }
}

/* ── Base del bloque skeleton ────────────────────────────────────────────── */
.tnk-skel {
    background: linear-gradient(
        90deg,
        #f2f2f2 25%,
        #e8e8e8 50%,
        #f2f2f2 75%
    );
    background-size: 800px 100%;
    animation: tnk-shimmer 1.6s infinite linear;
    border-radius: 6px;
    display: block;
}

/* ── Contenedor principal del skeleton de carrito ───────────────────────── */
#tnk-cart-skeleton {
    padding: 1rem 0;
    display: none; /* JS lo activa */
}

/* ── Fila de producto en carrito ─────────────────────────────────────────── */
.tnk-skel-row {
    display: grid;
    grid-template-columns: 80px 1fr;
    grid-template-rows: auto auto auto;
    gap: 0.5rem 1rem;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid #efefef;
    border-radius: 12px;
    background: #fff;
}

/* Thumbnail */
.tnk-skel-thumb {
    grid-row: span 3;
    width: 80px;
    height: 80px;
    border-radius: 8px;
}

/* Título */
.tnk-skel-title {
    height: 14px;
    width: 70%;
    margin-top: 6px;
}

/* Precio */
.tnk-skel-price {
    height: 12px;
    width: 30%;
}

/* Cantidad */
.tnk-skel-qty {
    height: 28px;
    width: 50%;
    border-radius: 6px;
}

/* ── Totales del carrito ─────────────────────────────────────────────────── */
.tnk-skel-totals {
    margin-top: 1.5rem;
    padding: 1rem;
    border: 1px solid #efefef;
    border-radius: 12px;
    background: #fff;
}

.tnk-skel-total-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.tnk-skel-label {
    height: 12px;
    width: 28%;
}

.tnk-skel-amount {
    height: 12px;
    width: 22%;
}

/* Botón skeleton */
.tnk-skel-btn {
    height: 44px;
    width: 100%;
    border-radius: 8px;
    margin-top: 1rem;
}

/* ── Skeleton del checkout — order review ────────────────────────────────── */
#tnk-checkout-skeleton {
    display: none; /* JS lo activa */
    padding: 1rem 0;
}

/* Cabecera de sección */
.tnk-skel-section-title {
    height: 16px;
    width: 40%;
    margin-bottom: 1rem;
}

/* Fila de producto en order review */
.tnk-skel-order-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #f0f0f0;
}

.tnk-skel-order-name {
    height: 12px;
    width: 55%;
}

.tnk-skel-order-price {
    height: 12px;
    width: 18%;
}

/* Líneas de subtotal / shipping / total */
.tnk-skel-summary {
    margin-top: 0.75rem;
}

.tnk-skel-summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.tnk-skel-summary-label {
    height: 11px;
    width: 25%;
}

.tnk-skel-summary-val {
    height: 11px;
    width: 18%;
}

/* Botón place_order skeleton */
.tnk-skel-place-btn {
    height: 48px;
    width: 100%;
    border-radius: 8px;
    margin-top: 1.25rem;
}

/* ── Transición de salida ────────────────────────────────────────────────── */
.tnk-skel-fade-out {
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}
