/* Cart Drawer & Overlay Animations */
.cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 450px;
    height: 100%;
    background-color: var(--bs-body-bg);
    box-shadow: -10px 0 30px rgba(0,0,0,0.15);
    z-index: 1060;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    border-top-left-radius: 20px;
    border-bottom-left-radius: 20px;
}

.cart-drawer.open {
    transform: translateX(0);
}

.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

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

/* Header & Footer Styling */
.cart-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--bs-border-color-translucent);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bs-body-bg);
    border-top-left-radius: 20px;
}

.cart-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 2rem;
    scrollbar-width: thin;
    scrollbar-color: var(--bs-primary) transparent;
}

.cart-footer {
    padding: 2rem;
    border-top: 1px solid var(--bs-border-color-translucent);
    background: var(--bs-tertiary-bg);
    border-bottom-left-radius: 20px;
}

/* Cart Item Enhancements */
.cart-item {
    display: flex;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    background: var(--bs-secondary-bg);
    border-radius: 16px;
    border: 1px solid var(--bs-border-color-translucent);
    transition: all 0.2s ease;
    animation: slideIn 0.3s ease forwards;
}

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

.cart-item:hover {
    transform: translateY(-2px);
    border-color: var(--bs-primary);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.cart-item-info {
    flex: 1;
}

.cart-item-title {
    font-weight: 800;
    margin-bottom: 0.25rem;
    font-size: 1.1rem;
    color: var(--bs-heading-color);
}

.cart-item-price {
    color: var(--bs-primary);
    font-weight: 700;
    font-size: 1rem;
    display: block;
    margin-bottom: 0.75rem;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--bs-body-bg);
    padding: 0.4rem 0.8rem;
    border-radius: 30px;
    width: fit-content;
    border: 1px solid var(--bs-border-color-translucent);
}

.quantity-btn {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: none;
    background: var(--bs-secondary-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.8rem;
    color: var(--bs-body-color);
}

.quantity-btn:hover {
    background: var(--bs-primary);
    color: white;
}

/* Badge Pulse Animation */
.cart-badge.pulse {
    animation: badgePulse 0.4s ease-out;
}

@keyframes badgePulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.4); }
    100% { transform: scale(1); }
}

/* Empty Cart State */
.empty-cart {
    text-align: center;
    padding: 4rem 1rem;
}

.empty-cart-icon {
    width: 80px;
    height: 80px;
    background: var(--bs-secondary-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2.5rem;
    color: var(--bs-secondary-color);
    opacity: 0.5;
}

/* Interactive Add Button Enhancements */
.btn-add-to-cart {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn-add-to-cart:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 69, 0, 0.2);
}

.btn-add-to-cart:active {
    transform: translateY(0) scale(0.95);
}

.btn-add-to-cart.success {
    background-color: #198754 !important;
    border-color: #198754 !important;
    color: white !important;
    transform: scale(1.05);
}

/* In-Cart State */
.btn-add-to-cart.btn-in-cart {
    background-color: var(--bs-body-bg);
    color: var(--bs-primary);
    border: 2px solid var(--bs-primary);
}

/* Wing/Sauce Card In-Cart Specifics */
.wing-option.btn-in-cart, .sauce-box.btn-in-cart {
    background-color: hsla(10, 75%, 55%, 0.05);
    border-width: 2px;
}

/* Drinks & Extras List In-Cart */
.btn-add-to-cart.py-3 {
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.btn-add-to-cart.py-3:hover {
    background-color: hsla(10, 75%, 55%, 0.05);
}

.btn-add-to-cart.py-3.btn-in-cart {
    background-color: hsla(10, 75%, 55%, 0.1);
    border-bottom: 2px solid var(--bs-primary) !important;
    margin-bottom: -1px; /* Avoid double border */
    border-radius: 8px;
}

.btn-add-to-cart.btn-in-cart:hover {
    background-color: hsla(10, 75%, 55%, 0.15);
}

.btn-cart-qty {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(255, 69, 0, 0.2);
    animation: badgeAppear 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 10;
}

.btn-cart-qty-abs {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 5;
}

@keyframes badgeAppear {
    from { transform: scale(0) rotate(-20deg); opacity: 0; }
    to { transform: scale(1) rotate(0); opacity: 1; }
}

/* Specific item styles */
.wing-option, .sauce-box {
    transition: all 0.3s ease;
    border: 1px solid var(--bs-border-color-translucent);
}

.wing-option:hover, .sauce-box:hover {
    border-color: var(--bs-primary);
    background-color: hsla(10, 75%, 55%, 0.08);
}

/* Mobile Adjustments */
@media (max-width: 576px) {
    .cart-drawer {
        max-width: 100%;
        border-radius: 0;
    }
    .cart-header, .cart-footer {
        border-radius: 0;
    }
}
