/* assets/css/checkout.css */

.page-checkout {
    background-color: #f4f4f4;
    min-height: 85vh;
    padding: 40px 10px;
}

.checkout-title {
    font-size: 28px;
    font-weight: 800;
    color: #333;
    margin: 0 0 30px 0;
    /* Alineado a la izquierda standard */
}

/* --- GRID PRINCIPAL (Igual al Carrito) --- */
.checkout-grid {
    display: grid;
    grid-template-columns: 1fr 380px; /* Columna Izq Flexible | Derecha Fija */
    gap: 40px; 
    align-items: start;
}

/* --- TARJETAS --- */
.checkout-card {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
    border: 1px solid #eee;
    margin-bottom: 25px;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.card-title {
    font-size: 18px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
}

/* --- DATOS DEL CLIENTE --- */
.user-info-row {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.info-item {
    font-size: 15px;
    color: #555;
    background: #f9f9f9;
    padding: 12px 15px;
    border-radius: 8px;
    border: 1px solid #eee;
}
.info-item strong {
    color: #333;
    margin-right: 8px;
    font-weight: 700;
}

/* --- FORMULARIOS (Inputs y Textareas) --- */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-size: 13px;
    color: #555;
    margin-bottom: 8px;
    font-weight: 600;
}

.custom-input,
.custom-textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    background-color: #fff;
    transition: all 0.2s;
    color: #333;
}

.custom-input:focus,
.custom-textarea:focus {
    border-color: #6AA8D5;
    outline: none;
    box-shadow: 0 0 0 3px rgba(106, 168, 213, 0.15);
}

.custom-input:disabled {
    background-color: #f9f9f9;
    color: #999;
    cursor: not-allowed;
    border-color: #eee;
}

.custom-textarea {
    resize: vertical;
}

/* Responsive Forms */
@media(max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr; /* Una columna en celulares */
        gap: 10px;
        margin-bottom: 10px;
    }
}

/* --- RESUMEN (DERECHA) --- */
.summary-card {
    position: sticky;
    top: 20px;
    border-top: 5px solid #27ae60;
}

.summary-list {
    max-height: 350px;
    overflow-y: auto;
    margin-bottom: 20px;
    padding-right: 5px;
}
.summary-list::-webkit-scrollbar { width: 4px; }
.summary-list::-webkit-scrollbar-thumb { background: #ddd; border-radius: 4px; }

.sum-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 13px;
    color: #555;
    padding-bottom: 12px;
    border-bottom: 1px dashed #eee;
}
.sum-item:last-child { border-bottom: none; margin-bottom: 0; }

.sum-name { flex: 1; padding-right: 10px; line-height: 1.3; font-weight: 500; }
.sum-name span { display: block; font-size: 11px; color: #999; margin-top: 3px; }
.sum-price { font-weight: 700; color: #333; white-space: nowrap; }

.total-section {
    background-color: #f0fcf4;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    border: 1px solid #e0f2e9;
}

.total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 15px;
    color: #555;
}
.total-row.final {
    margin-top: 10px;
    font-size: 22px;
    font-weight: 800;
    color: #27ae60;
    border-top: 1px solid rgba(0,0,0,0.05);
    padding-top: 10px;
}

/* BOTÓN CONFIRMAR DESKTOP */
.btn-confirmar {
    width: 100%;
    padding: 15px;
    background-color: #27ae60;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 800;
    font-size: 16px;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.2s;
    margin-top: 20px;
    box-shadow: 0 4px 10px rgba(39, 174, 96, 0.3);
}
.btn-confirmar:hover { background-color: #219150; transform: translateY(-2px); }
.btn-confirmar:disabled { background-color: #ccc; cursor: not-allowed; transform: none; box-shadow: none; }

/* Aviso transferencia bancaria */
.aviso-pago-checkout {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    background: #fffbf0;
    border: 1px solid #f0c060;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 18px;
}
.aviso-pago-icon { font-size: 26px; flex-shrink: 0; line-height: 1; }
.aviso-pago-checkout strong {
    display: block;
    font-size: 13px;
    font-weight: 800;
    color: #7a5c00;
    margin-bottom: 5px;
}
.aviso-pago-checkout p {
    margin: 0;
    font-size: 12px;
    color: #8a6a00;
    line-height: 1.6;
}

/* --- ENLACE VOLVER (SUTIL) --- */
.back-link-text {
    display: inline-block;
    margin-top: 20px;
    color: #888;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
}
.back-link-text:hover { color: #666; text-decoration: underline; }

/* LOADING */
#loadingMsg {
    margin-top: 15px;
    color: #666;
    font-size: 13px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* --- BARRA FIJA MÓVIL (Sticky Footer) --- */
.mobile-sticky-footer {
    display: none; /* Oculto en PC */
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #fff;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
    padding: 15px 20px;
    z-index: 1000;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    border-top: 1px solid #eee;
}

.msf-total {
    display: flex;
    flex-direction: column;
}
.msf-total span { font-size: 11px; color: #888; text-transform: uppercase; font-weight: 700; }
.msf-total strong { font-size: 20px; color: #27ae60; font-weight: 800; }

.btn-confirmar-mobile {
    background-color: #27ae60;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 25px;
    font-weight: 800;
    font-size: 14px;
    text-transform: uppercase;
    flex: 1; /* Ocupa el espacio restante */
    max-width: 200px;
    box-shadow: 0 4px 10px rgba(39, 174, 96, 0.3);
}

/* RESPONSIVE */
@media(max-width: 900px) {
    .checkout-grid {
        grid-template-columns: 1fr; /* Una columna */
    }
    
    /* En móvil ocultamos el botón grande de la tarjeta resumen 
       porque ya tenemos el sticky footer */
    #btnConfirmarDesktop {
        display: none;
    }

    /* Mostramos el footer fijo */
    .mobile-sticky-footer {
        display: flex;
    }
    
    /* El resumen lo mandamos arriba de todo si querés, 
       o lo dejamos abajo. Por defecto en Grid está abajo del form. 
       Si querés resumen arriba descomenta esto: */
    /* .summary-card { order: -1; } 
    */
}