/**
 * CART STYLES - Panel Lateral del Carrito
 * Lauren Repostería 2025
 * Diseño premium con glassmorphism
 */

/* ===== VARIABLES ===== */
:root {
    --cart-width: 420px;
    --cart-bg: rgba(255, 255, 255, 0.95);
    --cart-glass-blur: 20px;
    --cart-shadow: 0 0 40px rgba(0, 0, 0, 0.15);
    --cart-accent: #b8a4d4;
    --cart-accent-gradient: linear-gradient(135deg, #b8a4d4 0%, #9d84c4 100%);
    --cart-text: #1a1a1a;
    --cart-text-light: #666;
    --cart-border: rgba(184, 164, 212, 0.2);
    --cart-transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== OVERLAY ===== */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 10999;
    opacity: 0;
    visibility: hidden;
    transition: all var(--cart-transition);
}

.cart-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ===== PANEL DEL CARRITO ===== */
.cart-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: var(--cart-width);
    height: 100%;
    background: var(--cart-bg);
    backdrop-filter: blur(var(--cart-glass-blur));
    -webkit-backdrop-filter: blur(var(--cart-glass-blur));
    box-shadow: var(--cart-shadow);
    z-index: 11000;
    transform: translateX(100%);
    transition: transform var(--cart-transition);
    display: flex;
    flex-direction: column;
}

.cart-panel.active {
    transform: translateX(0);
}

/* ===== HEADER DEL CARRITO ===== */
.cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 1.5rem;
    border-bottom: 1px solid var(--cart-border);
    background: rgba(255, 255, 255, 0.5);
}

.cart-title-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.cart-icon-bg {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--cart-accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-icon-bg svg {
    width: 20px;
    height: 20px;
    fill: white;
}

.cart-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    font-weight: 600;
    font-style: italic;
    color: var(--cart-text);
    margin: 0;
}

.cart-count {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    color: var(--cart-text-light);
    font-weight: 500;
}

.cart-close-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(184, 164, 212, 0.1);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.cart-close-btn:hover {
    background: var(--cart-accent);
    transform: rotate(90deg);
}

.cart-close-btn svg {
    width: 18px;
    height: 18px;
    fill: var(--cart-text);
    transition: fill 0.3s ease;
}

.cart-close-btn:hover svg {
    fill: white;
}

/* ===== CONTENIDO DEL CARRITO ===== */
.cart-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

/* Scrollbar personalizado */
.cart-content::-webkit-scrollbar {
    width: 6px;
}

.cart-content::-webkit-scrollbar-track {
    background: rgba(184, 164, 212, 0.05);
}

.cart-content::-webkit-scrollbar-thumb {
    background: rgba(184, 164, 212, 0.3);
    border-radius: 3px;
}

.cart-content::-webkit-scrollbar-thumb:hover {
    background: var(--cart-accent);
}

/* ===== LISTA DE PRODUCTOS ===== */
.cart-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cart-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 12px;
    border: 1px solid var(--cart-border);
    transition: all 0.3s ease;
    animation: slideIn 0.4s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.cart-item:hover {
    box-shadow: 0 4px 12px rgba(184, 164, 212, 0.15);
    border-color: var(--cart-accent);
}

.cart-item-image {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cart-item-name {
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--cart-text);
    margin: 0;
    line-height: 1.3;
}

.cart-item-options {
    font-size: 0.75rem;
    color: var(--cart-text-light);
    line-height: 1.4;
}

.cart-item-option {
    display: block;
}

.cart-item-personalization {
    font-size: 0.75rem;
    color: var(--cart-accent);
    font-style: italic;
}

.cart-item-price {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--cart-accent);
}

.cart-item-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cart-qty-btn {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid var(--cart-border);
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: var(--cart-text);
    transition: all 0.3s ease;
}

.cart-qty-btn:hover {
    background: var(--cart-accent);
    color: white;
    border-color: var(--cart-accent);
}

.cart-qty-value {
    font-size: 0.85rem;
    font-weight: 600;
    min-width: 24px;
    text-align: center;
}

.cart-item-remove {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    color: #e74c3c;
    transition: all 0.3s ease;
}

.cart-item-remove:hover {
    transform: scale(1.2);
}

.cart-item-remove svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* ===== CARRITO VACÍO ===== */
.cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    text-align: center;
}

.cart-empty-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(184, 164, 212, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.cart-empty-icon svg {
    width: 40px;
    height: 40px;
    fill: var(--cart-accent);
    opacity: 0.5;
}

.cart-empty-text {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    color: var(--cart-text-light);
    margin: 0;
}

/* ===== FOOTER DEL CARRITO ===== */
.cart-footer {
    border-top: 1px solid var(--cart-border);
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.8);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 1rem;
    background: rgba(184, 164, 212, 0.08);
    border-radius: 10px;
}

.cart-total-label {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--cart-text);
}

.cart-total-value {
    font-family: 'Inter', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--cart-accent);
}

.cart-checkout-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #25D366 0%, #20BA5A 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}

.cart-checkout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
}

.cart-checkout-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.cart-checkout-btn svg {
    width: 20px;
    height: 20px;
    fill: white;
}

/* ===== ANIMACIÓN DEL BADGE ===== */
@keyframes cartBounce {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.3);
    }
}

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

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .cart-panel {
        width: 100%;
        max-width: 100%;
    }

    .cart-header {
        padding: 1.25rem 1rem;
    }

    .cart-title {
        font-size: 1.2rem;
    }

    .cart-content {
        padding: 1rem;
    }

    .cart-item {
        padding: 0.875rem;
    }

    .cart-item-image {
        width: 70px;
        height: 70px;
    }

    .cart-footer {
        padding: 1.25rem 1rem;
    }
}

@media (max-width: 480px) {
    .cart-item-image {
        width: 60px;
        height: 60px;
    }

    .cart-item-name {
        font-size: 0.875rem;
    }

    .cart-total-value {
        font-size: 1.15rem;
    }
}