/* =====================================================
   PROFESSIONAL CART DRAWER - Foxtale Inspired
   ===================================================== */

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

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

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

.cart-drawer.active {
    right: 0;
}

/* Cart Header */
.cart-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #f0f0f0;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 10;
}

.cart-drawer-title {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
}

.cart-close-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: #f5f5f5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
}

.cart-close-btn:hover {
    background: #e8e8e8;
}

.cart-close-btn svg {
    width: 18px;
    height: 18px;
}

/* Promotional Banner */
.cart-promo-banner {
    background: linear-gradient(135deg, #fff4e6 0%, #ffe8cc 100%);
    padding: 12px 24px;
    text-align: center;
    border-bottom: 1px solid #ffd699;
}

.cart-promo-text {
    font-size: 13px;
    font-weight: 600;
    color: #d35400;
    margin: 0;
}

.cart-promo-highlight {
    color: #e74c3c;
    font-weight: 700;
}

/* Buy X Get Y Progress Bar */
.cart-progress-section {
    padding: 16px 24px;
    background: #fafafa;
    border-bottom: 1px solid #f0f0f0;
}

.progress-message {
    font-size: 13px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    text-align: center;
}

.progress-message .highlight {
    color: #e74c3c;
    font-weight: 700;
}

.progress-tiers {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    margin-top: 12px;
}

.progress-tier {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    z-index: 2;
}

.tier-icon {
    width: 40px;
    height: 40px;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    position: relative;
}

.tier-icon.active {
    border-color: #ff6b35;
    background: #fff4e6;
}

.tier-icon.completed {
    border-color: #27ae60;
    background: #e8f8f5;
}

.tier-label {
    font-size: 11px;
    font-weight: 600;
    color: #7f8c8d;
    text-align: center;
}

.tier-value {
    font-size: 10px;
    color: #95a5a6;
}

.progress-bar-bg {
    position: absolute;
    top: 20px;
    left: 40px;
    right: 40px;
    height: 3px;
    background: #e0e0e0;
    z-index: 1;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff6b35 0%, #f39c12 100%);
    transition: width 0.4s ease;
}

/* Cart Content */
.cart-drawer-content {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 20px;
}

.cart-items-list {
    padding: 16px 24px;
}

.cart-item {
    display: flex;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid #f0f0f0;
}

.cart-item:first-child {
    padding-top: 0;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    background: #fafafa;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cart-item-name {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
    line-height: 1.3;
}

.cart-item-variant {
    font-size: 12px;
    color: #7f8c8d;
}

.cart-item-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cart-item-price {
    font-size: 16px;
    font-weight: 700;
    color: #2c3e50;
}

.cart-item-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.cart-qty-control {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f5f5f5;
    border-radius: 8px;
    padding: 4px;
}

.cart-qty-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: #fff;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    color: #2c3e50;
    transition: all 0.2s ease;
}

.cart-qty-btn:hover {
    background: #e8e8e8;
}

.cart-qty-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.cart-qty-value {
    min-width: 24px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    color: #2c3e50;
}

.cart-item-remove {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    padding: 4px;
    font-size: 20px;
    line-height: 1;
    transition: color 0.2s ease;
}

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

/* Recommendations Section */
.cart-recommendations {
    background: #f9f9f9;
    padding: 20px 24px;
    margin-top: 12px;
}

.recommendations-title {
    font-size: 16px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 16px 0;
}

.recommendation-item {
    display: flex;
    gap: 12px;
    align-items: center;
    background: #fff;
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.recommendation-image {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: #fafafa;
}

.recommendation-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recommendation-info {
    flex: 1;
}

.recommendation-name {
    font-size: 13px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 4px 0;
    line-height: 1.2;
}

.recommendation-price {
    font-size: 14px;
    font-weight: 700;
    color: #e74c3c;
    margin: 0;
}

.recommendation-add-btn {
    background: #2c3e50;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.recommendation-add-btn:hover {
    background: #1a252f;
}

/* Empty Cart State */
.cart-empty-state {
    padding: 60px 24px;
    text-align: center;
}

.empty-cart-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-cart-title {
    font-size: 18px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 8px 0;
}

.empty-cart-text {
    font-size: 14px;
    color: #7f8c8d;
    margin: 0 0 24px 0;
}

.empty-cart-btn {
    background: #2c3e50;
    color: #fff;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.empty-cart-btn:hover {
    background: #1a252f;
}

/* Cart Footer */
.cart-drawer-footer {
    padding: 20px 24px;
    background: #fff;
    border-top: 1px solid #f0f0f0;
    position: sticky;
    bottom: 0;
}

.cart-subtotal-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.cart-subtotal-label {
    font-size: 14px;
    color: #7f8c8d;
}

.cart-subtotal-value {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
}

.cart-discount-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.cart-discount-label {
    font-size: 13px;
    color: #27ae60;
    font-weight: 600;
}

.cart-discount-value {
    font-size: 14px;
    font-weight: 600;
    color: #27ae60;
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-top: 1px solid #f0f0f0;
    margin-bottom: 16px;
}

.cart-total-label {
    font-size: 16px;
    font-weight: 700;
    color: #2c3e50;
}

.cart-total-value {
    font-size: 20px;
    font-weight: 700;
    color: #2c3e50;
}

.cart-checkout-btn {
    width: 100%;
    background: linear-gradient(135deg, #2c3e50 0%, #1a252f 100%);
    color: #fff;
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.cart-checkout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(44, 62, 80, 0.3);
}

.cart-checkout-btn svg {
    width: 20px;
    height: 20px;
}

.cart-continue-shopping {
    text-align: center;
    margin-top: 12px;
}

.cart-continue-link {
    color: #7f8c8d;
    font-size: 14px;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.cart-continue-link:hover {
    color: #2c3e50;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .cart-drawer {
        max-width: 100%;
    }
    
    .cart-drawer-header {
        padding: 16px 20px;
    }
    
    .cart-items-list {
        padding: 12px 20px;
    }
    
    .cart-recommendations {
        padding: 16px 20px;
    }
    
    .cart-drawer-footer {
        padding: 16px 20px;
    }
}

/* Animations */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
