/* =========================================================
   ENMARKALIA REWARDS
   Carrito / mapa principal de recompensas
   ========================================================= */


/* ---------------------------------------------------------
   CONTENEDOR PRINCIPAL
   --------------------------------------------------------- */

.er-rewards-progress {
    width: 100%;
    margin: 0 0 30px;
    padding: 24px 26px 28px;

    background: #f7f9fa;
    border: 1px solid #e5eaee;
    border-radius: 14px;

    box-sizing: border-box;
}


/* ---------------------------------------------------------
   CABECERA
   --------------------------------------------------------- */

.er-rewards-progress__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;

    margin-bottom: 28px;
}


.er-rewards-progress__eyebrow {
    display: block;

    margin-bottom: 7px;

    color: #12243a;

    font-size: 11px;
    font-weight: 800;
    line-height: 1;

    letter-spacing: .09em;
    text-transform: uppercase;
}


.er-rewards-progress__message {
    color: #43566a;

    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
}


.er-rewards-progress__subtotal {
    flex: 0 0 auto;

    color: #12243a;

    font-size: 18px;
    font-weight: 800;
    line-height: 1.2;

    white-space: nowrap;
}


/* ---------------------------------------------------------
   ZONA DE PROGRESO
   --------------------------------------------------------- */

.er-rewards-progress__track-wrap {
    position: relative;

    width: 100%;

    padding-top: 3px;
    padding-bottom: 67px;

    box-sizing: border-box;
}


.er-rewards-progress__track {
    position: relative;

    width: 100%;
    height: 6px;

    overflow: visible;

    background: #dfe6eb;
    border-radius: 999px;
}


.er-rewards-progress__fill {
    position: absolute;

    top: 0;
    left: 0;

    display: block;

    height: 100%;

    background: #12aaa4;
    border-radius: inherit;

    transition: width .3s ease;
}


/* ---------------------------------------------------------
   HITOS
   --------------------------------------------------------- */

.er-rewards-progress__milestones {
    position: absolute;

    top: 3px;
    left: 0;

    width: 100%;
    height: 1px;

    pointer-events: none;
}


.er-rewards-progress__milestone {
    position: absolute;
    top: 0;

    display: flex;
    flex-direction: column;
    align-items: center;

    width: 104px;

    transform: translateX(-50%);

    text-align: center;

    pointer-events: auto;
}


/*
 * El último hito termina justo al final de la barra.
 * Evitamos que el texto salga fuera de la tarjeta.
 */

.er-rewards-progress__milestone:last-child {
    align-items: flex-end;

    transform: translateX(-100%);

    text-align: right;
}


/* ---------------------------------------------------------
   CÍRCULO DEL HITO
   --------------------------------------------------------- */

.er-rewards-progress__dot {
    position: relative;
    z-index: 2;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;

    margin-top: -11px;
    margin-bottom: 8px;

    overflow: hidden;

    background: #ffffff;

    border: 2px solid #cbd5dc;
    border-radius: 50%;

    box-sizing: border-box;

    color: #718190;

    font-size: 12px;
    font-weight: 800;
    line-height: 1;
}


/* Hito alcanzado */

.er-rewards-progress__milestone.is-reached
.er-rewards-progress__dot {
    background: #12aaa4;
    border-color: #12aaa4;

    color: #ffffff;
}


/* ---------------------------------------------------------
   BLINDAJE DE SVG
   Evita otro Godzilla aunque Blocksy/Woo tenga estilos globales.
   --------------------------------------------------------- */

.er-rewards-progress__dot svg {
    display: block !important;

    width: 12px !important;
    height: 12px !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: 17px !important;
    max-height: 17px !important;

    margin: 0 !important;
    padding: 0 !important;

    position: static !important;

    transform: none !important;

    overflow: visible;

    box-sizing: border-box;
}


/* Camión */

.er-rewards-progress__dot svg.er-icon-truck {
    width: 17px !important;
    height: 17px !important;
    max-width: 17px !important;
    max-height: 17px !important;
}


/* Regalo */

.er-rewards-progress__dot svg.er-icon-gift {
    width: 15px !important;
    height: 15px !important;
    max-width: 15px !important;
    max-height: 15px !important;
}


/* Estrella / recompensa genérica */

.er-rewards-progress__dot svg.er-icon-reward {
    width: 13px !important;
    height: 13px !important;
    max-width: 13px !important;
    max-height: 13px !important;
}


/* Porcentaje */

.er-rewards-progress__dot .er-icon-percent {
    display: flex;
    align-items: center;
    justify-content: center;

    width: auto;
    height: auto;

    margin: 0;
    padding: 0;

    color: currentColor;

    font-size: 12px;
    font-weight: 800;
    line-height: 1;
}


/* ---------------------------------------------------------
   TEXTO DE LOS HITOS
   --------------------------------------------------------- */

.er-rewards-progress__amount {
    display: block;

    margin-bottom: 3px;

    color: #12243a;

    font-size: 12px;
    font-weight: 800;
    line-height: 1.2;

    white-space: nowrap;
}


.er-rewards-progress__label {
    display: block;

    max-width: 104px;

    color: #718190;

    font-size: 10px;
    font-weight: 600;
    line-height: 1.25;
}


.er-rewards-progress__milestone.is-reached
.er-rewards-progress__amount {
    color: #12243a;
}


.er-rewards-progress__milestone.is-reached
.er-rewards-progress__label {
    color: #43566a;
}


/* ---------------------------------------------------------
   PEQUEÑOS AJUSTES WOOCOMMERCE
   --------------------------------------------------------- */

.woocommerce-cart-form .er-rewards-progress,
.woocommerce-cart .er-rewards-progress {
    clear: both;
}


.er-rewards-progress *,
.er-rewards-progress *::before,
.er-rewards-progress *::after {
    box-sizing: border-box;
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 1024px) {

    .er-rewards-progress {
        padding: 22px 22px 26px;
    }

    .er-rewards-progress__milestone {
        width: 92px;
    }

    .er-rewards-progress__label {
        max-width: 92px;
    }
}


/* =========================================================
   MÓVIL
   ========================================================= */

@media (max-width: 767px) {

    .er-rewards-progress {
        margin-bottom: 22px;

        padding: 18px 16px 20px;

        border-radius: 12px;
    }


    .er-rewards-progress__top {
        align-items: flex-start;

        gap: 10px;

        margin-bottom: 25px;
    }


    .er-rewards-progress__eyebrow {
        margin-bottom: 5px;

        font-size: 9px;
    }


    .er-rewards-progress__message {
        font-size: 11px;
        line-height: 1.35;
    }


    .er-rewards-progress__subtotal {
        font-size: 14px;
    }


    .er-rewards-progress__track-wrap {
        padding-bottom: 58px;
    }


    .er-rewards-progress__track {
        height: 5px;
    }


    .er-rewards-progress__milestone {
        width: 70px;
    }


    .er-rewards-progress__dot {
        width: 24px;
        height: 24px;
        min-width: 24px;
        min-height: 24px;

        margin-top: -10px;
        margin-bottom: 7px;

        font-size: 10px;
    }


    .er-rewards-progress__dot svg {
        width: 9px !important;
        height: 9px !important;
        max-width: 12px !important;
        max-height: 12px !important;
    }


    .er-rewards-progress__dot svg.er-icon-truck {
        width: 11px !important;
        height: 11px !important;
    }


    .er-rewards-progress__dot svg.er-icon-gift {
        width: 9px !important;
        height: 9px !important;
    }


    .er-rewards-progress__dot svg.er-icon-reward {
        width: 9px !important;
        height: 9px !important;
    }


    .er-rewards-progress__dot .er-icon-percent {
        font-size: 9px;
    }


    .er-rewards-progress__amount {
        margin-bottom: 2px;

        font-size: 10px;
    }


    .er-rewards-progress__label {
        max-width: 70px;

        font-size: 8px;
        line-height: 1.2;
    }
}