/*Cart Drawer Styles */
.cart-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backdrop-filter: blur(4px);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 450px;
    max-width: 90vw;
    height: 100%;
    background-color: #fff;
    z-index: 9999;
    transform: translateX(100%);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.15);
}

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

.cart-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.2rem 1.2rem 1rem;
    flex-shrink: 0;
    background: #082667;
    position: relative;
    overflow: hidden;
}

.cart-drawer-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="%23ffffff" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.cart-drawer-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.cart-drawer-title::before {
    content: '🛒';
    font-size: 1.25rem;
}

.cart-drawer-close {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
    backdrop-filter: blur(10px);
}

.cart-drawer-close:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.cart-drawer-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cart-items-container {
    flex: 1;
    padding: 1rem 1.5rem;
    overflow-y: auto;
}

.cart-drawer-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem;
    border-bottom: 1px solid #e9ecef;
    position: relative;
    transition: all 0.3s ease;
    border-radius: 12px;
    margin: 0.5rem;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid #f0f0f0;
}

.cart-drawer-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: #cdab34;
}

.cart-drawer-item:last-child {
    border-bottom: none;
}

.cart-item-image {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.cart-item-image:hover img {
    transform: scale(1.1);
}

.cart-item-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cart-drawer-item:hover .cart-item-image::after {
    opacity: 1;
}

.cart-item-details {
    flex: 1;
    min-width: 0;
}

.cart-item-title {
    margin: 0 0 0.5rem;
    font-size: 0.875rem;
    font-weight: bold;
    line-height: 1.3;
}

.cart-item-title a {
    color: #333;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cart-item-title a:hover {
    color: #cdab34;
}

.cart-item-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.75rem;
}

.cart-item-price {
    color: #cdab34;
    font-weight: 600;
    font-size: 0.8rem;
}

.cart-item-quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.25rem 0;
}

.quantity-btn {
    border: 2px solid #dee2e6;
    border-radius: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.875rem;
    color: #6c757d;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.quantity-btn:hover {
    border-color: #cdab34;
    color: #0e0e0e;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(205, 171, 52, 0.4);
}

.quantity-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
}

.quantity-btn:active::before {
    width: 40px;
    height: 40px;
}

.quantity-btn:active {
    transform: scale(0.95);
}

.quantity-btn:disabled {
    background: #e9ecef;
    border-color: #dee2e6;
    color: #adb5bd;
    cursor: not-allowed;
    transform: none;
}

.quantity-display {
    min-width: 30px;
    text-align: center;
    font-weight: 600;
    color: #333;
    font-size: 0.875rem;
}

.cart-item-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #f8f9fa;
    font-size: 0.8rem;
}

.cart-item-total-label {
    color: #6c757d;
    font-weight: bold;
}

.cart-item-total-amount {
    color: #152dba;
    font-weight: 600;
}

.cart-item-remove {
   background: #fff;
            border: 2px solid #dc3545;
            color: #dc3545;
            width: 44px;
            height: 44px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.3s ease;
}

.cart-item-remove:hover {
    color: #c82333;
}

.cart-drawer-footer {
    flex-shrink: 0;
    padding: 2rem 1.5rem;
    border-top: 2px solid #e9ecef;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    position: relative;
}

.cart-drawer-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
}

.cart-summary {
    margin-bottom: 1rem;
}

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.cart-summary-row.cart-total {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #dee2e6;
    font-size: 1rem;
    font-weight: 600;
}

.cart-summary-amount {
    color: #cdab34;
    font-weight: 600;
}

.cart-total .cart-summary-amount {
    color: #152dba;
    font-size: 1.125rem;
}

.cart-actions {
    display: flex;
    gap: 0.5rem;
}

.cart-view-btn,
.cart-checkout-btn {
    flex: 1;
    text-align: center;
    padding: 1rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.cart-view-btn {
    background-color: transparent;
    border: 1px solid #cdab34;
    color: #cdab34;
    backdrop-filter: blur(10px);
}

.cart-view-btn:hover {
    background-color: #cdab34;
    border: none;
    color: #fff;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(205, 171, 52, 0.4);
}

.cart-checkout-btn {
    background-color: #152dba;
    border: 1px solid #152dba;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.cart-checkout-btn:hover {
    background-color: #152dba;
    border-color: #152dba;
    color: #fff;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(21, 45, 186, 0.4);
}

.cart-checkout-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    transition: left 0.5s ease;
}

.cart-checkout-btn:hover::before {
    left: 100%;
}

/*Empty Cart Styles */
.cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4rem 2rem;
    height: 100%;
    border-radius: 20px;
    margin: 1rem;
    border: 2px dashed #e9ecef;
    position: relative;
    overflow: hidden;
}

.cart-empty::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(205, 171, 52, 0.1) 0%, transparent 70%);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(30px, -30px) rotate(120deg); }
    66% { transform: translate(-20px, 20px) rotate(240deg); }
}

.cart-empty-icon {
    font-size: 5rem;
    background: linear-gradient(135deg, #cdab34 0%, #152dba 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.cart-empty-title {
    margin: 0 0 1rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: #152dba;
    position: relative;
    z-index: 1;
}

.cart-empty-text {
    margin: 0 0 2rem;
    color: #6c757d;
    font-size: 1rem;
    line-height: 1.6;
    position: relative;
    z-index: 1;
    max-width: 280px;
}

/* Cart Button Styles */


.cart-drawer-trigger:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 25px rgba(161, 160, 154, 0.4);
}

.cart-drawer-trigger::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    transition: left 0.5s ease;
}

.cart-drawer-trigger:hover::before {
    left: 100%;
}

.cart-drawer-trigger:focus {
    background-color: #cdab34 !important;
    outline: 2px solid #cdab34;
    outline-offset: 2px;
}

/* Ensure cart is always visible */
#cart {
    display: block !important;
}

/* Cart icon styling */
.navbar-tool-label {
    border: 2px solid #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    animation: cartBadgePulse 3s ease-in-out infinite;
    font-weight: 700;
    font-size: 0.75rem;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes cartBadgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.navbar-tool-label.updated {
    animation: cartBadgeUpdate 0.6s ease;
}

@keyframes cartBadgeUpdate {
    0% { transform: scale(1); background-color: #94938f; }
    50% { transform: scale(1.3); background-color: #28a745; }
    100% { transform: scale(1); background-color: #82807c; }
}

/* Responsive Design */
@media (max-width: 768px) {
    .cart-drawer {
        width: 100%;
        max-width: 100vw;
    }
    
    .cart-drawer-header,
    .cart-items-container,
    .cart-drawer-footer {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .cart-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .cart-view-btn,
    .cart-checkout-btn {
        flex: none;
        width: 100%;
    }
    
    .cart-item-quantity-controls {
        justify-content: center;
    }
    
    .quantity-btn {
        width: 32px;
        height: 32px;
    }
    
    .cart-drawer-item {
        padding: 0.75rem 0;
    }
    
    .cart-item-details {
        margin-right: 2rem;
    }
}

/* Animation for cart items */
.cart-drawer-item {
    animation: slideInFromRight 0.3s ease forwards;
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scrollbar styling for cart items */
.cart-items-container .simplebar-scrollbar::before {
    background-color: #cdab34;
    opacity: 0.5;
}

.cart-items-container .simplebar-scrollbar.simplebar-visible::before {
    background-color: #152dba;
    opacity: 0.8;
}

/* Loading state */
.cart-drawer-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: #6c757d;
}

.cart-drawer-loading i {
    margin-right: 0.5rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Focus styles for accessibility */
.cart-drawer-trigger:focus,
.cart-drawer-close:focus,
.cart-item-remove:focus,
.quantity-btn:focus {
    outline: 2px solid #98968f;
    outline-offset: 2px;
}

/* Quantity button animations */
.quantity-btn {
    position: relative;
    overflow: hidden;
}

.quantity-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

.quantity-btn:active::before {
    width: 100px;
    height: 100px;
}

/* Cart item update animation */
.cart-item-updating {
    opacity: 0.7;
    pointer-events: none;
}

.cart-item-updating .quantity-btn {
    background: #e9ecef;
    color: #adb5bd;
}

/* Loading state for quantity buttons */
.quantity-btn.loading {
    background: #e9ecef;
    color: transparent;
    position: relative;
}

.quantity-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 12px;
    border: 2px solid #cdab34;
    border-top: 2px solid transparent;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .cart-drawer {
        border: 2px solid #000;
    }
    
    .cart-drawer-item {
        border-bottom-color: #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .cart-drawer,
    .cart-drawer-overlay,
    .cart-drawer-trigger,
    .cart-drawer-item,
    .quantity-btn {
        transition: none;
        animation: none;
    }
    
    .quantity-btn::before,
    .quantity-btn.loading::after {
        animation: none;
    }
}

/* Success feedback animation */
@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); background-color: #28a745; }
    100% { transform: scale(1); }
}

.cart-item-success .quantity-btn {
    animation: successPulse 0.6s ease;
}

/* Error feedback animation */
@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    75% { transform: translateX(2px); }
}

.cart-item-error .quantity-btn {
    animation: errorShake 0.5s ease;
    background-color: #dc3545;
    border-color: #dc3545;
    color: #fff;
}