/* ===== ANIMACIONES DEL CARRITO ===== */

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

@keyframes cartBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2) rotate(5deg); }
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOutRight {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

@keyframes fadeInUp {
    from { 
        transform: translateY(30px); 
        opacity: 0; 
    }
    to { 
        transform: translateY(0); 
        opacity: 1; 
    }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* ===== ESTILOS ESPECÍFICOS DEL MODAL DEL CARRITO ===== */
.cart-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(232, 196, 204, 0.2);
    backdrop-filter: blur(12px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.cart-modal.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.cart-content {
    background: linear-gradient(135deg, var(--cream-light) 0%, var(--white) 50%, var(--blush-soft) 100%);
    border-radius: 20px;
    max-width: 600px;
    width: 95%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(232, 196, 204, 0.35);
    border: 1px solid var(--rose-gentle);
    animation: slideInUp 0.4s ease;
}

.cart-header {
    background: linear-gradient(135deg, var(--dusty-rose) 0%, var(--mauve-elegant) 100%);
    color: white;
    padding: 1.5rem 2rem;
    border-radius: 20px 20px 0 0;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(232, 196, 204, 0.35);
}

.cart-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.cart-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
    animation: float 6s ease-in-out infinite;
}

.cart-items {
    padding: 1.5rem;
    max-height: 50vh;
    overflow-y: auto;
    background: var(--cream-light);
}

.cart-item {
    animation: fadeInUp 0.3s ease;
    transition: all 0.3s ease;
    background: var(--white);
    border: 1px solid var(--rose-gentle);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 0.8rem;
}

.cart-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(232, 196, 204, 0.25);
    border-color: var(--dusty-rose);
}

/* Mejorar el espaciado del cart-footer */
.cart-footer {
    background: linear-gradient(135deg, var(--cream-warm) 0%, var(--blush-soft) 100%);
    padding: 1.8rem 2rem 1.5rem 2rem;
    border-top: 2px solid var(--rose-gentle);
    border-radius: 0 0 20px 20px;
    position: relative;
}

/* Estilos adicionales para el cart-total */
.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.8rem;
    padding: 1.2rem 1.5rem;
    background: linear-gradient(135deg, var(--white) 0%, var(--cream-light) 100%);
    border-radius: 12px;
    border: 2px solid var(--rose-gentle);
    font-size: 1.1rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(232, 196, 204, 0.25);
    transition: all 0.3s ease;
    position: relative;
    min-width: 200px;
    flex: 0 0 auto;
}

.cart-total::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--dusty-rose);
}

@keyframes gradientMove {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.cart-total:hover {
    border-color: var(--dusty-rose);
    box-shadow: 0 4px 12px rgba(232, 196, 204, 0.3);
    transform: translateY(-1px);
}

.cart-total span:first-child {
    color: #374151;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}

.cart-total span:first-child::before {
    content: '💰';
    font-size: 1rem;
}

.cart-total span:last-child {
    color: var(--dusty-rose);
    font-size: 1.5rem;
    font-weight: 700;
    margin-left: 0.5rem;
}

/* Estilos para los botones del carrito */
.cart-btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cart-btn:hover {
    transform: scale(1.1);
}

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

/* Estilos para el contador del carrito */
.cart-count {
    background: linear-gradient(135deg, var(--dusty-rose) 0%, var(--mauve-elegant) 100%);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    position: absolute;
    top: -8px;
    right: -8px;
    transition: all 0.3s ease;
    border: 2px solid var(--white);
    box-shadow: 0 2px 8px rgba(232, 196, 204, 0.35);
}

.cart-count.animate {
    animation: cartBounce 0.6s ease;
}

/* Estilos para los items del carrito */
.cart-item-info {
    flex: 1;
}

.cart-item-title {
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
}

.cart-item-options {
    color: #6b7280;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.cart-item-price {
    color: var(--dusty-rose);
    font-weight: 600;
    font-size: 0.9rem;
}

/* Botones de cantidad más pequeños y estéticos */
.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.cart-item-quantity button {
    width: 28px;
    height: 28px;
    border: 1px solid var(--rose-gentle);
    background: linear-gradient(135deg, var(--white) 0%, var(--cream-light) 100%);
    color: var(--charcoal-soft);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(232, 196, 204, 0.2);
}

.cart-item-quantity button:hover {
    background: linear-gradient(135deg, var(--blush-soft) 0%, var(--rose-whisper) 100%);
    border-color: var(--dusty-rose);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(232, 196, 204, 0.3);
    color: var(--dusty-rose);
}

.cart-item-quantity button:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.cart-item-quantity .quantity-display {
    min-width: 32px;
    height: 28px;
    background: linear-gradient(135deg, var(--cream-light) 0%, var(--white) 100%);
    border: 2px solid var(--rose-gentle);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--charcoal-soft);
    box-shadow: inset 0 1px 3px rgba(232, 196, 204, 0.15);
}

/* Botón de eliminar más pequeño y elegante */
.cart-item-remove {
    background: linear-gradient(135deg, var(--rose-whisper) 0%, var(--blush-soft) 100%);
    color: var(--dusty-rose);
    border: 1px solid var(--rose-gentle);
    width: 28px;
    height: 28px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(232, 196, 204, 0.2);
    margin-left: 0.5rem;
}

.cart-item-remove:hover {
    background: linear-gradient(135deg, var(--dusty-rose) 0%, var(--mauve-elegant) 100%);
    color: white;
    border-color: var(--dusty-rose);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(232, 196, 204, 0.35);
}

.cart-item-remove:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Estilos para el botón de eliminar */
.cart-item button[onclick*="removeFromCart"] {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.cart-item button[onclick*="removeFromCart"]:hover {
    background: #fef2f2;
    transform: scale(1.1);
}

/* Mejorar el botón de checkout con más separación */
#checkoutBtn {
    width: auto;
    min-width: 180px;
    max-width: 220px;
    background: linear-gradient(135deg, var(--dusty-rose) 0%, var(--mauve-elegant) 100%);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(232, 196, 204, 0.35);
    position: relative;
    letter-spacing: 0.1px;
    font-family: 'Inter', sans-serif;
    margin-left: 1rem;
    border: 2px solid transparent;
}

#checkoutBtn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

#checkoutBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(212, 164, 164, 0.4);
    background: linear-gradient(135deg, var(--mauve-elegant) 0%, var(--sage-elegant) 100%);
    border-color: var(--dusty-rose);
}

#checkoutBtn:hover::before {
    left: 100%;
}

#checkoutBtn:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(232, 196, 204, 0.35);
}

#checkoutBtn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(232, 196, 204, 0.35);
}

/* Estilos para el modal de opciones */
.product-options-modal {
    animation: fadeIn 0.3s ease;
}

.options-content {
    animation: slideInUp 0.4s ease;
}

/* Estilos para el modal de checkout */
.checkout-modal {
    animation: fadeIn 0.3s ease;
}

.checkout-content {
    animation: slideInUp 0.4s ease;
}

/* Estilos para la confirmación del pedido */
.order-confirmation-modal {
    animation: fadeIn 0.3s ease;
}

.confirmation-content {
    animation: slideInUp 0.4s ease;
}

/* Animaciones para los botones de opciones */
.option-btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.option-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.2);
}

.option-btn:active {
    transform: translateY(0);
}

/* Animaciones para las notificaciones */
.add-to-cart-notification {
    animation: slideInRight 0.4s ease;
}

.add-to-cart-notification.removing {
    animation: slideOutRight 0.4s ease;
}

/* Efectos de hover para botones */
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.btn:active {
    transform: translateY(0);
}

/* Animaciones para los modales */
.modal-content {
    animation: scaleIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes scaleIn {
    from { 
        transform: scale(0.9) translateY(20px); 
        opacity: 0; 
    }
    to { 
        transform: scale(1) translateY(0); 
        opacity: 1; 
    }
}

@keyframes slideInUp {
    from { 
        transform: translateY(30px); 
        opacity: 0; 
    }
    to { 
        transform: translateY(0); 
        opacity: 1; 
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Responsive para móviles */
@media (max-width: 768px) {
    .options-content,
    .checkout-content,
    .confirmation-content {
        width: 95%;
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .checkout-content {
        grid-template-columns: 1fr;
    }
    
    .cart-item {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .cart-item-quantity {
        margin: 0.5rem 0;
        justify-content: center;
    }
    
    .cart-item-quantity button {
        width: 26px;
        height: 26px;
        font-size: 12px;
    }
    
    .cart-item-quantity .quantity-display {
        min-width: 30px;
        height: 26px;
        font-size: 12px;
    }
    
    .cart-item-remove {
        width: 26px;
        height: 26px;
        font-size: 10px;
    }
    
    .cart-content {
        width: 95%;
        margin: 1rem;
        max-height: 95vh;
    }
    
    .cart-items {
        max-height: 40vh;
    }
    
    .cart-footer {
        padding: 1.5rem 1.5rem 1.2rem 1.5rem;
    }
    
    .cart-total {
        margin-bottom: 1.5rem;
        padding: 1rem 1.2rem;
        font-size: 1rem;
        min-width: 160px;
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .cart-total span:last-child {
        font-size: 1.3rem;
        margin-left: 0;
    }
    
    #checkoutBtn {
        padding: 0.7rem 1.4rem;
        font-size: 0.9rem;
        letter-spacing: 0.1px;
        width: 100%;
        min-width: auto;
        max-width: none;
        margin-left: 0;
        margin-top: 0.5rem;
    }
}
