:root {
    --primary: 222, 47%, 11%; /* #0f172a Deep Slate */
    --primary-dark: 222, 47%, 5%;
    --accent: 215, 25%, 27%; /* Slate-700 */
    --success: 158, 64%, 52%; /* #10b981 */
    --glass: rgba(255, 255, 255, 0.7);
    --border: rgba(255, 255, 255, 0.1);
}

body { 
    background-color: #f8fafc;
    color: #0f172a;
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
    margin: 0;
}

/* --- Premium Cart Drawer Styles --- */
#cart-container {
    position: fixed;
    inset: 0;
    z-index: 5000;
    visibility: hidden;
    transition: visibility 0.4s;
    pointer-events: none;
}

#cart-container.active {
    visibility: visible;
    pointer-events: auto;
}

#cart-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, 0.7); /* Darker backdrop */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#cart-container.active #cart-backdrop {
    opacity: 1;
}

#cart-drawer {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    bottom: 1.5rem;
    width: calc(100% - 3rem);
    max-width: 380px; /* Thinner drawer */
    background: #0f172a; /* Solid Deep Obsidian for perfect visibility */
    border-radius: 2rem; /* Less bulky bubble */
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 40px 100px -20px rgba(0, 0, 0, 0.8);
    overflow: hidden;
    z-index: 5001;
    transform: translateX(calc(100% + 2rem));
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
}

#cart-container.active #cart-drawer {
    transform: translateX(0);
}

.cart-item {
    transition: all 0.3s ease;
    border-radius: 1.5rem;
    padding: 1rem;
}

.cart-item:hover {
    background: rgba(248, 250, 252, 0.8);
    transform: translateY(-2px);
}

.quantity-badge {
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
}

/* Animations */
@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

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

.animate-fade-in { animation: fadeIn 0.4s ease-out forwards; }
.animate-slide-in { animation: slideInRight 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards; }

::selection { background: #0f172a; color: #fff; }

/* Product Cards */
.product-card {
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.04);
    border-radius: 2rem;
    padding: 1.75rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}
.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.1);
}

@media (max-width: 480px) {
    #cart-drawer { 
        top: 1rem;
        right: 1rem;
        bottom: 1rem;
        left: 1rem;
        width: auto;
        max-width: none;
        border-radius: 2.5rem;
    }
}

/* Floating Cart Trigger (Sticky) */
#floating-cart-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 4.5rem;
    height: 4.5rem;
    background: #0f172a;
    color: white;
    border-radius: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.3);
    cursor: pointer;
    z-index: 1000;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: none; /* Hidden by default, shown via JS or if preferred */
}

#floating-cart-btn:hover {
    transform: scale(1.1) translateY(-5px);
    box-shadow: 0 25px 50px rgba(15, 23, 42, 0.4);
}

#floating-cart-btn.visible {
    display: flex;
    animation: bounceIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Ensure SweetAlert is ALWAYS on top of the cart */
.swal2-container {
    z-index: 10000 !important;
}

@keyframes bounceIn {
    from { transform: scale(0) translateY(100px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

/* Utility Animations */
@import url('https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css');

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
