/* Cart Component Styles - REBUILT FROM SCRATCH */

.cart-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.cart-toggle {
    width: 56px;
    height: 56px;
    background: #1a1a1a;
    color: white;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    position: relative;
}

.cart-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    background: #333;
}

.cart-toggle svg {
    width: 24px;
    height: 24px;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #dc2626;
    color: white;
    font-size: 12px;
    font-weight: 600;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    transform: scale(0);
    transition: transform 0.3s ease;
}

.cart-count.visible {
    transform: scale(1);
}

/* Cart Panel - POSITIONED ABOVE BUTTON */
.cart-panel {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 320px;
    max-height: 450px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    border: 1px solid #e5e7eb;
    transform: translateY(20px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    z-index: 1001;
    display: flex;
    flex-direction: column;
}

.cart-panel.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 12px;
    border-bottom: 1px solid #e5e7eb;
}

.cart-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
}

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

.cart-close:hover {
    background: #e5e7eb;
    color: #374151;
}

/* Cart Items */
.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
    min-height: 0;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    transition: background 0.2s ease;
    border-bottom: 1px solid #f3f4f6;
}

.cart-item:hover {
    background: #f9fafb;
}

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

.cart-item-image {
    width: 48px;
    height: 72px;
    object-fit: cover;
    object-position: center;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

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

.cart-item-title {
    font-size: 14px;
    font-weight: 500;
    color: #1a1a1a;
    margin-bottom: 4px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cart-item-size {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 4px;
}

.cart-item-price {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 4px;
}

.cart-quantity-btn {
    width: 24px;
    height: 24px;
    background: #e5e7eb;
    color: #374151;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.cart-quantity-btn:hover {
    background: #d1d5db;
    color: #111827;
}

.cart-quantity-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.cart-quantity-value {
    font-size: 14px;
    font-weight: 500;
    color: #111827;
    min-width: 20px;
    text-align: center;
}

.cart-item-remove {
    width: 24px;
    height: 24px;
    background: #fef2f2;
    color: #dc2626;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.cart-item-remove:hover {
    background: #fee2e2;
    transform: scale(1.1);
}

/* Cart Footer */
.cart-footer {
    padding: 16px 20px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
    flex-shrink: 0;
}

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

.total-label {
    font-size: 16px;
    font-weight: 500;
    color: #1a1a1a;
}

.total-amount {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
}

.checkout-btn {
    width: 100%;
    padding: 12px 24px;
    background: #007aff;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.2);
}

.checkout-btn:hover {
    background: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.checkout-btn:active {
    transform: translateY(0);
}

.checkout-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    background: #9ca3af;
    box-shadow: none;
}

/* Empty Cart State */
.cart-empty {
    padding: 32px 24px;
    text-align: center;
    color: #6b7280;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 160px;
    height: 100%;
}

.cart-empty-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 24px;
    opacity: 0.5;
    color: #9ca3af;
    transition: all 0.3s ease;
}

.cart-empty:hover .cart-empty-icon {
    transform: scale(1.1);
    opacity: 0.7;
}

.cart-empty-text {
    font-size: 18px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
}

.cart-empty-subtext {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 480px) {
    .cart-container {
        bottom: 16px;
        right: 16px;
    }
    
    .cart-panel {
        width: calc(100vw - 32px);
        max-width: 300px;
        right: 0;
        max-height: 400px;
    }
    
    .cart-toggle {
        width: 52px;
        height: 52px;
    }
}

@media (max-width: 360px) {
    .cart-panel {
        width: calc(100vw - 24px);
        max-width: 280px;
        max-height: 350px;
    }
    
    .cart-item {
        padding: 8px 16px;
    }
    
    .cart-item-image {
        width: 40px;
        height: 60px;
    }
    
    .cart-empty {
        padding: 24px 16px;
        min-height: 120px;
    }
}

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

.cart-item.loading .cart-item-image {
    opacity: 0.5;
    filter: blur(1px);
}

/* Animation for cart item addition */
@keyframes cartItemSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.cart-item.new {
    animation: cartItemSlideIn 0.3s ease-out;
}

/* Animation for cart item removal */
@keyframes cartItemSlideOut {
    from {
        opacity: 1;
        transform: translateX(0);
        max-height: 100px;
    }
    to {
        opacity: 0;
        transform: translateX(100%);
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
        margin-top: 0;
        margin-bottom: 0;
    }
}

.cart-item.removing {
    animation: cartItemSlideOut 0.3s ease-out forwards;
}

/* Focus States for Accessibility */
.cart-toggle:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

.cart-close:focus-visible,
.cart-quantity-btn:focus-visible,
.cart-item-remove:focus-visible {
    outline: 2px solid #111827;
    outline-offset: 2px;
}

.checkout-btn:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

/* Performance Optimizations */
.cart-panel {
    will-change: transform, opacity;
}

.cart-toggle {
    will-change: transform;
}

.cart-count {
    will-change: transform;
}

/* MOBILE: Disable ALL hover effects in cart */
@media (hover: none) {
    .cart-toggle:hover,
    .cart-close:hover,
    .cart-item:hover,
    .cart-quantity-btn:hover,
    .cart-item-remove:hover,
    .checkout-btn:hover {
        /* Disable all hover effects on touch devices */
        transform: inherit !important;
        background: inherit !important;
        color: inherit !important;
        opacity: inherit !important;
        filter: inherit !important;
        box-shadow: inherit !important;
    }
    
    /* Maintain disabled states */
    .cart-quantity-btn:disabled,
    .checkout-btn:disabled {
        opacity: 0.5 !important;
        cursor: not-allowed !important;
    }
} 