/* Cart Notification */
.cart-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #4CAF50;
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    max-width: 350px;
    pointer-events: none;
    border-left: 5px solid #45a049;
}

.cart-notification.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.cart-notification.error {
    background-color: #f44336;
    border-left-color: #d32f2f;
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.notification-content i {
    font-size: 20px;
}

/* Cart Counter */
.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(135deg, #ff4d4d, #ff1a1a);
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

/* Cart Page Styles */
.cart-section {
    padding: 60px 0;
    min-height: calc(100vh - 300px);
}

.cart-section h1 {
    color: #2c3e50;
    font-weight: 700;
    margin-bottom: 30px;
    position: relative;
    padding-bottom: 15px;
}

.cart-section h1:after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 70px;
    height: 3px;
    background: #4CAF50;
}

/* Cart Items */
.cart-items {
    margin-bottom: 30px;
}

.cart-item {
    background: #D1DBC7;/* para cambiar el color de l fondo de carrito de compras */
    border-radius: 10px;
    box-shadow: 0 2px 15px rgba(243, 120, 4, 0.05);
    margin-bottom: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #eee;
    overflow: hidden;
}

.cart-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.cart-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 8px 0 0 8px;
}

.cart-item h5 {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
}

.cart-item .price {
    color: #e74c3c;
    font-weight: 700;
    font-size: 1.1rem;
}

/* Quantity Selector */
.quantity-selector {
    display: flex;
    align-items: center;
    margin: 15px 0;
}

.quantity-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #ddd;
    background: #f8f9fa;
    color: #555;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quantity-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.quantity-btn:active {
    transform: scale(0.95);
}

.quantity-input {
    width: 50px;
    height: 32px;
    text-align: center;
    margin: 0 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

/* Remove Button */
.remove-item {
    background: none;
    border: none;
    color: #266993;
    cursor: pointer;
    font-size: 16px;
    padding: 5px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.remove-item:hover {
    background: rgba(220, 53, 69, 0.1);
}

/* Cart Summary */
.cart-summary {
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 20px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.cart-summary:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.cart-summary h4 {
    color: #2c3e50;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f1f1f1;
    font-size: 1.4rem;
    position: relative;
}

.cart-summary h4:after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 50px;
    height: 2px;
    background: #4CAF50;
}

.summary-details {
    margin: 20px 0;
}

.summary-details > div {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 15px;
    color: #4a5568;
    padding: 5px 0;
    border-bottom: 1px dashed #f0f0f0;
}

.summary-details .total {
    font-size: 1.3rem;
    color: #2d3748;
    font-weight: 700;
    border: none;
    padding-top: 10px;
    margin-top: 10px;
}

.summary-details .text-success {
    color: #38a169 !important;
    font-weight: 600;
}

.summary-details .shipping.text-success {
    font-weight: 700;
}

.summary-details .discount {
    color: #e53e3e;
}

.summary-details .discount.text-success {
    color: #38a169 !important;
}

.summary-details hr {
    margin: 18px 0;
    border: none;
    border-top: 2px dashed #e9ecef;
}

.checkout-btn {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    background: #f55308;
    border: none;
    border-radius: 8px;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    margin-top: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.2);
}

.checkout-btn:hover {
    background: #3d8b40;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.3);
}

.checkout-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(76, 175, 80, 0.2);
}

.checkout-btn:disabled {
    background: #a5d6a7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.7;
}

.checkout-btn i {
    margin-right: 8px;
    font-size: 1.1em;
}

/* Responsive adjustments */
@media (max-width: 991.98px) {
    .cart-summary {
        margin-top: 30px;
    }
}

/* Animation for price changes */
@keyframes priceUpdate {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.price-update {
    animation: priceUpdate 0.5s ease-in-out;
}

/* Empty Cart */
.empty-cart {
    text-align: center;
    padding: 50px 20px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
    border: 2px dashed #dee2e6;
}

.empty-cart i {
    font-size: 48px;
    color: #6c757d;
    margin-bottom: 20px;
    opacity: 0.7;
}

.empty-cart h3 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.empty-cart p {
    color: #6c757d;
    margin-bottom: 25px;
}

.empty-cart .btn {
    padding: 10px 30px;
    font-weight: 600;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

/* Responsive Styles */
@media (max-width: 991.98px) {
    .cart-section {
        padding: 40px 0;
    }
    
    .cart-item {
        margin-bottom: 15px;
    }
    
    .cart-item img {
        height: 100px;
    }
}

@media (max-width: 767.98px) {
    .cart-section h1 {
        font-size: 24px;
        margin-bottom: 25px;
    }
    
    .cart-item {
        flex-direction: row;
    }
    
    .cart-item img {
        width: 100px;
        height: 100px;
        border-radius: 8px 0 0 8px;
    }
    
    .cart-summary {
        margin-top: 30px;
    }
}

@media (max-width: 575.98px) {
    .cart-item {
        flex-direction: column;
    }
    
    .cart-item img {
        width: 100%;
        height: 150px;
        border-radius: 8px 8px 0 0;
    }
    
    .cart-section h1 {
        font-size: 22px;
    }
    
    .empty-cart {
        padding: 30px 15px;
    }
    
    .empty-cart i {
        font-size: 36px;
    }
    
    .quantity-btn {
        width: 44px;
        height: 44px;
        font-size: 20px;
    }
    .quantity-input {
        height: 44px;
        width: 60px;
        font-size: 16px;
    }
    .remove-item {
        font-size: 14px;
        padding: 10px 12px;
    }
}

/* iOS Safe Area para notificación */
@supports (padding: max(0px)) {
    .cart-notification {
        top: max(env(safe-area-inset-top, 0px), 20px);
        right: max(env(safe-area-inset-right, 0px), 20px);
    }
}

/* Touch optimization */
.quantity-btn,
.remove-item,
.checkout-btn {
    touch-action: manipulation;
}
