/* 
 * RECO: Estilos del Carrito y Checkout (Carga Condicional) 
 */

/* --- 1. AVISOS GLOBALES WOOCOMMERCE --- */
.woocommerce-message, .woocommerce-error, .woocommerce-info {
    background-color: var(--reco-color-secundario);
    border-left: 4px solid var(--reco-color-primario);
    padding: var(--reco-espacio-sm) var(--reco-espacio-md);
    margin-bottom: var(--reco-espacio-md);
    list-style: none;
    font-weight: 500;
}
.woocommerce-error { border-left-color: #e53e3e; color: #e53e3e; }

/* --- 2. EL CARRITO --- */
.woocommerce-cart-form {
    margin-bottom: var(--reco-espacio-lg);
}

table.shop_table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

table.shop_table th, table.shop_table td {
    padding: var(--reco-espacio-sm);
    border-bottom: 1px solid var(--reco-color-borde);
}

.product-thumbnail img {
    width: 80px;
    height: auto;
    border-radius: 4px;
}

.product-remove a {
    color: #e53e3e;
    font-size: 1.5rem;
    font-weight: bold;
}

.product-remove a:hover { opacity: 0.7; }

/* Carrito Responsive (Móviles) */
@media (max-width: 767px) {
    table.shop_table thead { display: none; }
    table.shop_table tr {
        display: block;
        margin-bottom: var(--reco-espacio-md);
        border: 1px solid var(--reco-color-borde);
        padding: var(--reco-espacio-sm);
    }
    table.shop_table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: right;
        border-bottom: 1px solid var(--reco-color-borde);
    }
    table.shop_table td:last-child { border-bottom: none; }
    table.shop_table td::before {
        content: attr(data-title);
        font-weight: bold;
        margin-right: var(--reco-espacio-sm);
    }
    .product-thumbnail { justify-content: center !important; }
    .product-thumbnail::before { display: none; }
}

/* Totales del Carrito */
.cart-collaterals {
    max-width: 400px;
    margin-left: auto;
    background: var(--reco-color-secundario);
    padding: var(--reco-espacio-md);
    border-radius: 8px;
}

.checkout-button {
    display: block;
    width: 100%;
    text-align: center;
    background-color: var(--reco-color-primario);
    color: var(--reco-color-fondo);
    padding: 1rem;
    margin-top: var(--reco-espacio-md);
    border-radius: 4px;
    font-weight: bold;
    transition: opacity 0.2s;
}

/* --- 3. CHECKOUT (Pantalla de Pago) --- */
form.checkout {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--reco-espacio-lg);
}

/* 2 Columnas en PC */
@media (min-width: 992px) {
    form.checkout {
        grid-template-columns: 60% 1fr;
        align-items: start;
    }
    /* Hace que el resumen de pago te siga al hacer scroll */
    #order_review_heading, #order_review {
        position: sticky;
        top: 20px;
    }
}

/* Campos del Formulario */
.form-row {
    margin-bottom: var(--reco-espacio-sm);
    display: flex;
    flex-direction: column;
}

.form-row label {
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 0.9rem;
}

.form-row input, .form-row select, .form-row textarea {
    padding: 0.75rem;
    border: 1px solid var(--reco-color-borde);
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
}

/* Resumen del Pedido y Pasarelas de Pago */
#order_review {
    background-color: var(--reco-color-secundario);
    padding: var(--reco-espacio-md);
    border-radius: 8px;
    border: 1px solid var(--reco-color-borde);
}

#payment {
    margin-top: var(--reco-espacio-md);
    background: var(--reco-color-fondo);
    padding: var(--reco-espacio-sm);
    border-radius: 4px;
}

.payment_methods {
    list-style: none;
    margin-bottom: var(--reco-espacio-md);
}

.payment_box {
    padding: var(--reco-espacio-sm);
    background: var(--reco-color-secundario);
    font-size: 0.9rem;
    margin-top: 8px;
    border-radius: 4px;
}

#place_order {
    width: 100%;
    padding: 1rem;
    background: var(--reco-color-primario);
    color: var(--reco-color-fondo);
    border: none;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    transition: opacity 0.2s;
}

#place_order:hover, .checkout-button:hover {
    opacity: 0.8;
}