﻿* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #f0f0f0; /* Color se usa de fondo para el encabezado */
    --secondary-color: #47bac1; /* Color se usa para los dividers los botones y los focus */
    --third-color: #797979; /* Color se usa para el texto del encabezado */
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: white;
    color: #252525;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.checkout-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px 0;
    background: white;
    border-radius: 10px;
}

    .checkout-header h1 {
        color: #252525;
        font-size: 2.5rem;
        margin-bottom: 10px;
        font-weight: 400;
    }

/* Progress Wizard Styles */
.progress-wizard {
    padding: 0 15px 50px 15px;
    margin-bottom: 30px;
}

.pageHeader {
    height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-left: 40px; /* Espacio desde el borde izquierdo */
    padding-right: 40px; /* Espacio desde el borde derecho */
}

    .pageHeader .page-title h2,
    .pageHeader .commerce-name h2,
    .pageHeader .commerce-info p,
    .pageHeader .commerce-info h2 {
        color: var(--third-color) ; /* Color se usa para el texto del encabezado */
        text-transform: uppercase;
        font-weight: 400;
        margin-bottom: 0;
        font-size: 20px;
    }

.lightSection {
    background-color: var(--primary-color);
    height: 125px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.06); /* sombra suave */
    border-bottom: 1px solid rgba(0,0,0,0.04);
}

.section-divider {
    height: 4px;
    width: 100%; /* Se adapta al contenedor */
    background-color: var(--secondary-color);
    margin-top: 4px;
    margin-bottom: 16px;
    border-radius: 2px;
}

.progress-wizard .progress-wizard-step {
    padding: 0;
    position: relative;
    display: inline-block;
    width: 25%;
    text-align: center;
}

    .progress-wizard .progress-wizard-step .progress-wizard-stepnum {
        color: #797979;
        padding-bottom: 5px;
        font-size: 13px;
    }

    .progress-wizard .progress-wizard-step .progress-wizard-dot {
        width: 30px;
        height: 30px;
        background: var(--primary-color);
        border-radius: 50%;
        position: relative;
        margin: 0 auto 10px;
    }

        .progress-wizard .progress-wizard-step .progress-wizard-dot:after {
            content: ' ';
            width: 16px;
            height: 16px;
            background: #fff;
            border-radius: 50%;
            position: absolute;
            top: 7px;
            left: 7px;
        }

    .progress-wizard .progress-wizard-step.disabled .progress-wizard-dot {
        background: #dedede;
    }

        .progress-wizard .progress-wizard-step.disabled .progress-wizard-dot:after {
            content: ' ';
            width: 16px;
            height: 16px;
            background: #fff;
            border-radius: 50%;
            position: absolute;
            top: 7px;
            left: 7px;
        }

.checkout-content {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 30px;
    align-items: start;
}

.stepsWrapper .innerWrapper {
    background: white;
    border-radius: 15px;
}

.payment-form {
    background: white;
    padding: 40px 25px;
    border-radius: 15px;
    border: 3px solid #f0f0f0;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.form-section {
    margin-bottom: 30px;
}

.section-title {
    font-size: 22px;
    color: #252525;
    margin-bottom: 15px;
    font-weight: 400;
    letter-spacing: 0;
}

.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 400;
    color: #797979;
    font-size: 13px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"] {
    width: 100%;
    padding: 15px;
    border: 1px solid #f0f0f0;
    border-radius: 4px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: #fff;
    height: 44px;
    color: #252525;
}

select {
    width: 100%;
    padding: 10px 15px; /* menos padding vertical */
    border: 1px solid #f0f0f0;
    border-radius: 4px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: #fff;
    color: #252525;
    line-height: 1.4;
    /* Puedes quitar height o ajustarla si es necesario */
    /* height: 44px; */
}

    input:focus,
    select:focus {
        outline: none;
        border-color: var(--secondary-color);
        box-shadow: 0 0 0 2px rgba(71, 186, 193, 0.1);
    }

/* Contenedor general del select2 */
.select2-container--default .select2-selection--single {
    height: 44px !important;
    padding: 8px 12px;
    border: 1px solid #f0f0f0 !important;
    border-radius: 4px;
    font-size: 15px;
    color: #252525;
    background-color: #fff;
    transition: all 0.3s ease;
}

    .select2-container--default .select2-selection--single:focus,
    .select2-container--default .select2-selection--single:active {
        border-color: var(--secondary-color) !important;
        box-shadow: 0 0 0 2px rgba(71, 186, 193, 0.1);
    }

.select2-container--default .select2-selection__rendered {
    line-height: 24px;
    display: flex;
    align-items: center;
}

/* Ancho 100% */
.select2-container {
    width: 100% !important;
}

.checkboxArea.card-check {
    width: 100%;
    margin-bottom: 25px;
}

    .checkboxArea.card-check .form-control {
        background: #fff;
        border: 1px solid #f0f0f0;
        height: 44px;
    }

.payment-methods {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.payment-method {
    flex: 1;
    padding: 20px;
    border: 1px solid #f0f0f0;
    border-radius: 4px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

    .payment-method:hover {
        border-color: var(--secondary-color);
        background: #f8f9ff;
    }

    .payment-method.active {
        border-color: var(--secondary-color);
        background: #e3f2fd;
    }

    .payment-method input[type="radio"] {
        display: none;
    }

.payment-method-icon {
    font-size: 2rem;
    margin-bottom: 10px;
    color: var(--secondary-color);
}

.card-input-group {
    position: relative;
}

.card-icons {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 5px;
}

.card-icon {
    width: 30px;
    height: 20px;
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.3;
    transition: opacity 0.3s ease;
}

    .card-icon.visa {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 24'%3E%3Cpath fill='%231a1f71' d='M18.5 8.5h-3l-1.9 7h1.9l1.9-7zM25.4 8.5c-.6 0-1.1.3-1.4.8l-2.1 6.2h2l.4-1.1h2.4l.2 1.1h1.8l-1.6-7h-1.7zm-.3 4.7l1-2.7.6 2.7h-1.6zM12.1 15.5h-2l1.3-7H9.5l-2 5.4L7.2 8.8c-.1-.4-.4-.3-.7-.3H3.6l-.1.4c.7.1 1.4.4 1.9.7l1.6 6.9h2l3.1-7.5zM22.8 12.3c0-.7-.9-1.2-1.4-1.5-.3-.2-.5-.3-.5-.5s.2-.4.6-.4c.5 0 .9.1 1.3.3l.2-1.5c-.4-.1-.9-.2-1.5-.2-1.6 0-2.7.8-2.7 2 0 .9.8 1.3 1.4 1.6.6.3.8.5.8.8 0 .5-.6.7-1.2.7-.8 0-1.3-.2-1.7-.4l-.3 1.5c.4.2 1.1.3 1.8.3 1.7.1 2.9-.8 2.9-2z'/%3E%3C/svg%3E");
    }

    .card-icon.mastercard {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 24'%3E%3Ccircle cx='15' cy='12' r='7' fill='%23eb001b'/%3E%3Ccircle cx='25' cy='12' r='7' fill='%23f79e1b'/%3E%3Cpath fill='%23ff5f00' d='M20 5.9c1.3 1.4 2.1 3.3 2.1 5.1s-.8 3.7-2.1 5.1c-1.3-1.4-2.1-3.3-2.1-5.1s.8-3.7 2.1-5.1z'/%3E%3C/svg%3E");
    }

.error-message {
    color: #e74c3c;
    font-size: 0.9rem;
    margin-top: 5px;
    display: none;
}

.summery-box {
    border: 3px solid #f0f0f0;
    padding: 40px 25px;
    margin-bottom: 50px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    height: fit-content;
    position: sticky;
    top: 20px;
}

    .summery-box h4 {
        font-size: 22px;
        margin-bottom: 15px;
        font-weight: 400;
        letter-spacing: 0;
        color: #252525;
    }

    .summery-box p {
        font-size: 13px;
        padding-bottom: 5px;
        color: #797979;
    }

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    color: #797979;
    font-size: 15px;
}

    .summary-item:last-child {
        border-top: 3px solid var(--secondary-color);
        color: #252525;
        padding: 20px 0 0;
        font-weight: 700;
    }

        .summary-item:last-child .val {
            font-weight: 700;
        }

.button-group {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 20px;
}

.checkout-btn {
    padding: 10px 20px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

    .checkout-btn:hover {
        background: #3a9ca3;
        transform: translateY(-1px);
    }

    .checkout-btn:active {
        transform: translateY(0);
    }

/* Botón Continuar */
.btn-continue {
    background: var(--secondary-color);
    color: white;
    border: none;
}

    .btn-continue:hover {
        background: var(--secondary-color);
        transform: translateY(-1px);
        box-shadow: 0 6px 14px rgba(0,0,0,0.18); /* sombra más marcada */
        filter: brightness(0.95); /* oscuro leve adicional */
    }

    .btn-continue:active {
        transform: translateY(0);
    }

/* Botón Cancelar */
.btn-cancel {
    background: #f0f0f0;
    color: #888888;
    border: none;
}

    .btn-cancel:hover {
        background: #b3b3b3;
        transform: translateY(-1px);
    }

    .btn-cancel:active {
        transform: translateY(0);
    }

.security-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
    color: #797979;
    font-size: 13px;
    line-height: 24px;
}

.shipping-info {
    padding: 10px 0 20px;
}

    .shipping-info h5 {
        font-size: 16px;
        font-weight: 400;
        margin-bottom: 10px;
        color: #252525;
    }

    .shipping-info address,
    .shipping-info p {
        color: #797979;
        line-height: 24px;
        font-size: 13px;
    }

.pager {
    margin: 20px 0;
}

    .pager li.previous a {
        background-color: #dedede;
        color: #252525;
        padding: 10px 20px;
        border-radius: 4px;
        text-decoration: none;
        transition: all 0.3s ease;
    }

        .pager li.previous a:hover {
            background-color: var(--secondary-color);
            color: #fff;
        }

.valid {
    border-color: var(--secondary-color) !important;
}

.invalid {
    border-color: #e74c3c !important;
}

.step2.checkboxArea {
    margin-bottom: 25px;
}

    .step2.checkboxArea label {
        font-size: 13px;
        color: #797979;
    }

.table-responsive .table tbody tr td {
    text-transform: capitalize;
}

.order-confirm {
    padding: 60px 0 90px;
    text-align: center;
}

    .order-confirm h2 {
        font-size: 30px;
        line-height: 1;
        font-weight: 700;
        margin-bottom: 15px;
        color: #252525;
    }

    .order-confirm span {
        display: block;
        font-size: 13px;
        color: #797979;
    }

    .order-confirm p {
        font-size: 15px;
        line-height: 30px;
        color: #797979;
        margin: 42px 0 50px;
    }

.flatpickr-calendar {
    width: 100%; /* Asegura que el calendario ocupe todo el ancho disponible */
    max-width: none; /* Elimina cualquier restricción de ancho máximo */
    min-width: 300px; /* Establece un ancho mínimo para asegurar que todos los meses quepan */
}

.flatpickr-monthSelect-months {
    display: flex;
    flex-wrap: wrap; /* Permite que los meses se envuelvan a la siguiente línea si es necesario */
    justify-content: center; /* Centra los meses en el contenedor */
}

.flatpickr-monthSelect-month {
    flex: 1 0 21%; /* Asegura que haya cuatro meses por fila */
    max-width: 21%; /* El ancho máximo para cada mes */
    box-sizing: border-box; /* Incluye padding y borde en el ancho y alto */
    padding: 10px; /* Espacio interno para cada mes */
    text-align: center; /* Centra el texto dentro de cada mes */
    font-size: 16px; /* Tamaño de fuente consistente */
    color: #80868B; /* Color del texto */
    background-color: #fff; /* Fondo blanco */
    border: 1px solid #DADCE0; /* Borde gris claro */
    margin: 5px; /* Espacio entre meses */
    cursor: pointer; /* Muestra el cursor de mano */
    transition: background-color 0.3s, color 0.3s; /* Transiciones suaves */
}

    .flatpickr-monthSelect-month:hover,
    .flatpickr-monthSelect-month.selected {
        background-color: #1A73E8; /* Fondo azul al seleccionar */
        color: #fff; /* Texto blanco al seleccionar */
        border-color: #1A73E8; /* Borde azul al seleccionar */
    }

    .flatpickr-monthSelect-month.disabled {
        color: #ddd; /* Color gris claro para meses deshabilitados */
        background-color: #f5f5f5; /* Fondo gris claro para meses deshabilitados */
    }

.error {
    color: white; /* Color del texto */
    background-color: red; /* Color de fondo */
    padding: 10px; /* Espaciado interno */
    border-radius: 5px; /* Bordes redondeados */
    display: none; /* Ocultar por defecto */
    position: relative; /* Cambia a relative para que esté en el flujo */
    margin-top: 5px; /* Espacio entre el input y el mensaje de error */
    z-index: 1000; /* Asegúrate de que esté en frente de otros elementos */
}

.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw; /* Ancho de la ventana */
    height: 100vh; /* Alto de la ventana */
    background: rgba(0, 0, 0, 0.5); /* Fondo semi-transparente */
    display: flex; /* Para centrar el spinner */
    align-items: center; /* Alineación vertical */
    justify-content: center; /* Alineación horizontal */
    z-index: 1000; /* Asegurarse de que esté en la parte superior */
}

.spinner {
    border: 8px solid var(--secondary-color); /* Color del fondo del spinner */
    border-top: 8px solid #3498db; /* Color de la parte superior del spinner */
    border-radius: 50%; /* Forma circular */
    width: 60px; /* Ancho del spinner */
    height: 60px; /* Alto del spinner */
    animation: spin 1s linear infinite; /* Animación de giro */
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.label-gray {
    font-weight: bold;
    color: #6c757d; /* Gris Bootstrap */
}

.value-gray {
    color: #797979; /* Gris claro para los valores */
}

/* ========================================
   MEDIA QUERIES RESPONSIVE
   ======================================== */

/* Pantallas grandes (1200px+) - Formulario más compacto */
@media (min-width: 1200px) {
    .container {
        max-width: 1000px;
    }

    .checkout-content {
        grid-template-columns: 1fr 350px;
        gap: 30px;
        max-width: 950px;
        margin: 0 auto;
    }

    .payment-form {
        max-width: 550px;
        padding: 30px 20px;
    }

    .summery-box {
        max-width: 350px;
        padding: 30px 20px;
    }
}

/* Pantallas extra grandes (1400px+) */
@media (min-width: 1400px) {
    .container {
        max-width: 1100px;
    }

    .checkout-content {
        grid-template-columns: 1fr 380px;
        gap: 35px;
        max-width: 1000px;
    }

    .payment-form {
        max-width: 580px;
        padding: 35px 25px;
    }

    .summery-box {
        max-width: 380px;
        padding: 35px 25px;
    }

    .checkout-header {
        max-width: 600px;
        margin: 0 auto 40px;
    }
}

/* Pantallas muy grandes (1600px+) */
@media (min-width: 1600px) {
    .container {
        max-width: 1200px;
        padding: 30px;
    }

    .checkout-content {
        max-width: 1050px;
        grid-template-columns: 1fr 400px;
        gap: 40px;
    }

    .payment-form {
        max-width: 600px;
        padding: 40px 30px;
    }

    .summery-box {
        max-width: 400px;
        padding: 40px 30px;
    }
}

/* Pantallas ultra anchas (1920px+) */
@media (min-width: 1920px) {
    .container {
        max-width: 1300px;
    }

    .checkout-content {
        max-width: 1100px;
        margin: 0 auto;
    }

    .payment-form {
        max-width: 650px;
    }

    .summery-box {
        max-width: 420px;
    }
}

/* Tablets (768px - 1024px) */
@media (max-width: 1024px) {
    .container {
        padding: 15px;
    }

    .checkout-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .summery-box {
        position: static;
        margin-bottom: 30px;
        order: -1;
    }

    .pageHeader {
        padding-left: 20px;
        padding-right: 20px;
    }

    .payment-form {
        padding: 30px 20px;
    }

    .summery-box {
        padding: 30px 20px;
    }
}

/* Móviles grandes (481px - 767px) */
@media (max-width: 767px) {
    .container {
        padding: 10px;
    }

    .checkout-header h1 {
        font-size: 2rem;
    }

    .pageHeader {
        height: auto;
        flex-direction: column;
        text-align: center;
        padding: 15px;
        gap: 10px;
    }

        .pageHeader .page-title h2,
        .pageHeader .commerce-name h2,
        .pageHeader .commerce-info h2 {
            font-size: 16px;
        }

    .lightSection {
        height: auto;
        padding: 20px 0;
    }

    .progress-wizard {
        padding: 0 10px 30px 10px;
    }

        .progress-wizard .progress-wizard-step {
            width: 50%;
            margin-bottom: 15px;
        }

    .form-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .payment-methods {
        flex-direction: column;
    }

    .payment-method {
        padding: 15px;
    }

    .payment-method-icon {
        font-size: 1.5rem;
    }

    .button-group {
        flex-direction: column-reverse;
        gap: 15px;
    }

    .checkout-btn {
        width: 100%;
        padding: 12px 20px;
    }

    .section-title {
        font-size: 18px;
    }

    .summery-box h4 {
        font-size: 18px;
    }

    .security-info {
        flex-direction: column;
        text-align: center;
        gap: 5px;
    }

    .card-icons {
        right: 10px;
    }

    .card-icon {
        width: 25px;
        height: 18px;
    }

    .payment-form {
        padding: 20px 15px;
    }

    .summery-box {
        padding: 20px 15px;
    }

    .order-confirm {
        padding: 40px 0 60px;
    }

        .order-confirm h2 {
            font-size: 24px;
        }
}

/* Móviles pequeños (hasta 480px) */
@media (max-width: 480px) {
    .container {
        padding: 8px;
    }

    .checkout-header h1 {
        font-size: 1.8rem;
    }

    .progress-wizard .progress-wizard-step {
        width: 100%;
        margin-bottom: 20px;
    }

        .progress-wizard .progress-wizard-step .progress-wizard-dot {
            width: 25px;
            height: 25px;
        }

            .progress-wizard .progress-wizard-step .progress-wizard-dot:after {
                width: 13px;
                height: 13px;
                top: 6px;
                left: 6px;
            }

        .progress-wizard .progress-wizard-step.disabled .progress-wizard-dot:after {
            width: 13px;
            height: 13px;
            top: 6px;
            left: 6px;
        }

    .payment-form {
        padding: 15px 10px;
        border-radius: 10px;
    }

    .summery-box {
        padding: 15px 10px;
        border-radius: 10px;
    }

    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="tel"] {
        padding: 12px;
        font-size: 14px;
    }

    select {
        padding: 8px 12px;
        font-size: 14px;
    }

    .select2-container--default .select2-selection--single {
        padding: 6px 10px;
        font-size: 14px;
    }

    .checkout-btn {
        font-size: 14px;
        letter-spacing: 0.5px;
    }

    .section-title {
        font-size: 16px;
    }

    .summery-box h4 {
        font-size: 16px;
    }

    .summary-item {
        font-size: 14px;
    }

    .flatpickr-monthSelect-month {
        flex: 1 0 45%;
        max-width: 45%;
        font-size: 14px;
        padding: 8px;
    }

    .spinner {
        width: 50px;
        height: 50px;
        border-width: 6px;
    }
}

/* Ajustes adicionales para pantallas muy pequeñas */
@media (max-width: 360px) {
    .checkout-header {
        margin-bottom: 20px;
        padding: 15px 0;
    }

        .checkout-header h1 {
            font-size: 1.6rem;
        }

    .form-section {
        margin-bottom: 20px;
    }

    .form-group {
        margin-bottom: 15px;
    }

    .progress-wizard {
        padding: 0 5px 20px 5px;
    }

    .flatpickr-calendar {
        min-width: 280px;
    }

    .flatpickr-monthSelect-month {
        flex: 1 0 100%;
        max-width: 100%;
        margin: 2px 0;
    }
}

/* Ajustes para landscape en móviles */
@media (max-width: 767px) and (orientation: landscape) {
    .progress-wizard .progress-wizard-step {
        width: 25%;
        margin-bottom: 10px;
    }

    .button-group {
        flex-direction: row;
    }

    .checkout-btn {
        width: auto;
    }
}


.modal-dialog {
    max-width: fit-content; /* Ajusta el ancho del modal al contenido */
    margin: auto; /* Centra el modal horizontalmente */
}

#challenge-iframe {
    display: block;
    margin: auto; /* Centra el iframe dentro del modal */
    border: none; /* Asegura que no haya borde */
}

.loaderIframe {
    width: 100%; /* Ancho completo */
    height: 50px; /* Alto del loader */
    background: white; /* Fondo blanco */
    z-index: 1; /* Menor que el iframe */
    display: flex; /* Para centrar el spinner */
    justify-content: center; /* Centrado horizontal */
    align-items: center; /* Centrado vertical */
    position: absolute; /* Para posicionarlo correctamente */
    top: 50%; /* Centrado verticalmente */
    left: 50%; /* Centrado horizontalmente */
    transform: translate(-50%, -50%); /* Ajuste para centrar */
}


/* Forzar que el logo se ajuste al header sin alterar el resto del estilo */
.pageHeader .commerce-name {
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden; /* evita que el logo se salga visualmente */
}

    .pageHeader .commerce-name img {
        max-height: 70px;
        max-width: 100%;
        object-fit: contain;
        width: auto;
        flex-shrink: 0;
    }

/* Cuando el header cambia a columna en móviles, reducimos el logo */
@media (max-width: 767px) {
    .pageHeader .commerce-name img {
        max-height: 50px;
    }
}