.cart-page {
    min-height: 100vh;
    padding: 2rem;
    padding-top: 4rem;
}

.cart-container {
    max-width: 1200px;
    margin: 0 auto;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.cart-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.75rem;
    font-weight: 600;
    color: #fff;
}

.cart-count-badge {
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    min-width: 1.5rem;
    text-align: center;
}

.clear-cart-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 0.5rem;
    color: #ef4444;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.clear-cart-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
}

.cart-content {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2rem;
}

@media (max-width: 900px) {
    .cart-content {
        grid-template-columns: 1fr;
    }
}

.cart-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cart-item {
    display: grid;
    grid-template-columns: 60px 1fr auto auto 40px;
    gap: 1rem;
    align-items: center;
    padding: 1.25rem;
    background: rgba(30, 30, 30, 0.8);
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: 1rem;
    transition: all 0.2s;
}

.cart-item:hover {
    border-color: rgba(124, 58, 237, 0.4);
    background: rgba(40, 40, 40, 0.9);
}

@media (max-width: 600px) {
    .cart-item {
        grid-template-columns: 50px 1fr;
        gap: 0.75rem;
    }
    
    .item-quantity,
    .item-price {
        grid-column: span 2;
    }
    
    .remove-item-btn {
        position: absolute;
        top: 0.5rem;
        right: 0.5rem;
    }
}

.item-preview {
    width: 60px;
    height: 60px;
    border-radius: 0.5rem;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
}

.item-color-swatch {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.item-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.item-name {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.item-type {
    font-size: 0.75rem;
    color: #9ca3af;
    margin: 0;
}

.item-config {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.config-tag {
    font-size: 0.7rem;
    padding: 0.125rem 0.5rem;
    background: rgba(124, 58, 237, 0.15);
    border: 1px solid rgba(124, 58, 237, 0.3);
    border-radius: 4px;
    color: #a78bfa;
}

.item-quantity {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.qty-btn {
    width: 28px;
    height: 28px;
    border: 1px solid rgba(124, 58, 237, 0.4);
    border-radius: 6px;
    background: rgba(124, 58, 237, 0.1);
    color: #a78bfa;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:hover {
    background: rgba(124, 58, 237, 0.3);
    border-color: rgba(124, 58, 237, 0.6);
}

.qty-value {
    min-width: 2rem;
    text-align: center;
    font-weight: 600;
    color: #fff;
}

.item-price {
    text-align: right;
}

.unit-price {
    display: block;
    font-size: 0.75rem;
    color: #9ca3af;
}

.total-price {
    display: block;
    font-size: 1.125rem;
    font-weight: 600;
    color: #a78bfa;
}

.remove-item-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-item-btn:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* Cart Summary */
.cart-summary {
    background: rgba(30, 30, 30, 0.9);
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: 1rem;
    padding: 1.5rem;
    height: fit-content;
    position: sticky;
    top: 2rem;
}

.cart-summary h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
    margin: 0 0 1.5rem 0;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    color: #9ca3af;
}

.summary-row.total {
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
    margin-top: 1rem;
}

.summary-divider {
    height: 1px;
    background: rgba(124, 58, 237, 0.2);
    margin: 1rem 0;
}

.checkout-btn {
    width: 100%;
    padding: 1rem;
    margin-top: 1.5rem;
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    border: none;
    border-radius: 0.75rem;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.checkout-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(124, 58, 237, 0.3);
}

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

.continue-shopping-link {
    display: block;
    text-align: center;
    margin-top: 1rem;
    color: #a78bfa;
    text-decoration: none;
    font-size: 0.875rem;
}

.continue-shopping-link:hover {
    color: #c4b5fd;
}

/* Empty State */
.empty-cart-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
}

.empty-cart-state h2 {
    font-size: 1.5rem;
    color: #fff;
    margin: 0 0 0.5rem 0;
}

.empty-cart-state p {
    color: #9ca3af;
    margin: 0 0 2rem 0;
}

.shop-now-btn {
    padding: 0.875rem 2rem;
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    border: none;
    border-radius: 0.75rem;
    color: white;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.shop-now-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(124, 58, 237, 0.3);
    color: white;
}

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: #9ca3af;
    gap: 1rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(124, 58, 237, 0.2);
    border-top-color: #7c3aed;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Components Info Icon & Tooltip */
.item-name-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.components-info-btn {
    width: 20px;
    height: 20px;
    padding: 0;
    border: 1px solid rgba(124, 58, 237, 0.4);
    border-radius: 50%;
    background: rgba(124, 58, 237, 0.15);
    color: #a78bfa;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.components-info-btn:hover {
    background: rgba(124, 58, 237, 0.3);
    border-color: rgba(124, 58, 237, 0.6);
    transform: scale(1.1);
}

.components-tooltip {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    min-width: 200px;
    max-width: 300px;
    padding: 0.75rem 1rem;
    background: rgba(30, 30, 35, 0.98);
    border: 1px solid rgba(124, 58, 237, 0.4);
    border-radius: 0.75rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

.components-info-btn:hover .components-tooltip,
.components-info-btn:focus .components-tooltip,
.components-tooltip.show {
    opacity: 1;
    visibility: visible;
}

.components-tooltip::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-bottom-color: rgba(124, 58, 237, 0.4);
}

.components-tooltip::after {
    content: '';
    position: absolute;
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-bottom-color: rgba(30, 30, 35, 0.98);
}

.tooltip-title {
    font-size: 0.7rem;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.component-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.component-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    padding: 0.25rem 0;
    border-bottom: 1px solid rgba(124, 58, 237, 0.1);
}

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

.component-name {
    color: #e5e5e5;
    font-weight: 500;
}

.component-type {
    color: #8b5cf6;
    font-size: 0.7rem;
}

/* ============================================================================
   LIGHT THEME OVERRIDES
   ============================================================================ */
[data-theme="light"] .cart-item {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(124, 58, 237, 0.12);
}

[data-theme="light"] .cart-item:hover {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(124, 58, 237, 0.25);
}

[data-theme="light"] .cart-summary {
    background: var(--card-bg, #f5f6f8);
    border-color: rgba(124, 58, 237, 0.12);
}

[data-theme="light"] .cart-summary h2 {
    color: #0f172a;
}

[data-theme="light"] .summary-row {
    color: #64748b;
}

[data-theme="light"] .summary-row.total {
    color: #0f172a;
}

[data-theme="light"] .components-tooltip {
    background: rgba(255, 255, 255, 0.98);
    border-color: rgba(124, 58, 237, 0.2);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .components-tooltip::after {
    border-bottom-color: rgba(255, 255, 255, 0.98);
}

[data-theme="light"] .component-name {
    color: #1e293b;
}

[data-theme="light"] .tooltip-title {
    color: #64748b;
}