/**
 * Ariseweb Oferta Countdown - Estilos.
 *
 * Todo bajo el scope .arwc. No se tocan estilos globales.
 * Variables propias con fallback a la paleta del sitio (globales de Elementor).
 */

.arwc {
    /* Amarillo: global "accent" de Elementor de este sitio, con fallback a la marca. */
    --arwc-accent: var(--e-global-color-accent, #ffcc00);
    /* Negro de las cajas y el título: valor fijo de la marca. */
    --arwc-ink: #312f2f;
    --arwc-text: var(--e-global-color-text, #1a1a1a);
    --arwc-card: #ffffff;
    --arwc-line: #ececec;
    --arwc-sep: #cfcfcf;
    /* Sin bordes redondeados. */
    --arwc-radius: 0;

    /* Hereda la tipografía del tema. */
    font-family: inherit;
    color: var(--arwc-text);
    background: var(--arwc-card);
    border: 0;
    border-radius: var(--arwc-radius);
    padding: 0;
    box-sizing: border-box;
}

.arwc *,
.arwc *::before,
.arwc *::after {
    box-sizing: border-box;
}

/* Cabecera: título alineado a la izquierda. */
.arwc__head {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding-bottom: 0;
}

.arwc__title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-weight: 700;
    font-size: 0.8rem;
    line-height: 1.2;
    color: var(--arwc-ink);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.arwc__icon {
    flex: 0 0 auto;
    color: var(--arwc-ink);
}

/* Etiqueta "AHORRAS X €": oculta. */
.arwc__save {
    display: none;
}

/* wc_price() inserta spans propios; heredamos color y peso. */
.arwc__save .woocommerce-Price-amount,
.arwc__save .woocommerce-Price-currencySymbol {
    color: inherit;
    font-weight: inherit;
}

/* Fila de cajas. */
.arwc__timer {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    margin-top: 14px;
}

.arwc__unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: var(--arwc-ink);
    border-radius: var(--arwc-radius);
    padding: 10px 8px;
    min-width: 58px;
}

.arwc__num {
    font-weight: 700;
    font-size: 1.6rem;
    line-height: 1;
    color: #ffffff;
    /* Cifras de ancho fijo para que no "baile" el ancho al cambiar. */
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}

.arwc__lbl {
    font-size: 0.65rem;
    font-weight: 600;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--arwc-accent);
}

.arwc__sep {
    font-weight: 700;
    font-size: 1.4rem;
    line-height: 1;
    color: var(--arwc-sep);
}

/* Responsive: cajas más compactas sin romper la fila de forma fea. */
@media (max-width: 480px) {
    .arwc {
        padding: 14px 0;
    }

    /* En móvil: primero el badge "AHORRAS X €", luego el título. */
    .arwc__head {
        flex-direction: column-reverse;
        align-items: flex-start;
        gap: 8px;
    }

    .arwc__timer {
        gap: 5px;
    }

    .arwc__unit {
        min-width: 0;
        flex: 1 1 0;
        padding: 8px 4px;
    }

    .arwc__num {
        font-size: 1.25rem;
    }

    .arwc__lbl {
        font-size: 0.58rem;
    }

    .arwc__sep {
        font-size: 1rem;
    }
}

/* ==========================================================================
   Variante compacta para los listados (tienda, categorías, home).
   Sin cabecera: la tarjeta ya da contexto. Las cajas se reparten el ancho
   disponible de la tarjeta (hasta un máximo) para verse bien en desktop y móvil.
   ========================================================================== */
.arwc--mini {
    padding: 6px 0;
    background: transparent;
}

.arwc--mini .arwc__head {
    display: none;
}

.arwc--mini .arwc__timer {
    margin-top: 6px;
    gap: 6px;
}

.arwc--mini .arwc__unit {
    /* Se reparten el ancho de la tarjeta, con un tope para no estirarse de más. */
    flex: 1 1 0;
    min-width: 0;
    max-width: 66px;
    padding: 8px 4px;
    gap: 3px;
}

.arwc--mini .arwc__num {
    font-size: 1.3rem;
}

.arwc--mini .arwc__lbl {
    font-size: 0.55rem;
    letter-spacing: 0.02em;
    /* Nunca partir la etiqueta en dos líneas dentro de la caja estrecha. */
    white-space: nowrap;
}

.arwc--mini .arwc__sep {
    font-size: 1.1rem;
}

/* ==========================================================================
   Etiqueta "LIQUIDACIÓN" superpuesta sobre la imagen del producto.
   Negro de la marca + amarillo "accent" (con fallback).
   ========================================================================== */
.arwc-liquidacion {
    /* Base: fluye como cualquier elemento; se puede colocar como widget en Elementor. */
    display: inline-block;
    background: #312f2f;
    color: var(--e-global-color-accent, #ffcc00);
    font-weight: 700;
    font-size: 0.7rem;
    line-height: 1;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 5px 8px;
    /* Sin bordes redondeados, en línea con el resto del widget. */
    border-radius: 0;
}

/* Modificador de superposición: se pega arriba-izquierda del contenedor
   posicionado más cercano (lo usa la vía automática por hooks de WooCommerce). */
.arwc-liquidacion--overlay {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 9;
    /* No debe interceptar el clic del enlace del producto. */
    pointer-events: none;
}

/* Contexto de posicionamiento para la superposición. WooCommerce ya lo hace por
   defecto; se refuerza por si el tema no lo aplica. */
.woocommerce ul.products li.product,
ul.products li.product {
    position: relative;
}

/* ==========================================================================
   Ajuste móvil del mini contador: en tarjetas estrechas las 4 cajas (con
   segundos) se reparten todo el ancho sin tope para no desbordar.
   ========================================================================== */
@media (max-width: 480px) {
    .arwc--mini .arwc__timer {
        gap: 4px;
    }

    .arwc--mini .arwc__unit {
        max-width: none;
        padding: 7px 2px;
    }

    .arwc--mini .arwc__num {
        font-size: 1.05rem;
    }

    .arwc--mini .arwc__lbl {
        font-size: 0.5rem;
    }

    .arwc--mini .arwc__sep {
        font-size: 0.9rem;
    }
}
