/* ==========================================
   CART DRAWER STYLING
   ========================================== */

/* Offcanvas cart drawer */
#cartDrawer {
    width: 380px !important;
}

#cartDrawer .offcanvas-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 20px;
}

#cartDrawer .offcanvas-header h5 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}

#cartDrawer .offcanvas-header .btn-close {
    filter: brightness(0) invert(1);
    opacity: 0.8;
}

#cartDrawer .offcanvas-header .btn-close:hover {
    opacity: 1;
}

#cartDrawer .offcanvas-body {
    padding: 0;
    background: #f9fafb;
}

/* Loading state */
#cartDrawerLoading {
    padding: 40px 20px !important;
}

/* Cart items container */
.cart-items {
    padding: 12px;
    max-height: calc(100vh - 260px);
    overflow-y: auto;
}

/* Individual cart item */
.cart-item {
    background: white;
    border-radius: 8px;
    padding: 8px;
    margin-bottom: 8px;
    border: 1px solid #e5e7eb !important;
    transition: all 0.2s ease;
}

.cart-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border-color: #d1d5db !important;
}

.cart-item:last-child {
    margin-bottom: 0;
}

.cart-item img {
    border: 1px solid #e5e7eb;
}

.cart-item h6 {
    font-size: 13px !important;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0 !important;
    color: #111;
}

.cart-item .text-muted {
    font-size: 11px !important;
    color: #6b7280 !important;
}

.cart-item .fw-bold {
    font-size: 14px !important;
    color: #667eea;
    font-weight: 700;
}

/* Cart summary */
#cartDrawer .border-top {
    background: white;
    padding: 16px 20px !important;
    border-top: 2px solid #e5e7eb !important;
}

#cartDrawer .border-top .d-flex {
    margin-bottom: 16px !important;
    font-size: 15px;
}

#cartDrawer .border-top .d-flex span:first-child {
    color: #6b7280;
    font-weight: 500;
}

#cartDrawer .border-top .fw-bold {
    color: #111;
    font-size: 20px !important;
    font-weight: 900 !important;
}

/* Buttons */
#cartDrawer .btn {
    padding: 12px 20px;
    font-weight: 600;
    font-size: 14px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

#cartDrawer .btn-outline-secondary {
    border: 2px solid #e5e7eb;
    color: #374151;
    background: white;
}

#cartDrawer .btn-outline-secondary:hover {
    background: #f9fafb;
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

#cartDrawer .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
}

#cartDrawer .btn-primary:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6a3f8f 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.3);
}

/* Empty cart state */
#cartDrawer .text-center.text-muted {
    padding: 60px 30px !important;
}

#cartDrawer .text-center.text-muted i {
    color: #d1d5db;
    margin-bottom: 16px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}

#cartDrawer .text-center.text-muted p {
    font-size: 15px;
    color: #9ca3af;
    margin: 12px 0 20px;
    font-weight: 500;
}

#cartDrawer .btn-sm {
    padding: 8px 24px;
    font-size: 13px;
}

/* Error state */
#cartDrawer .text-danger {
    padding: 60px 30px !important;
}

#cartDrawer .text-danger i {
    color: #ef4444;
}

#cartDrawer .text-danger p {
    font-size: 15px;
    font-weight: 600;
    margin: 12px 0 8px;
}

#cartDrawer .text-danger small {
    font-size: 12px;
    color: #9ca3af;
}

/* Scrollbar styling */
.cart-items::-webkit-scrollbar {
    width: 6px;
}

.cart-items::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 10px;
}

.cart-items::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 10px;
}

.cart-items::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Mobile adjustments */
@media (max-width: 576px) {
    #cartDrawer {
        width: 100% !important;
    }

    .cart-items {
        max-height: calc(100vh - 220px);
    }
}

/* Slide in animation */
#cartDrawer.show {
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }

    to {
        transform: translateX(0);
    }
}