/**
 * Module: Checkout Stepper
 * Layout: Horizontal Row with SVG Separators
 */

/* --- WRAPPER --- */
.checkout-stepper-wrapper {
    width: auto;
    flex-grow: 1;
    display: flex;
    justify-content: center;
    margin: 0 1rem;
    padding: 0;
    border: none;
}

/* SEGURIDAD: Ocultar <br> inyectados */
.checkout-stepper br {
    display: none !important;
}

/* --- LISTA (OL) --- */
.checkout-stepper ol {
    display: flex !important;
    flex-direction: row !important;
    justify-content: center;
    align-items: center;
    gap: 0;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    width: auto;
}

/* --- STEP ITEM (Base) --- */
.checkout-stepper .step-item {
    display: flex;
    align-items: center;
    position: relative;

    /* Tipografía */
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    white-space: nowrap;

    /* Color Base (Variable) */
    color: var(--wp--preset--color--accent-3);

    transition: all 0.3s ease;
}

/* Reset de enlaces y contenedores internos */
.checkout-stepper a,
.checkout-stepper .step-content {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none !important;
    color: inherit;
    cursor: default;
}

.checkout-stepper a {
    cursor: pointer;
}

/* --- NUMBER CIRCLE --- */
.checkout-stepper .step-number {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;

    /* Bordes y Fuente */
    border: 2px solid currentColor;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1;

    flex-shrink: 0;
    transition: all 0.3s ease;
}

/* --- SEPARATOR (SVG Chevron) --- */
.checkout-stepper .step-item:not(:last-child)::after {
    content: '';
    display: block;
    width: 16px;
    height: 16px;
    margin: 0 1.5rem;

    /* Color del separador usando la variable base */
    background-color: var(--wp--preset--color--accent-3);
    opacity: 0.3;
    /* Opacidad baja para que sea sutil */

    /* SVG Mask: Chevron Right (>) */
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 18 15 12 9 6'%3E%3C/polyline%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 18 15 12 9 6'%3E%3C/polyline%3E%3C/svg%3E");

    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
}

/* --- STATES --- */

/* 1. PENDING (Futuro) */
.checkout-stepper .step-item.is-pending {
    opacity: 0.4;
    /* Muy atenuado */
}

.checkout-stepper .step-item.is-pending .step-number {
    opacity: 0.6;
    /* El círculo un poco más visible que el texto */
}

/* 2. COMPLETED (Pasado) - CHECK VERDE */
.checkout-stepper .step-item.is-completed {
    opacity: 0.7;
    /* Texto ligeramente atenuado */
}

.checkout-stepper .step-item.is-completed .step-number {
    /* Cambiamos el color del borde al Verde Cyan */
    border-color: var(--wp--preset--color--custom-verde);
    color: transparent;
    /* Ocultamos el número */
    position: relative;
    opacity: 1;
    /* El check debe verse nítido */
}

/* Checkmark (L Shape) */
.checkout-stepper .step-item.is-completed .step-number::before {
    content: '';
    position: absolute;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
    width: 5px;
    height: 10px;

    /* Usamos la variable Verde Cyan para el check */
    border-bottom: 2px solid var(--wp--preset--color--custom-verde);
    border-right: 2px solid var(--wp--preset--color--custom-verde);

    display: block;
}

/* 3. ACTIVE (Actual) */
.checkout-stepper .step-item.is-active {
    opacity: 1;
    /* Totalmente visible */
    /* Sutil brillo usando la variable base */
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.4);
}

.checkout-stepper .step-item.is-active .step-number {
    border-color: var(--wp--preset--color--accent-3);
    background-color: rgba(255, 255, 255, 0.05);
    /* Fondo muy sutil */
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.25);
}

/* --- RESPONSIVE (Móvil) --- */
@media (max-width: 486px) {
    .checkout-stepper-wrapper {
        margin: 0 0.2rem;
    }

    /* Reducir margen del separador */
    .checkout-stepper .step-item:not(:last-child)::after {
        margin: 0 0.2rem;
        width: 12px;
        height: 12px;
    }

    .checkout-stepper .step-item {
        font-size: 0.7rem;
    }

    .checkout-stepper .step-number {
        width: 24px;
        height: 24px;
        font-size: 0.7rem;
    }

    .checkout-stepper .step-item.is-completed .step-number::before {
        width: 4px;
        height: 8px;
    }
}