/* === cart-styles.css === */

/* Contenedor principal de los ítems del carrito */
.cart-items-container {
    width: 100%;
    margin-bottom: 40px;
    border-top: 1px solid var(--border-color);
}

/* Estilo para cada fila de ítem en el carrito */
.cart-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 10px;
    border-bottom: 1px solid var(--border-color);
    gap: 20px;
    flex-wrap: wrap; /* Para responsividad */
}

/* Información del producto (Nombre y Precio) */
.cart-item .item-info {
    flex: 3; /* Ocupa la mayor parte del espacio */
    min-width: 200px;
}

.cart-item .item-name {
    font-size: 1.1em;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 5px;
}

.cart-item .item-unit-price {
    font-size: 0.9em;
    color: #a0a0a0;
}

/* Control de cantidad */
.item-quantity-control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex: 1;
    min-width: 120px;
}

.quantity-btn {
    background-color: var(--border-color);
    color: var(--text-color);
    border: none;
    width: 30px;
    height: 30px;
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.quantity-btn:hover {
    background-color: var(--primary-color);
    color: var(--secondary-color);
}

.item-quantity {
    font-size: 1.1em;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

/* Precio total del ítem */
.item-total-price {
    flex: 1;
    text-align: right;
    font-size: 1.1em;
    font-weight: 600;
    color: var(--primary-color);
    min-width: 100px;
}

/* Botón para eliminar */
.remove-item-btn {
    background: none;
    border: none;
    color: #a0a0a0;
    font-size: 1.3em;
    cursor: pointer;
    transition: color 0.3s ease;
    padding: 5px;
}

.remove-item-btn:hover {
    color: #f44336; /* Rojo al pasar el ratón */
}

/* Resumen del carrito */
.cart-summary {
    display: flex;
    justify-content: flex-end; /* Alinea todo a la derecha */
    flex-wrap: wrap;
    gap: 30px;
    width: 100%;
    background-color: var(--card-bg);
    padding: 30px;
    border-radius: 12px;
}

.cart-totals, .cart-actions {
    flex: 1;
    max-width: 450px; /* Ancho máximo para cada sección */
}

.cart-totals {
    text-align: right;
}
.cart-totals h3 {
    font-size: 1.5em;
    margin-bottom: 20px;
    color: var(--text-color);
}
.cart-totals p {
    font-size: 1.1em;
    margin-bottom: 10px;
    color: #a0a0a0;
}
.cart-totals p span {
    color: var(--text-color);
    font-weight: 600;
}
.cart-totals .total-line span {
    color: var(--primary-color);
    font-size: 1.4em;
}

.cart-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.cart-actions .btn {
    width: 100%;
    justify-content: center;
}

.paypal-checkout-section {
    margin-top: 15px;
    border-top: 1px dashed var(--border-color);
    padding-top: 20px;
    text-align: center;
}

.paypal-intro {
    font-size: 1em;
    margin-bottom: 15px;
    color: var(--text-color);
}

.paypal-note {
    font-size: 0.8em;
    color: #a0a0a0;
    margin-top: 10px;
    display: block;
}

/* Mensaje de carrito vacío */
.no-records {
    text-align: center;
    padding: 50px 20px;
    background-color: var(--card-bg);
    border-radius: 12px;
    width: 100%;
}
.no-records p {
    font-size: 1.3em;
    margin-bottom: 20px;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .cart-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    .item-total-price, .cart-totals {
        text-align: left;
    }
    .cart-summary {
        justify-content: center;
        flex-direction: column;
        align-items: center;
    }
    .cart-totals, .cart-actions {
        width: 100%;
        max-width: none;
    }
    .cart-totals {
        text-align: center;
    }
}