/* Lucky Fest - Shopping Cart Styles */

html {
    scroll-behavior: smooth;
    scroll-padding-top: 120px;
}

:root {
    --cart-drawer-width: 420px;
}

@media (max-width: 480px) {
    :root {
        --cart-drawer-width: 100%;
    }
}

/* Base Overlay */
#cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Side Drawer */
#cart-drawer {
    position: fixed;
    top: 0;
    right: calc(-1 * var(--cart-drawer-width));
    width: var(--cart-drawer-width);
    height: 100vh; /* Fallback for older browsers */
    height: 100dvh;
    background: var(--surface, #f7f7f3);
    z-index: 1000;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

#cart-overlay.active #cart-drawer {
    right: 0;
}

/* Header */
.cart-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Items List */
.cart-items-container {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1.5rem;
    scrollbar-width: thin;
}

.cart-item {
    display: flex;
    gap: 1rem;
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.cart-item-img {
    width: 80px;
    height: 80px;
    border-radius: 1rem;
    object-fit: cover;
    background: white;
    padding: 0.5rem;
    border: 1px solid rgba(0,0,0,0.05);
}

/* Controls */
.qty-controls {
    display: flex;
    align-items: center;
    background: #eef0eb;
    border-radius: 99px;
    padding: 2px;
    width: fit-content;
}

.qty-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.qty-btn:hover {
    background: white;
}

/* Footer */
.cart-footer {
    padding: 2rem;
    padding-bottom: max(2rem, calc(env(safe-area-inset-bottom) + 1rem));
    background: white;
    box-shadow: 0 -10px 20px rgba(0,0,0,0.02);
    border-radius: 2rem 2rem 0 0;
    border-top: 1px solid rgba(0,0,0,0.05);
}

/* Progress Bar */
.shipping-progress {
    height: 6px;
    background: #eef0eb;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.shipping-bar {
    height: 100%;
    background: var(--primary, #755700);
    transition: width 0.6s ease-out;
}

/* Animations */
@keyframes bounce-in {
    0% { transform: translate(-50%, 100%); opacity: 0; }
    70% { transform: translate(-50%, -10%); opacity: 1; }
    100% { transform: translate(-50%, 0); opacity: 1; }
}

.animate-bounce-in {
    animation: bounce-in 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
}

/* Empty State */
.cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 40%;
    text-align: center;
    color: #8c8e8b;
}

/* Remove Button */
.cart-item-remove {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 32px;
    height: 32px;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a50314; /* secondary color/red */
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.cart-item-remove:hover {
    background: #a50314;
    color: white;
    transform: scale(1.1) rotate(8deg);
    border-color: #a50314;
    box-shadow: 0 6px 15px rgba(165, 3, 20, 0.2);
}

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