/* Cart Offcanvas Modern Design */
:root {
    --primary-blue-dark: #0056b3;
    --primary-blue-light: #e3f2fd;
    --secondary-gray: #6c757d;
    --success-green: #28a745;
    --danger-red: #dc3545;
    --warning-orange: #fd7e14;
    --light-gray: #f8f9fa;
    --border-color: #e9ecef;
    --text-dark: #212529;
    --text-muted: #6c757d;
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow-md: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
}

/* Cart Offcanvas Container */
.hc-cart-offcanvas {
    width: 420px;
    border: none;
    box-shadow: var(--shadow-lg);
}

@media (max-width: 576px) {
    .hc-cart-offcanvas {
        width: 100%;
    }
}

/* Cart Header Modern Design */
.hc-cart-offcanvas .offcanvas-header {
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-blue-dark));
    color: white;
    padding: 1.5rem;
    border-bottom: none;
    position: relative;
    overflow: hidden;
}

.hc-cart-offcanvas .offcanvas-header::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(30px, -30px);
}

.cart-header-title {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    z-index: 2;
}

.cart-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: white;
    font-size: 1.4rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(135deg, var(--danger-red), #c82333);
    color: white;
    font-size: 0.7rem;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    border: 2px solid white;
    box-shadow: var(--shadow-sm);
    animation: cart-pulse 2s infinite;
}

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

.hc-cart-offcanvas .offcanvas-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: white;
}

.hc-cart-offcanvas .btn-close {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 0.5rem;
    opacity: 1;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 1rem;
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hc-cart-offcanvas .btn-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

/* Cart Body */
.hc-cart-offcanvas .offcanvas-body {
    padding: 0;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 120px);
    background: #fafbfc;
}

/* Cart Items Scrollable Area */
.cart-items-container {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-blue) transparent;
}

.cart-items-container::-webkit-scrollbar {
    width: 6px;
}

.cart-items-container::-webkit-scrollbar-track {
    background: transparent;
}

.cart-items-container::-webkit-scrollbar-thumb {
    background: var(--primary-blue);
    border-radius: 3px;
}

/* Cart Item Modern Card Design */
.cart-item {
    display: flex;
    gap: 1rem;
    padding: 1.25rem;
    margin-bottom: 1rem;
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.cart-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-blue-dark));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cart-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.cart-item:hover::before {
    opacity: 1;
}

.cart-item:last-child {
    margin-bottom: 0;
}

/* Fade Animation Classes */
.cart-item.fade-out {
    opacity: 0;
    transform: scale(0.95);
    transition: all 0.3s ease;
}

.cart-item.fade-in {
    opacity: 1;
    transform: scale(1);
    transition: all 0.3s ease;
}

.cart-item.updating {
    opacity: 0.6;
    pointer-events: none;
}

/* Cart Item Image */
.cart-item-image {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    background: var(--light-gray);
}

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

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

/* Cart Item Content */
.cart-item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.cart-item-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Price Display */
.cart-item-price {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.cart-item-price .current-price {
    color: var(--primary-blue);
    font-weight: bold;
    font-size: 1.1rem;
}

.cart-item-price .old-price {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-decoration: line-through;
    opacity: 0.7;
}

/* Quantity Selector Modern Design */
.cart-item-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: auto;
}

.quantity-selector {
    display: flex;
    align-items: center;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.qty-btn {
    background: var(--light-gray);
    border: none;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: bold;
    color: var(--primary-blue);
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.qty-btn:hover {
    background: var(--primary-blue);
    color: white;
    transform: scale(1.05);
}

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

.qty-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.qty-input {
    width: 60px;
    text-align: center;
    border: none;
    padding: 0.5rem 0.25rem;
    font-size: 1rem;
    font-weight: 600;
    height: 36px;
    background: white;
    color: var(--text-dark);
}

.qty-input:focus {
    outline: none;
    background: var(--primary-blue-light);
}

.qty-input::-webkit-inner-spin-button,
.qty-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.qty-input {
    -moz-appearance: textfield;
}

/* Remove Item Button */
.remove-item {
    background: rgba(220, 53, 69, 0.1);
    border: none;
    color: var(--danger-red);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 10px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    font-size: 1rem;
}

.remove-item:hover {
    background: var(--danger-red);
    color: white;
    transform: scale(1.1);
    box-shadow: var(--shadow-sm);
}

/* Scrollable content wrapper */
.cart-scrollable-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

/* Fixed Footer with Buttons */
.cart-footer-fixed {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid var(--border-color);
    padding: 1.5rem;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
    z-index: 10;
    margin-top: auto;
}

.cart-total-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary-blue-light), #f0f8ff);
    border-radius: 12px;
    border: 1px solid rgba(0, 123, 255, 0.2);
}

.cart-total-label {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
}

.total-amount {
    color: var(--primary-blue);
    font-size: 1.4rem;
    font-weight: bold;
}

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

.btn-continue-shopping,
.btn-checkout-fixed {
    flex: 1;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 600;
    text-decoration: none;
    font-size: 1rem;
    position: relative;
    overflow: hidden;
}

.btn-continue-shopping {
    background: var(--light-gray);
    color: var(--text-dark);
    border: 2px solid var(--border-color);
}

.btn-continue-shopping:hover {
    background: var(--secondary-gray);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-checkout-fixed {
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-blue-dark));
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-checkout-fixed:hover {
    background: linear-gradient(135deg, var(--primary-blue-dark), #003d82);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-checkout-fixed::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

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

/* Empty Cart Modern Design */
.cart-empty {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 400px;
}

.cart-empty-icon {
    margin-bottom: 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, var(--primary-blue-light), #f0f8ff);
    border-radius: 50%;
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-empty-icon i {
    font-size: 3rem;
    color: var(--primary-blue);
}

.cart-empty h3 {
    margin: 0 0 1rem;
    font-size: 1.5rem;
    color: var(--text-dark);
    font-weight: 600;
}

.cart-empty p {
    margin: 0 0 2rem;
    font-size: 1.1rem;
    line-height: 1.6;
}

.hc-cart-offcanvas .btn-shopping {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-blue-dark));
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    -webkit-transition: all 0.3s ease;
    -moz-transition: all 0.3s ease;
    -ms-transition: all 0.3s ease;
    -o-transition: all 0.3s ease;
    flex: 0;
}
.hc-cart-offcanvas .cart-empty i {
    color: var(--warning-orange);
}

.btn-shopping:hover {
    background: linear-gradient(135deg, var(--primary-blue-dark), #003d82);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Loading States */
.cart-item.loading {
    opacity: 0.6;
    pointer-events: none;
}

.cart-item.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 25%, rgba(0, 123, 255, 0.1) 50%, transparent 75%);
    background-size: 200% 100%;
    animation: loading-shimmer 1.5s infinite;
}

@keyframes loading-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Button Loading States */
.hc-btn-add-to-cart.loading,
.hc-btn-add-cart.loading {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
}

.hc-btn-add-to-cart:disabled,
.hc-btn-add-cart:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Responsive Design */
@media (max-width: 576px) {
    .hc-cart-offcanvas .offcanvas-header {
        padding: 1.25rem;
    }
    
    .cart-scrollable-content {
        padding: 0.75rem;
    }
    
    .cart-item {
        padding: 1rem;
        margin-bottom: 0.75rem;
    }
    
    .cart-item-image {
        width: 70px;
        height: 70px;
    }
    
    .cart-item-title {
        font-size: 0.95rem;
    }
    
    .cart-item-actions {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }
    
    .quantity-selector {
        justify-content: center;
    }
    
    .cart-footer-fixed {
        padding: 1.25rem;
    }
    
    .cart-footer-actions {
        flex-direction: column;
    }
    
    .cart-total-summary {
        padding: 0.75rem;
        margin-bottom: 1.25rem;
    }
    
    .total-amount {
        font-size: 1.25rem;
    }
}

/* Smooth Transitions */
.cart-item,
.qty-btn,
.remove-item,
.btn-continue-shopping,
.btn-checkout-fixed {
    transition: all 0.3s ease;
}

/* Product Item Price Styling */
.hc-product-price .old-price,
.text-decoration-line-through {
    opacity: 0.6;
    font-size: 0.85em !important;
}

/* Mobile Cart Count Badge */
.hc-mobile-cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(135deg, var(--danger-red), #c82333);
    color: white;
    font-size: 0.7rem;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    border: 2px solid white;
    box-shadow: var(--shadow-sm);
    animation: cart-pulse 2s infinite;
}