/* ========================================
   THREAD. - Cart Page Styles
   ======================================== */

/* Cart Header */
.cart-header {
    padding: 120px 0 40px;
}

.cart-header h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    letter-spacing: -1px;
}

/* Cart Section */
.cart-section {
    padding: 0 0 80px;
    min-height: 50vh;
}

/* Empty State */
.cart-empty {
    text-align: center;
    padding: 80px 0;
}

.empty-icon {
    color: var(--gray-300);
    margin-bottom: 24px;
}

.cart-empty h2 {
    font-size: 1.75rem;
    margin-bottom: 8px;
}

.cart-empty p {
    color: var(--gray-500);
    margin-bottom: 32px;
}

/* Cart Layout */
.cart-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 48px;
    align-items: start;
}

/* Cart Items */
.cart-items {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.cart-item {
    display: flex;
    gap: 20px;
    padding: 24px 0;
    border-bottom: 1px solid var(--gray-200);
    animation: cartItemIn 0.4s ease forwards;
}

@keyframes cartItemIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.cart-item-img {
    width: 120px;
    height: 150px;
    border-radius: var(--radius-md);
    overflow: hidden;
    flex-shrink: 0;
    background: var(--gray-100);
}

.cart-item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.cart-item-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.cart-item-name {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 4px;
}

.cart-item-variant {
    font-size: 13px;
    color: var(--gray-500);
}

.cart-item-remove {
    background: none;
    color: var(--gray-400);
    font-size: 13px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.cart-item-remove:hover {
    color: var(--error);
    background: rgba(239, 68, 68, 0.08);
}

.cart-item-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.quantity-control {
    display: flex;
    align-items: center;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.qty-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--gray-600);
    font-size: 16px;
    transition: var(--transition);
}

.qty-btn:hover {
    background: var(--gray-100);
    color: var(--black);
}

.qty-value {
    width: 44px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    border-left: 1.5px solid var(--gray-200);
    border-right: 1.5px solid var(--gray-200);
    padding: 8px 0;
}

.cart-item-price {
    font-size: 16px;
    font-weight: 600;
    color: var(--black);
}

/* Cart Summary */
.summary-box {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 32px;
    position: sticky;
    top: 96px;
}

.summary-box h3 {
    font-size: 18px;
    margin-bottom: 24px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 14px;
    font-size: 14px;
    color: var(--gray-600);
}

.summary-total {
    font-size: 18px;
    font-weight: 600;
    color: var(--black);
    margin-bottom: 24px;
}

.summary-total span:last-child {
    color: var(--black);
}

.summary-discount span:last-child {
    color: var(--success);
}

.summary-divider {
    height: 1px;
    background: var(--gray-200);
    margin: 16px 0;
}

.promo-code {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.promo-code input {
    flex: 1;
    padding: 10px 14px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: var(--white);
    transition: var(--transition);
}

.promo-code input:focus {
    border-color: var(--black);
}

.checkout-note {
    text-align: center;
    font-size: 12px;
    color: var(--gray-400);
    margin-top: 12px;
}

.continue-link {
    display: block;
    text-align: center;
    font-size: 14px;
    color: var(--gray-500);
    margin-top: 16px;
}

.continue-link:hover {
    color: var(--black);
}

/* Item removing animation */
.cart-item.removing {
    animation: cartItemOut 0.4s ease forwards;
}

@keyframes cartItemOut {
    to {
        opacity: 0;
        transform: translateX(40px);
        height: 0;
        padding: 0;
        margin: 0;
        overflow: hidden;
    }
}

/* ========================================
   Responsive - Cart
   ======================================== */

@media (max-width: 992px) {
    .cart-layout {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .summary-box {
        position: static;
    }
}

@media (max-width: 480px) {
    .cart-item {
        gap: 14px;
    }

    .cart-item-img {
        width: 90px;
        height: 110px;
    }

    .cart-item-name {
        font-size: 14px;
    }

    .summary-box {
        padding: 24px;
    }
}
/* ========================================
   DARK MODE - Cart Page Overrides
   ======================================== */

/* Cart Header */
[data-theme="dark"] .cart-header h1 {
    color: #f5f5f5;
}

/* Empty State */
[data-theme="dark"] .empty-icon {
    color: #444444;
}

[data-theme="dark"] .cart-empty h2 {
    color: #f5f5f5;
}

[data-theme="dark"] .cart-empty p {
    color: #a3a3a3;
}

/* Cart Items */
[data-theme="dark"] .cart-item {
    border-bottom-color: #2a2a2a;
}

[data-theme="dark"] .cart-item-img {
    background: #1a1a1a;
}

[data-theme="dark"] .cart-item-name {
    color: #f5f5f5;
}

[data-theme="dark"] .cart-item-variant {
    color: #888888;
}

[data-theme="dark"] .cart-item-remove {
    color: #888888;
}

[data-theme="dark"] .cart-item-remove:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

[data-theme="dark"] .cart-item-price {
    color: #f5f5f5;
}

/* Quantity Control */
[data-theme="dark"] .quantity-control {
    border-color: #333333;
}

[data-theme="dark"] .qty-btn {
    color: #cccccc;
}

[data-theme="dark"] .qty-btn:hover {
    background: #2a2a2a;
    color: #f5f5f5;
}

[data-theme="dark"] .qty-value {
    color: #f5f5f5;
    border-color: #333333;
}

/* Summary Box */
[data-theme="dark"] .summary-box {
    background: #1a1a1a;
    border-color: #2a2a2a;
}

[data-theme="dark"] .summary-box h3 {
    color: #f5f5f5;
}

[data-theme="dark"] .summary-row {
    color: #a3a3a3;
}

[data-theme="dark"] .summary-total {
    color: #f5f5f5;
}

[data-theme="dark"] .summary-total span:last-child {
    color: #f5f5f5;
}

[data-theme="dark"] .summary-divider {
    background: #333333;
}

/* Promo Code */
[data-theme="dark"] .promo-code input {
    background: #222222;
    border-color: #333333;
    color: #f5f5f5;
}

[data-theme="dark"] .promo-code input::placeholder {
    color: #666666;
}

[data-theme="dark"] .promo-code input:focus {
    border-color: #f5f5f5;
}

[data-theme="dark"] .checkout-note {
    color: #666666;
}

[data-theme="dark"] .continue-link {
    color: #888888;
}

[data-theme="dark"] .continue-link:hover {
    color: #f5f5f5;
}