/* ==========================================
   REGLA GENERAL PARA ELEMENTOS OCULTOS
========================================== */

[hidden] {
    display: none !important;
}


/* ==========================================
   CHECKOUT CON PAGO QR
========================================== */

.checkout-pago {
    padding-bottom: 90px;
}

.checkout-pago-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 430px);
    gap: 40px;
    align-items: start;
}

.resumen-checkout-pago,
.form-checkout-pago,
.pago-qr-tarjeta,
.comprobante-tarjeta {
    padding: 30px;
    background: #fff;
    border-radius: 22px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.07);
}

.resumen-checkout-pago > h3 {
    margin-bottom: 24px;
}

.checkout-lista-pago {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.checkout-item-pago {
    display: flex;
    align-items: center;
    gap: 15px;
    padding-bottom: 16px;
    border-bottom: 1px solid #eee;
}

.checkout-item-pago img {
    width: 76px;
    height: 76px;
    flex-shrink: 0;
    object-fit: cover;
    border-radius: 12px;
    background: #eee;
}

.checkout-item-pago h4 {
    margin-bottom: 4px;
}

.checkout-item-pago p {
    margin-bottom: 4px;
    color: #666;
    font-size: 13px;
}

.checkout-total-pago {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 2px solid #eee;
    font-size: 21px;
}

.checkout-total-pago strong {
    color: #8b7355;
    font-size: 25px;
}

.editar-carrito-pago {
    display: inline-block;
    margin-top: 18px;
    color: #8b7355;
    font-weight: 600;
}

.form-checkout-pago {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.campo-checkout-pago {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.campo-checkout-pago label {
    font-weight: 600;
}

.campo-checkout-pago input,
.campo-checkout-pago textarea {
    width: 100%;
    padding: 14px;
    border: 1px solid #ddd;
    border-radius: 10px;
    background: #fff;
    font: inherit;
}

.campo-checkout-pago input:focus,
.campo-checkout-pago textarea:focus {
    outline: 2px solid rgba(139, 115, 85, 0.2);
    border-color: #8b7355;
}

.campo-checkout-pago textarea {
    min-height: 115px;
    resize: vertical;
}

.aviso-pago-qr {
    padding: 15px;
    border-radius: 12px;
    background: #f4efe9;
}

.aviso-pago-qr strong {
    display: block;
    margin-bottom: 5px;
}

.aviso-pago-qr p {
    color: #665b4f;
    font-size: 13px;
    line-height: 1.6;
}

.estado-formulario-pago,
.mensaje-comprobante {
    min-height: 22px;
    font-size: 13px;
    line-height: 1.5;
}

.estado-formulario-pago.error,
.mensaje-comprobante.error {
    color: #b42318;
}

.estado-formulario-pago.exito,
.mensaje-comprobante.exito {
    color: #237a40;
}

.form-checkout-pago button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.checkout-vacio-pago {
    padding: 25px 0;
    text-align: center;
}

.checkout-vacio-pago p {
    margin: 10px 0 25px;
    color: #666;
}


/* ==========================================
   PÁGINA DE PAGO QR
========================================== */

.pagina-pago-qr {
    min-height: 75vh;
    padding: 45px 0 90px;
}

.pago-cargando,
.pago-error-general {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    min-height: 520px;
    gap: 18px;
    text-align: center;
}

.pago-error-general h1 {
    font-family: "Playfair Display", serif;
    font-size: 38px;
}

.pago-error-general p {
    max-width: 620px;
    color: #666;
    line-height: 1.7;
}

.pago-spinner {
    width: 42px;
    height: 42px;
    border: 4px solid #e2d9ce;
    border-top-color: #8b7355;
    border-radius: 50%;
    animation: girarPago 0.8s linear infinite;
}

@keyframes girarPago {
    to {
        transform: rotate(360deg);
    }
}

.pago-qr-grid {
    display: grid;
    grid-template-columns: minmax(320px, 0.85fr) minmax(420px, 1.15fr);
    gap: 32px;
    align-items: start;
}

.pago-paso {
    display: inline-flex;
    margin-bottom: 18px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #efe8df;
    color: #8b7355;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.pago-qr-tarjeta h1,
.comprobante-tarjeta h2 {
    margin-bottom: 12px;
    font-family: "Playfair Display", serif;
    font-size: 34px;
    line-height: 1.2;
}

.pago-instruccion {
    margin-bottom: 25px;
    color: #666;
    line-height: 1.7;
}

.pago-datos-principales {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 25px;
}

.pago-datos-principales > div {
    padding: 16px;
    border-radius: 12px;
    background: #f8f7f5;
}

.pago-datos-principales span {
    display: block;
    margin-bottom: 7px;
    color: #777;
    font-size: 12px;
}

.pago-datos-principales strong {
    font-size: 18px;
}

.contenedor-qr-banco {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 410px;
    padding: 20px;
    border: 1px solid #e4dbd0;
    border-radius: 16px;
    background: #fff;
}

.contenedor-qr-banco img {
    width: 100%;
    max-width: 330px;
    max-height: 440px;
    object-fit: contain;
}

.contenedor-qr-banco p {
    color: #b42318;
    text-align: center;
}

.descargar-qr {
    display: block;
    margin: 15px 0 20px;
    color: #8b7355;
    font-weight: 600;
    text-align: center;
}

.nota-pago-manual {
    padding: 18px;
    border-left: 4px solid #d9a956;
    background: #fff7e8;
}

.nota-pago-manual strong {
    display: block;
    margin-bottom: 7px;
}

.nota-pago-manual p {
    color: #665b4f;
    font-size: 13px;
    line-height: 1.7;
}

.estado-pago-visual {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    margin-bottom: 22px;
    padding: 17px;
    border-radius: 14px;
    background: #f3f3f3;
}

.estado-pago-icono {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #fff;
    font-weight: 700;
}

.estado-pago-visual strong {
    display: block;
    margin-bottom: 3px;
}

.estado-pago-visual p {
    color: #666;
    font-size: 13px;
    line-height: 1.5;
}

.estado-pago-visual.revision {
    background: #fff4da;
}

.estado-pago-visual.confirmado {
    background: #e7f6ec;
}

.estado-pago-visual.confirmado .estado-pago-icono {
    color: #237a40;
}

.estado-pago-visual.rechazado {
    background: #fee9e7;
}

.estado-pago-visual.rechazado .estado-pago-icono {
    color: #b42318;
}

.boton-whatsapp-pago,
.boton-comprobante-enviado {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 50px;
    border: none;
    border-radius: 999px;
    text-align: center;
    text-decoration: none;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.boton-whatsapp-pago {
    margin-bottom: 12px;
    background: #237a40;
    color: #fff;
}

.boton-whatsapp-pago:hover {
    background: #186531;
}

.boton-comprobante-enviado {
    background: #8b7355;
    color: #fff;
}

.boton-comprobante-enviado:hover {
    background: #6f5a43;
}

.boton-comprobante-enviado:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.mensaje-comprobante {
    margin-top: 12px;
}

.instrucciones-comprobante {
    margin-top: 25px;
    padding: 20px;
    border-radius: 14px;
    background: #f8f7f5;
}

.instrucciones-comprobante h3 {
    margin-bottom: 13px;
}

.instrucciones-comprobante ol {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-left: 20px;
    color: #555;
    line-height: 1.6;
}

.instrucciones-comprobante > p {
    margin-top: 14px;
    color: #777;
    font-size: 12px;
    line-height: 1.6;
}

.resumen-pago {
    margin-top: 28px;
    padding-top: 25px;
    border-top: 1px solid #eee;
}

.resumen-pago h3 {
    margin-bottom: 18px;
}

.producto-resumen-pago {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 14px 0;
    border-bottom: 1px solid #eee;
}

.producto-resumen-pago > div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.producto-resumen-pago span {
    color: #777;
    font-size: 12px;
}


/* ==========================================
   RESPONSIVE
========================================== */

@media (max-width: 900px) {

    /* El checkout previo continúa en una sola columna. */
    .checkout-pago-grid {
        grid-template-columns: 1fr;
    }

    /* En la pantalla final de pago conservamos Paso 1 y Paso 2 juntos. */
    .pago-qr-grid {
        grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
        gap: 16px;
    }

    .pago-qr-tarjeta,
    .comprobante-tarjeta {
        padding: 20px;
    }

    .pago-qr-tarjeta h1,
    .comprobante-tarjeta h2 {
        font-size: 29px;
    }

    .contenedor-qr-banco {
        min-height: 340px;
    }

}

@media (max-width: 600px) {

    .pagina-pago-qr {
        padding: 14px 0 45px;
    }

    .pagina-pago-qr > .container {
        width: calc(100% - 12px);
        max-width: none;
    }

    .resumen-checkout-pago,
    .form-checkout-pago {
        padding: 20px;
        border-radius: 17px;
    }

    .pago-qr-grid {
        grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
        gap: 8px;
        align-items: start;
    }

    .pago-qr-tarjeta,
    .comprobante-tarjeta {
        min-width: 0;
        padding: 10px;
        border-radius: 14px;
        box-shadow: 0 5px 18px rgba(0, 0, 0, 0.06);
    }

    .pago-paso {
        margin-bottom: 8px;
        padding: 4px 7px;
        font-size: 8px;
        letter-spacing: 0.2px;
    }

    .pago-qr-tarjeta h1,
    .comprobante-tarjeta h2 {
        margin-bottom: 7px;
        font-size: clamp(17px, 5.2vw, 22px);
        line-height: 1.08;
    }

    .pago-instruccion {
        margin-bottom: 12px;
        font-size: 9px;
        line-height: 1.45;
    }

    .pago-datos-principales {
        grid-template-columns: 1fr 1fr;
        gap: 5px;
        margin-bottom: 11px;
    }

    .pago-datos-principales > div {
        min-width: 0;
        padding: 7px 6px;
        border-radius: 8px;
    }

    .pago-datos-principales span {
        margin-bottom: 3px;
        font-size: 7px;
    }

    .pago-datos-principales strong {
        display: block;
        overflow-wrap: anywhere;
        font-size: 10px;
        line-height: 1.2;
    }

    .contenedor-qr-banco {
        min-height: 0;
        padding: 5px;
        border-radius: 10px;
    }

    .contenedor-qr-banco img {
        max-width: 100%;
        max-height: 260px;
    }

    .descargar-qr {
        margin: 8px 0 10px;
        font-size: 9px;
    }

    .nota-pago-manual {
        padding: 9px;
        border-left-width: 3px;
    }

    .nota-pago-manual strong {
        margin-bottom: 4px;
        font-size: 9px;
    }

    .nota-pago-manual p {
        font-size: 7.5px;
        line-height: 1.45;
    }

    .estado-pago-visual {
        grid-template-columns: 26px minmax(0, 1fr);
        gap: 6px;
        margin-bottom: 10px;
        padding: 8px 6px;
        border-radius: 9px;
    }

    .estado-pago-icono {
        width: 25px;
        height: 25px;
        font-size: 11px;
    }

    .estado-pago-visual strong {
        margin-bottom: 1px;
        font-size: 9px;
        line-height: 1.2;
    }

    .estado-pago-visual p {
        font-size: 7.5px;
        line-height: 1.35;
    }

    .selector-comprobante-drive {
        gap: 6px;
        margin-top: 10px;
        padding: 8px 6px;
        border-width: 1px;
        border-radius: 9px;
    }

    .selector-comprobante-icono {
        width: 26px;
        height: 26px;
        font-size: 16px;
    }

    .selector-comprobante-drive strong {
        font-size: 8.5px;
        line-height: 1.2;
    }

    .selector-comprobante-drive small {
        margin-top: 2px;
        font-size: 6.8px;
        line-height: 1.25;
    }

    .boton-subir-drive {
        min-height: 32px;
        margin-top: 8px;
        padding: 7px 5px;
        font-size: 8px;
    }

    .mensaje-comprobante {
        min-height: 12px;
        margin-top: 5px;
        font-size: 7.5px;
    }

    .instrucciones-comprobante {
        margin-top: 11px;
        padding: 8px;
        border-radius: 9px;
    }

    .instrucciones-comprobante h3,
    .resumen-pago h3 {
        margin-bottom: 7px;
        font-size: 10px;
        line-height: 1.2;
    }

    .instrucciones-comprobante ol {
        gap: 3px;
        padding-left: 12px;
        font-size: 7.3px;
        line-height: 1.35;
    }

    .instrucciones-comprobante > p {
        margin-top: 7px;
        font-size: 6.7px;
        line-height: 1.35;
    }

    .resumen-pago {
        margin-top: 12px;
        padding-top: 10px;
    }

    .producto-resumen-pago {
        align-items: center;
        flex-direction: row;
        gap: 5px;
        padding: 7px 0;
        font-size: 8px;
        line-height: 1.25;
    }

    .producto-resumen-pago > div {
        min-width: 0;
        gap: 2px;
    }

    .producto-resumen-pago strong {
        flex-shrink: 0;
        font-size: 8px;
    }

    .producto-resumen-pago span {
        font-size: 6.8px;
    }

}

@media (max-width: 380px) {

    .pagina-pago-qr > .container {
        width: calc(100% - 8px);
    }

    .pago-qr-grid {
        gap: 6px;
    }

    .pago-qr-tarjeta,
    .comprobante-tarjeta {
        padding: 8px;
    }

    .pago-qr-tarjeta h1,
    .comprobante-tarjeta h2 {
        font-size: 17px;
    }

    .contenedor-qr-banco img {
        max-height: 220px;
    }

}

/* ==========================================
   SUBIDA A GOOGLE DRIVE
========================================== */

.selector-comprobante-drive {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
    margin-top: 22px;
    padding: 18px;
    border: 2px dashed #cfc4b8;
    border-radius: 15px;
    background: #faf8f5;
    cursor: pointer;
    transition:
        border-color 0.2s ease,
        background 0.2s ease;
}

.selector-comprobante-drive:hover {
    border-color: #8b7355;
    background: #f4efe9;
}

.selector-comprobante-icono {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 50%;
    background: #8b7355;
    color: #fff;
    font-size: 25px;
}

.selector-comprobante-drive strong,
.selector-comprobante-drive small {
    display: block;
}

.selector-comprobante-drive small {
    margin-top: 4px;
    color: #777;
    line-height: 1.5;
}

.vista-archivo-comprobante {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 15px;
    align-items: center;
    margin-top: 16px;
    padding: 14px;
    border: 1px solid #e3ddd6;
    border-radius: 14px;
    background: #fff;
}

.vista-archivo-comprobante img,
.vista-pdf-comprobante {
    width: 88px;
    height: 88px;
    object-fit: cover;
    border-radius: 10px;
    background: #eee;
}

.vista-pdf-comprobante {
    display: flex;
    justify-content: center;
    align-items: center;
    color: #b42318;
    font-weight: 700;
}

.vista-archivo-datos {
    min-width: 0;
}

.vista-archivo-datos strong,
.vista-archivo-datos span {
    display: block;
}

.vista-archivo-datos strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vista-archivo-datos span {
    margin-top: 5px;
    color: #777;
    font-size: 13px;
}

.boton-subir-drive {
    width: 100%;
    margin-top: 16px;
    border: none;
    background: #176b38;
    color: #fff;
    font: inherit;
    cursor: pointer;
}

.boton-subir-drive:hover {
    background: #11572d;
}

.boton-subir-drive:disabled {
    cursor: not-allowed;
    opacity: 0.55;
    transform: none;
}

.estado-subida-drive {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    padding: 13px;
    border-radius: 12px;
    background: #f4efe9;
    color: #665b4f;
    font-size: 13px;
}

.pago-spinner.pequeno {
    width: 25px;
    height: 25px;
    border-width: 3px;
}

@media (max-width: 500px) {

    .vista-archivo-comprobante {
        grid-template-columns: 70px minmax(0, 1fr);
    }

    .vista-archivo-comprobante img,
    .vista-pdf-comprobante {
        width: 70px;
        height: 70px;
    }

}


/* Ajustes solicitados: mostrar únicamente el total en el paso de pago */
.pago-datos-principales.pago-total-unico {
    grid-template-columns: 1fr;
}

.pago-total-unico > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
}

.pago-total-unico span {
    margin-bottom: 0;
}

.pago-total-unico strong {
    color: #b95f43;
    font-size: 24px;
}

@media (max-width: 600px) {
    .pago-total-unico > div {
        align-items: flex-start;
        flex-direction: column;
        gap: 3px;
    }

    .pago-total-unico strong {
        font-size: 13px;
    }
}
