/* ===== CART PAGE ===== */

.cart-page {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 100px 32px 60px;
    min-height: 80vh;
}

.cart-page-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 32px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.cart-page-title .cart-count-label {
    font-size: 16px;
    font-weight: 400;
    color: var(--text-secondary);
}

/* Layout: items + sidebar */
.cart-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 32px;
    align-items: start;
}

/* ===== CART ITEMS ===== */
.cart-items {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cart-item {
    display: grid;
    grid-template-columns: 100px 1fr auto;
    gap: 20px;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: var(--transition);
}
.cart-item:hover {
    border-color: rgba(255, 255, 255, .15);
}

.cart-item-img {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.cart-item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.cart-item-img svg {
    color: var(--text-tertiary);
}

.cart-item-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.cart-item-title {
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.cart-item-title a {
    color: var(--text);
    transition: var(--transition);
}
.cart-item-title a:hover {
    color: var(--accent);
}

.cart-item-variant {
    font-size: 13px;
    color: var(--text-secondary);
}

.cart-item-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent);
}

.cart-item-unavailable {
    font-size: 12px;
    color: #ff5252;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
}

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

/* Quantity controls */
.qty-controls {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.qty-btn {
    width: 36px;
    height: 36px;
    background: var(--bg-elevated);
    color: var(--text);
    border: none;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}
.qty-btn:hover {
    background: var(--accent-dim);
    color: var(--accent);
}
.qty-btn:disabled {
    opacity: .3;
    cursor: not-allowed;
}

.qty-value {
    width: 44px;
    height: 36px;
    background: var(--bg-card);
    color: var(--text);
    border: none;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    font-family: inherit;
    -moz-appearance: textfield;
}
.qty-value::-webkit-inner-spin-button,
.qty-value::-webkit-outer-spin-button {
    -webkit-appearance: none;
}

.cart-item-remove {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}
.cart-item-remove:hover {
    color: #ff5252;
    background: rgba(255, 82, 82, .1);
}

/* ===== CART SIDEBAR (SUMMARY) ===== */
.cart-sidebar {
    position: sticky;
    top: 90px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
}

.cart-sidebar-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
}

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
    color: var(--text-secondary);
}
.cart-summary-row span:last-child {
    color: var(--text);
    font-weight: 500;
}

.cart-summary-divider {
    height: 1px;
    background: var(--border);
    margin: 12px 0;
}

.cart-summary-total {
    display: flex;
    justify-content: space-between;
    padding: 12px 0 0;
    font-size: 20px;
    font-weight: 700;
}
.cart-summary-total span:last-child {
    color: var(--accent);
}

.cart-checkout-btn {
    width: 100%;
    padding: 16px;
    margin-top: 20px;
    background: var(--accent);
    color: #000;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: .5px;
}
.cart-checkout-btn:hover {
    background: #00cadb;
    transform: translateY(-1px);
    box-shadow: 0 8px 30px var(--accent-glow);
}
.cart-checkout-btn:disabled {
    opacity: .4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.cart-clear-btn {
    width: 100%;
    padding: 12px;
    margin-top: 10px;
    background: none;
    color: var(--text-tertiary);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
}
.cart-clear-btn:hover {
    color: #ff5252;
    border-color: rgba(255, 82, 82, .3);
    background: rgba(255, 82, 82, .05);
}

.cart-unavailable-note {
    margin-top: 14px;
    padding: 10px 14px;
    background: rgba(255, 82, 82, .08);
    border: 1px solid rgba(255, 82, 82, .2);
    border-radius: 8px;
    font-size: 12px;
    color: #ff5252;
    line-height: 1.5;
}

/* ===== EMPTY CART ===== */
.cart-empty {
    text-align: center;
    padding: 80px 20px;
}
.cart-empty svg {
    color: var(--text-tertiary);
    margin-bottom: 24px;
}
.cart-empty h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 12px;
}
.cart-empty p {
    color: var(--text-secondary);
    margin-bottom: 32px;
}
.cart-empty-link {
    display: inline-block;
    padding: 14px 32px;
    border: 1px solid var(--accent);
    color: var(--accent);
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    transition: var(--transition);
}
.cart-empty-link:hover {
    background: var(--accent);
    color: #000;
}

/* ===== TOAST NOTIFICATION ===== */
.toast-container {
    position: fixed;
    bottom: 32px;
    right: 32px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.toast {
    padding: 14px 20px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    color: var(--text);
    box-shadow: 0 8px 32px rgba(0, 0, 0, .5);
    animation: toastIn .3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 340px;
}
.toast--success {
    border-color: rgba(0, 229, 255, .3);
}
.toast--error {
    border-color: rgba(255, 82, 82, .3);
}
.toast-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}
.toast--success .toast-icon { color: var(--accent); }
.toast--error .toast-icon { color: #ff5252; }

@keyframes toastIn {
    from { opacity: 0; transform: translateY(20px) scale(.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to   { opacity: 0; transform: translateY(20px) scale(.95); }
}

/* ===== LOADING SPINNER ON CART ITEM ===== */
.cart-item--loading {
    opacity: .5;
    pointer-events: none;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .cart-layout {
        grid-template-columns: 1fr;
    }
    .cart-sidebar {
        position: static;
    }
}
@media (max-width: 600px) {
    .cart-page {
        padding: 90px 16px 40px;
    }
    .cart-item {
        grid-template-columns: 72px 1fr;
        gap: 12px;
    }
    .cart-item-actions {
        grid-column: 1 / -1;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    .cart-page-title {
        font-size: 24px;
    }
    .cart-sidebar {
        padding: 20px;
    }
    .cart-summary-total {
        font-size: 18px;
    }
    .cart-checkout-btn {
        font-size: 14px;
        padding: 14px;
    }
    .toast-container {
        right: 16px;
        bottom: 16px;
        left: 16px;
    }
    .toast {
        max-width: 100%;
    }
}
