/* Cart Drawer */
.cart-drawer {
    position: fixed;
    top: 0;
    right: -100%;
    width: 50%;
    max-width: 600px;
    min-width: 400px;
    height: 100vh;
    background: var(--color-white);
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease, top 0.3s ease;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

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

.cart-drawer__content {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
}

.cart-drawer__main {
    display: flex;
    flex-direction: column;
    background: var(--color-white);
    height: 100%;
}

.cart-drawer__header {
    padding: 24px;
    border-bottom: 1px solid var(--color-gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--color-white);
}

.cart-drawer__title {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-primary);
    margin: 0;
}

.cart-drawer__close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-gray-600);
    padding: 8px;
    border-radius: 4px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-drawer__close:hover {
    background: var(--color-gray-100);
    color: var(--color-primary);
}

.cart-drawer__info {
    padding: 16px 24px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.cart-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #6c757d;
    font-weight: 500;
}


.cart-drawer__empty {
    text-align: center;
    padding: var(--spacing-2xl) var(--spacing-lg);
}

.cart-drawer__empty-icon {
    margin-bottom: var(--spacing-lg);
    color: var(--color-gray-400);
}

.cart-drawer__empty-text {
    color: var(--color-gray-600);
    margin-bottom: var(--spacing-lg);
    font-size: var(--font-size-lg);
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 0;
    border-bottom: 1px solid #e9ecef;
}

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

.cart-item__image {
    width: 100px;
    height: 100px;
    object-fit: cover;
    object-position: center;
    border-radius: 8px;
    background: #f8f9fa;
}

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

.cart-item__title {
    font-weight: 600;
    color: #333;
    font-size: 16px;
    margin: 0;
}

.cart-item__variant {
    color: #666;
    font-size: 14px;
    margin: 0;
}

.cart-item__price {
    font-weight: 600;
    color: #333;
    font-size: 16px;
    margin: 0;
}

.cart-item__stock {
    font-size: 12px;
    color: #666;
    margin: 4px 0 0 0;
}

.cart-item__controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-end;
}

.cart-item__quantity {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    overflow: hidden;
    background: white;
}

.cart-item__quantity button {
    background: white;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    color: #333;
    font-weight: 600;
    transition: all 0.2s ease;
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.cart-item__quantity button:hover:not(:disabled) {
    background: #f8f9fa;
}

.cart-item__quantity button:focus {
    outline: none;
}

.cart-item__quantity button:active {
    outline: none;
}

.cart-item__quantity button:disabled {
    background: #f8f9fa;
    color: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.cart-item__quantity input {
    border: none;
    padding: 8px;
    text-align: center;
    font-weight: 600;
    width: 50px;
    background: white;
    font-size: 14px;
    color: #333;
}

/* Hide number input spinners in cart */
.cart-item__quantity input::-webkit-outer-spin-button,
.cart-item__quantity input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.cart-item__quantity input[type=number] {
    -moz-appearance: textfield;
}

.cart-item__stock {
    font-size: 12px;
    color: #6c757d;
    margin-top: 4px;
    text-align: center;
}

.cart-item__remove {
    background: none;
    color: #dc3545;
    border: none;
    padding: 4px 0;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: underline;
}

.cart-item__remove:hover {
    color: #c82333;
}

.cart-summary {
    padding: 24px;
    border-top: 1px solid #e9ecef;
    background: white;
}

.cart-summary__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 14px;
}

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

.cart-summary__row--total {
    font-size: 18px;
    font-weight: 600;
    padding-top: 12px;
    border-top: 1px solid #e9ecef;
    margin-top: 12px;
}

.cart-summary__label {
    color: #666;
}

.cart-summary__value {
    color: #333;
    font-weight: 500;
}

.cart-summary__row--total .cart-summary__value {
    font-weight: 600;
    font-size: 18px;
}

.cart-actions {
    padding: 24px;
    background: white;
    border-top: 1px solid #e9ecef;
}

.checkout-btn {
    background: var(--color-primary);
    color: var(--color-white);
    border: 1px solid var(--color-primary);
    padding: 16px 24px;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 48px;
}

.checkout-btn:hover:not(:disabled) {
    background: var(--color-gray-800);
    border-color: var(--color-gray-800);
    transform: translateY(-1px);
}

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

.cart-drawer__overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
}

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

/* Responsive Design */
@media (max-width: 1024px) {
    .cart-drawer {
        width: 60%;
        max-width: 500px;
        min-width: 350px;
    }
    
    .cart-drawer__content {
        /* Single column layout - no changes needed */
    }
}

@media (max-width: 767px) {
    .cart-drawer {
        width: 100%;
        right: 0;
        max-width: 100%;
        top: 100vh;
        height: calc(100vh - 80px);
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.15);
        transition: top 0.3s ease;
    }
    
    .cart-drawer.open {
        top: 80px;
    }
    
    .cart-drawer__content {
        height: calc(100vh - 80px);
        border-radius: 16px 16px 0 0;
    }
    
    .cart-drawer__header {
        padding: 16px;
    }
    
    .cart-drawer__title {
        font-size: 20px;
    }
    
    .cart-drawer__info {
        padding: 12px 16px;
    }
    
    .cart-items {
        padding: 16px;
    }
    
    .cart-item {
        align-items: center;
        gap: 12px;
        padding: 16px 0;
    }
    
    .cart-item__image {
        width: 80px;
        height: 80px;
        object-position: center;
    }
    
    .cart-item__title {
        font-size: 14px;
    }
    
    .cart-item__variant {
        font-size: 12px;
    }
    
    .cart-item__price {
        font-size: 14px;
    }
    
    .cart-summary {
        padding: 16px;
    }
    
    .cart-actions {
        padding: 16px;
    }
    
    .checkout-btn {
        padding: 14px 20px;
        font-size: 14px;
    }
}

/* Simplified cart item styles */
.quantity-btn {
    background: white;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    color: #333;
    font-weight: 600;
    transition: all 0.2s ease;
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-btn:hover:not(:disabled) {
    background: #f8f9fa;
}

.quantity-btn:focus {
    outline: none;
}

.quantity-btn:disabled {
    background: #f8f9fa;
    color: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.quantity-input {
    border: none;
    padding: 8px;
    text-align: center;
    font-weight: 600;
    width: 50px;
    background: white;
    font-size: 14px;
    color: #333;
}
