/* CartPopup.css - Mobile First */

.cart-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5); /* Fondo semitransparente */
    z-index: 10000; /* Encima de todo */
    display: flex;
    justify-content: flex-end; /* Alinea el popup a la derecha */
    animation: fadeInOverlay 0.3s ease-out;
}

@keyframes fadeInOverlay {
    from { background-color: rgba(0, 0, 0, 0); }
    to { background-color: rgba(0, 0, 0, 0.5); }
}

.cart-popup-content {
    background-color: #fff;
    width: 100%;
    max-width: 380px; /* Ancho del popup */
    height: 100%; /* Ocupa toda la altura */
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    animation: slideInCart 0.3s ease-out;
}

@keyframes slideInCart {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

.cart-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e9ecef;
}

.cart-popup-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: #333;
}

.cart-popup-close {
    background: none;
    border: none;
    font-size: 1.75rem;
    color: #6c757d;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
}
.cart-popup-close:hover {
    color: #333;
}

.cart-popup-empty {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
    color: #6c757d;
}

.cart-popup-items {
    flex-grow: 1; /* Ocupa el espacio disponible */
    overflow-y: auto; /* Scroll si hay muchos ítems */
    padding: 0.75rem 1.25rem;
}

.cart-popup-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.cart-popup-item:last-child {
    border-bottom: none;
}

.cart-item-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 1rem;
}

.cart-item-details {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.cart-item-name {
    font-size: 0.95rem;
    font-weight: 500;
    color: #333;
    margin-bottom: 0.25rem;
}

.cart-item-quantity {
    font-size: 0.85rem;
    color: #555;
}

.cart-item-price {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-verde, #28a745);
    margin-left: 1rem;
}

.cart-popup-summary {
    padding: 1rem 1.25rem;
    border-top: 1px solid #e9ecef;
    background-color: #f8f9fa;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.summary-total span {
    color: #495057;
}

.summary-total strong {
    font-size: 1.25rem;
    color: #212529;
}

.btn-pagar {
    display: block;
    width: 100%;
    padding: 0.8rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: #fff;
    background-color: var(--color-azul, #007bff);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.2s ease;
}

.btn-pagar:hover {
    background-color: #0056b3; /* Un azul más oscuro */
}

/* Para pantallas más grandes, el popup podría no ocupar toda la altura */
@media (min-width: 768px) {
    .cart-popup-content {
        height: auto; /* Altura automática */
        max-height: 90vh; /* Pero no más alto que la pantalla */
        border-radius: 8px 0 0 8px; /* Redondear esquinas si no es pantalla completa */
    }
}
