/* ============================================
   FORMULARIO RESPONSIVE - TERMAS PAPALLACTA
   ============================================ */

/* ── Variables globales ───────────────────────── */
:root {
    /* Modo de color — forzar light en todo el sitio */
    color-scheme: light;

    /* Paleta recepcion */
    --verde-termas:  #2d6a4f;
    --rojo-suave:    #c0392b;
    --amarillo:      #e67e22;
    --gris-fondo:    #f4f6f3;
    --gris-texto:    #4a5568;
    --blanco:        #ffffff;
    --sombra:        0 4px 24px rgba(0,0,0,0.08);
    --radio:         12px;
}

/* RESET Y ESTILOS BASE */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

/* CONTENEDOR PRINCIPAL
   Absorbe index-carrito.css — ya puedes eliminar ese <link> de todos los archivos */
.contenedor {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
}

.contenido-productos {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    margin-bottom: 25px;
}

/* TÍTULOS */
.titulos {
    font-size: 28px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 10px;
    text-align: center;
}

.subtitulo-formulario {
    font-size: 14px;
    color: #666;
    text-align: center;
    margin-bottom: 30px;
    font-style: italic;
}

/* FIELDSETS - SECCIONES */
.seccion-formulario {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 25px;
    background-color: #fafafa;
}

.seccion-formulario legend {
    font-size: 16px;
    font-weight: bold;
    color: #2c3e50;
    padding: 0 10px;
    margin-left: -10px;
}

/* GRUPOS DE FORMULARIO */
.grupo-formulario {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}

.grupo-formulario:last-child {
    margin-bottom: 0;
}

/* ETIQUETAS */
.etiqueta-formulario {
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    display: block;
}

.campo-obligatorio {
    color: #e74c3c;
    font-weight: bold;
    margin-left: 2px;
}

/* INPUTS Y SELECTS */
.input-formulario,
.cuadro-formulario select,
select[name="billingCountry"] {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s, box-shadow 0.3s;
    background-color: white;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 20px;
    padding-right: 40px;
}

.input-formulario:focus,
.cuadro-formulario select:focus,
select[name="billingCountry"]:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
    background-color: #f8fbfc;
}

/* INPUT DE MONTO ESPECIAL */
.input-monto {
    font-size: 18px;
    font-weight: bold;
    color: #27ae60;
}

/* TEXTO DE AYUDA */
.texto-ayuda {
    font-size: 12px;
    color: #7f8c8d;
    margin-top: 6px;
    display: block;
}

/* CHECKBOX */
.grupo-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 15px;
}

.grupo-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    cursor: pointer;
    accent-color: #3498db;
}

.grupo-checkbox label {
    font-size: 14px;
    color: #555;
    cursor: pointer;
    line-height: 1.4;
}

/* SECCIÓN DE TÉRMINOS */
.confirmacion-formulario {
    background-color: #ecf0f1;
    padding: 20px;
    border-radius: 6px;
    border-left: 4px solid #3498db;
}

.confirmacion-formulario a {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #3498db;
    text-decoration: none;
    font-weight: 600;
    margin-bottom: 15px;
}

.confirmacion-formulario a:hover {
    color: #2980b9;
    text-decoration: underline;
}

.confirmacion-formulario a img {
    max-width: 24px;
    height: auto;
}

/* BOTONES */
.btn {
    padding: 14px 30px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 4px;
    border: 2px solid;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
    margin-top: 20px;
}

.btn-outline-primary {
    color: #3498db;
    border-color: #3498db;
    background-color: white;
}

.btn-outline-primary:hover {
    background-color: #3498db;
    color: white;
}

.btn-outline-primary:active {
    background-color: #2980b9;
    border-color: #2980b9;
}

/* MENSAJES DE ERROR */
.input-formulario:invalid:not(:placeholder-shown),
.cuadro-formulario select:invalid {
    border-color: #e74c3c;
    background-color: #fadbd8;
}

.input-formulario:valid:not(:placeholder-shown),
.cuadro-formulario select:valid {
    border-color: #27ae60;
    background-color: #d5f4e6;
}

/* ============================================
   RESPONSIVE - TABLET (768px y menos)
   ============================================ */

@media (max-width: 768px) {
    .contenedor {
        padding: 15px;
    }

    .contenido-productos {
        padding: 20px;
    }

    .titulos {
        font-size: 24px;
    }

    .seccion-formulario {
        padding: 15px;
        margin-bottom: 20px;
    }

    .seccion-formulario legend {
        font-size: 15px;
    }

    .etiqueta-formulario {
        font-size: 13px;
    }

    .input-formulario,
    .cuadro-formulario select {
        padding: 11px 12px;
        font-size: 16px; /* Previene zoom en inputs en iOS */
    }

    .btn {
        padding: 12px 20px;
        font-size: 15px;
    }
}

/* ============================================
   RESPONSIVE - MÓVIL (480px y menos)
   ============================================ */

@media (max-width: 480px) {
    .contenedor {
        padding: 10px;
    }

    .contenido-productos {
        padding: 15px;
    }

    .titulos {
        font-size: 20px;
        margin-bottom: 8px;
    }

    .subtitulo-formulario {
        font-size: 13px;
        margin-bottom: 20px;
    }

    .seccion-formulario {
        padding: 12px;
        margin-bottom: 15px;
        border-radius: 4px;
    }

    .seccion-formulario legend {
        font-size: 14px;
        padding: 0 8px;
        margin-left: -8px;
    }

    .grupo-formulario {
        margin-bottom: 15px;
    }

    .etiqueta-formulario {
        font-size: 12px;
        margin-bottom: 6px;
    }

    .input-formulario,
    .cuadro-formulario select {
        padding: 10px 10px;
        font-size: 16px;
        border-radius: 3px;
    }

    .texto-ayuda {
        font-size: 11px;
        margin-top: 4px;
    }

    .btn {
        padding: 12px 15px;
        font-size: 14px;
        margin-top: 15px;
    }

    .confirmacion-formulario {
        padding: 15px;
        font-size: 11px;
    }

    .confirmacion-formulario a {
        font-size: 13px;
    }

    .grupo-checkbox {
        gap: 8px;
    }

    .grupo-checkbox input[type="checkbox"] {
        width: 18px;
        height: 18px;
    }

    .grupo-checkbox label {
        font-size: 13px;
    }
}

/* ============================================
   MODO OSCURO — forzado a light
   ============================================ */

html,
body {
    background: #f5f5f5 !important;
    color: #333 !important;
    color-scheme: light;
}

.contenido-productos,
.seccion-formulario,
.confirmacion-formulario,
.input-formulario,
.cuadro-formulario select,
select[name="billingCountry"],
.btn,
table,
td,
th {
    color-scheme: light;
}

input,
select,
textarea {
    background-color: #ffffff !important;
    color: #333333 !important;
    -webkit-text-fill-color: #333333 !important;
    opacity: 1;
}

input::placeholder,
textarea::placeholder {
    color: #7f8c8d !important;
}

@media (prefers-color-scheme: dark) {
    html, body {
        background: #f5f5f5 !important;
        color: #333 !important;
    }

    .contenido-productos {
        background: #ffffff !important;
        color: #333 !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    }

    .seccion-formulario {
        background-color: #fafafa !important;
        border-color: #e0e0e0 !important;
    }

    .titulos,
    .etiqueta-formulario,
    .subtitulo-formulario,
    .texto-ayuda,
    .grupo-checkbox label,
    .confirmacion-formulario,
    .confirmacion-formulario a {
        color: #333 !important;
    }

    .input-formulario,
    .cuadro-formulario select,
    select[name="billingCountry"] {
        background-color: #ffffff !important;
        color: #333 !important;
        border-color: #bdc3c7 !important;
        -webkit-text-fill-color: #333 !important;
    }

    .input-formulario:focus,
    .cuadro-formulario select:focus,
    select[name="billingCountry"]:focus {
        background-color: #f8fbfc !important;
        color: #333 !important;
    }

    .btn-outline-primary {
        background-color: #ffffff !important;
        color: #3498db !important;
        border-color: #3498db !important;
    }

    .btn-outline-primary:hover {
        background-color: #3498db !important;
        color: #ffffff !important;
    }
}

/* ============================================
   RECEPCION - CONFIRMACIÓN DE PAGO ALIGNET
   ============================================ */

/* ── Contenedor central ───────────────────────── */
.recepcion-wrap {
    max-width: 640px;
    margin: 48px auto 80px;
    padding: 0 20px;
}

/* ── Card principal ───────────────────────────── */
.card-confirmacion {
    background: var(--blanco);
    border-radius: var(--radio);
    box-shadow: var(--sombra);
    overflow: hidden;
}

/* ── Cabecera de estado ───────────────────────── */
.estado-header {
    padding: 40px 36px 32px;
    text-align: center;
}

.estado-exitoso   .estado-header { background: linear-gradient(135deg, #1b4332 0%, var(--verde-termas) 100%); }
.estado-denegado  .estado-header { background: linear-gradient(135deg, #7b1a1a 0%, var(--rojo-suave) 100%); }
.estado-cancelado .estado-header { background: linear-gradient(135deg, #7d5a00 0%, var(--amarillo) 100%); }

.estado-icono-wrap {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    border: 2px solid rgba(255,255,255,0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 32px;
    color: var(--blanco);
}

.estado-titulo {
    font-family: 'Playfair Display', serif;
    font-size: 26px;
    color: var(--blanco);
    margin: 0 0 10px;
}

.estado-subtitulo {
    font-size: 14px;
    color: rgba(255,255,255,0.82);
    line-height: 1.5;
    max-width: 400px;
    margin: 0 auto;
}

/* ── Cuerpo del card ──────────────────────────── */
.card-body-custom {
    padding: 32px 36px;
}

/* ── Tabla de detalle ─────────────────────────── */
.tabla-detalle {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 28px;
}

.tabla-detalle tr {
    border-bottom: 1px solid #eef0ed;
}

.tabla-detalle tr:last-child {
    border-bottom: none;
}

.tabla-detalle td {
    padding: 12px 4px;
    font-size: 14px;
    vertical-align: top;
}

.tabla-detalle td:first-child {
    color: #888;
    font-weight: 500;
    width: 45%;
    padding-right: 12px;
}

.tabla-detalle td:last-child {
    color: #2d3748;
    font-weight: 400;
    word-break: break-word;
}

/* ── Fila de monto destacado ──────────────────── */
.fila-monto td {
    padding-top: 16px !important;
}

.fila-monto td:first-child {
    font-size: 15px;
    color: var(--gris-texto);
    font-weight: 600;
}

.monto-valor {
    font-family: 'Playfair Display', serif;
    font-size: 22px;
    color: var(--verde-termas);
    font-weight: 700;
}

/* ── Separador de sección ─────────────────────── */
.seccion-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #aaa;
    margin: 24px 0 12px;
}

/* ── Botones recepcion ────────────────────────── */
.btn-volver {
    display: block;
    width: 100%;
    padding: 14px;
    text-align: center;
    background: var(--verde-termas);
    color: var(--blanco);
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    margin-top: 8px;
    transition: background 0.2s;
}

.btn-volver:hover {
    background: #1b4332;
    color: var(--blanco);
    text-decoration: none;
}

.btn-intentar {
    display: block;
    width: 100%;
    padding: 14px;
    text-align: center;
    background: transparent;
    color: var(--verde-termas);
    border: 2px solid var(--verde-termas);
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    margin-top: 12px;
    transition: all 0.2s;
}

.btn-intentar:hover {
    background: var(--verde-termas);
    color: var(--blanco);
    text-decoration: none;
}

/* ── Nota de seguridad ────────────────────────── */
.nota-seguridad {
    font-size: 12px;
    color: #aaa;
    text-align: center;
    margin-top: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* ── Responsive recepcion ─────────────────────── */
@media (max-width: 480px) {
    .recepcion-wrap   { margin-top: 24px; }
    .estado-header    { padding: 28px 20px 24px; }
    .card-body-custom { padding: 24px 20px; }
    .estado-titulo    { font-size: 22px; }
}
