/* Floating Basket Icon */
.basket-btn-nav {
    background: linear-gradient(135deg, var(--gold) 0%, var(--brand-orange) 100%);
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 5px 15px rgba(192, 115, 77, 0.4);
    cursor: pointer;
    position: relative;
    border: none;
    outline: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.basket-btn-nav:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(192, 115, 77, 0.6);
}

.basket-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--brown);
    color: var(--gold);
    font-size: 0.75rem;
    font-weight: bold;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--brand-orange);
    transition: transform 0.2s ease;
}

.basket-badge.pop {
    transform: scale(1.5);
}

/* Cart Sidebar */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 380px;
    height: 100vh;
    background: linear-gradient(135deg, #4a3228 0%, var(--brown) 100%);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    z-index: 2001; /* Above navbar */
    transform: translateX(110%);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    will-change: transform;
    display: flex;
    flex-direction: column;
    border-left: 1px solid rgba(255, 255, 255, 0.05);
}

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

.cart-header {
    padding: 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-header h2 {
    font-family: 'Playfair Display', serif;
    color: var(--brand-orange);
    font-size: 1.5rem;
    margin: 0;
}

.close-cart {
    font-size: 1.8rem;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: color 0.3s;
    border: none;
    background: none;
}

.close-cart:hover {
    color: white;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.cart-items::-webkit-scrollbar {
    width: 6px;
}
.cart-items::-webkit-scrollbar-thumb {
    background: rgba(212, 163, 115, 0.3);
    border-radius: 10px;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.03);
    padding: 15px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
}

.cart-item img {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    object-fit: cover;
}

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

.cart-item-details h4 {
    color: white;
    font-size: 1rem;
    margin-bottom: 5px;
}

.cart-item-details p {
    color: var(--gold);
    font-size: 0.9rem;
    font-weight: 600;
}

.qty-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.2);
    padding: 5px 10px;
    border-radius: 20px;
    margin-top: 8px;
    width: max-content;
}

.qty-btn {
    background: none;
    border: none;
    color: var(--light-cream);
    cursor: pointer;
    font-size: 1.2rem;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.qty-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--brand-orange);
}

.item-qty {
    color: white;
    font-weight: bold;
    font-size: 0.9rem;
    min-width: 20px;
    text-align: center;
}

.remove-item {
    position: absolute;
    top: 10px;
    right: 15px;
    color: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    font-size: 1.2rem;
    transition: color 0.2s;
    background: none;
    border: none;
}

.remove-item:hover {
    color: #ff4d4d;
}

.cart-empty {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 50px;
    font-style: italic;
}

.cart-footer {
    padding: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
}

.cart-total .total-amount {
    color: var(--gold);
    font-size: 1.5rem;
}

.checkout-btn {
    width: 100%;
    display: flex;
    justify-content: center;
}

/* Overlay */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 2000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cart-overlay.show {
    display: block;
    opacity: 1;
}

/* On mobile, skip the expensive backdrop-filter blur */
@media (max-width: 768px) {
    .cart-overlay {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
}

/* Toast - use transform for GPU-accelerated slide-in */
.toast {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%) translateY(120px);
    background: rgba(255, 255, 255, 0.95);
    color: var(--brown);
    padding: 12px 25px;
    border-radius: 50px;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 3000;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    will-change: transform, opacity;
    pointer-events: none;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

@media (max-width: 600px) {
    .toast {
        font-size: 0.8rem;
        padding: 8px 16px;
        white-space: nowrap;
        width: max-content;
        max-width: 90%;
        bottom: 20px;
    }
}

.add-to-box-btn {
    background: rgba(212, 163, 115, 0.1);
    color: var(--gold);
    border: 1px solid var(--gold);
    padding: 0.7rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: auto;
    display: inline-block;
    text-align: center;
    text-decoration: none;
}

.add-to-box-btn:hover {
    background: var(--gold);
    color: var(--brown);
    box-shadow: 0 5px 15px rgba(212, 163, 115, 0.3);
    transform: translateY(-2px);
}
