/* ==========================================
   CART SECTION
   ========================================== */

#cart {
    min-height: 100vh;
    /* padding-top: 105px; */
    background-color: var(--color-background);
}

.cart-title {
    margin-bottom: 40px;
}

/* ==========================================
   CART LAYOUT — Grid 2 cột (items + summary)
   ========================================== */

.cart-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 40px;
    align-items: start;
}

/* ==========================================
   CART ITEMS
   ========================================== */

.cart-items {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: var(--color-card-bg);
    border: 1px solid var(--color-card-border);
    border-radius: 16px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    animation: fadeInItem 0.4s cubic-bezier(0.25, 1, 0.5, 1) both;
}

@media (hover: hover) and (pointer: fine) {
    .cart-item:hover {
        border-color: var(--color-card-hover-border);
        box-shadow: var(--box-shadow);
    }
}

.cart-item img {
    width: 110px;
    height: 110px;
    object-fit: cover;
    border-radius: 12px;
    background: var(--color-surface);
    flex-shrink: 0;
}

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

.cart-item-category {
    font-size: var(--font-size-card-category);
    color: var(--color-accent);
    font-weight: 700;
    margin: 0;
}

.cart-item-info h3 {
    font-family: "Zalando Sans Expanded", sans-serif;
    font-size: var(--font-size-card-title);
    font-weight: 700;
    color: var(--color-text-main);
    margin: 0;
}

.cart-item-customize-box {
    font-family: inherit;
    font-size: var(--small-font-size);
    background: var(--color-surface);
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px dashed var(--color-border);
    margin: 8px 0;
    line-height: 1.45;
}

.customize-names {
    color: var(--color-text-main);
    font-weight: 600;
    margin-bottom: 4px;
}

.customize-options {
    color: var(--color-text-subtle);
    font-weight: 400;
}

/* ==========================================
   CART ITEM ACTIONS — Quantity + Line Total
   ========================================== */

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

.cart-item-line-total {
    font-size: var(--font-size-price);
    font-weight: 700;
    color: var(--color-text-main);
    white-space: nowrap;
}

/* Quantity Controls */
.quantity-control {
    display: flex;
    align-items: center;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.qty-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    margin: 0;
    cursor: pointer;
    color: var(--color-text-subtle);
    transition: background 0.2s ease, color 0.2s ease;
}

.qty-btn .material-symbols-outlined {
    font-size: 18px;
}

@media (hover: hover) and (pointer: fine) {
    .qty-btn:hover {
        background: var(--color-surface);
        color: var(--color-primary);
        box-shadow: none;
        transform: none;
    }
}

.qty-value {
    width: 40px;
    text-align: center;
    font-size: var(--normal-font-size);
    font-weight: 600;
    color: var(--color-text-main);
    border-left: 1px solid var(--color-border);
    border-right: 1px solid var(--color-border);
    line-height: 36px;
    user-select: none;
}

/* Remove Button */
.remove-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    border-radius: 10px;
    padding: 0;
    margin: 0;
    cursor: pointer;
    color: var(--color-text-muted);
    flex-shrink: 0;
    transition: color 0.2s ease, background 0.2s ease;
}

.remove-btn .material-symbols-outlined {
    font-size: 20px;
}

@media (hover: hover) and (pointer: fine) {
    .remove-btn:hover {
        color: var(--color-error);
        background: rgba(163, 60, 60, 0.06);
        box-shadow: none;
        transform: none;
    }
}

/* ==========================================
   ORDER SUMMARY SIDEBAR
   ========================================== */

.cart-summary {
    position: sticky;
    top: 65px;
    padding: 30px;
    background: var(--color-surface);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cart-summary h2 {
    font-family: "Zalando Sans Expanded", sans-serif;
    font-size: var(--font-size-card-title);
    font-weight: 700;
    color: var(--color-text-main);
}

.summary-details {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: var(--normal-font-size);
    color: var(--color-text-subtle);
}

.summary-total {
    font-weight: 700;
    font-size: 1.15em;
    color: var(--color-text-main);
}

.shipping-note {
    font-style: italic;
    color: var(--color-text-muted);
}

.summary-divider {
    height: 1px;
    background: var(--color-border);
}

.actions-group .btn {
    text-align: center;
    justify-content: center;
}

/* ==========================================
   EMPTY CART STATE
   ========================================== */

.cart-empty {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 16px;
    padding: 80px 20px;
}

.cart-empty-icon {
    font-size: 72px !important;
    color: var(--color-text-muted);
    opacity: 0.4;
}

.cart-empty h2 {
    font-family: "Zalando Sans Expanded", sans-serif;
    font-size: var(--title-font-size);
    font-weight: 700;
    color: var(--color-text-main);
}

.cart-empty p {
    color: var(--color-text-muted);
    margin-bottom: 10px;
}

/* ==========================================
   CART CUSTOMIZER PREVIEW ITEM STYLES
   ========================================== */
.cart-item-customize-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
}

.cart-item-customize-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.quantity-control.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.quantity-control.disabled .qty-value {
    padding: 0 12px;
}

.btn-remove-item {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 24px;
    padding: 0;
    transition: color 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
    .btn-remove-item:hover {
        color: var(--color-error);
    }
}

.btn-edit-item {
    padding: 6px 12px;
    font-size: 0.8rem;
    height: auto;
    width: 100%;
    justify-content: center;
}

.btn-edit-item .material-symbols-outlined {
    font-size: 16px;
    margin-right: 4px;
}

/* ==========================================
   ANIMATIONS
   ========================================== */

@keyframes fadeInItem {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOutItem {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(-30px);
    }
}

/* ==========================================
   RESPONSIVE MEDIA QUERIES
   ========================================== */

@media (max-width: 1200px) {
    .cart-layout {
        grid-template-columns: 1fr 320px;
        gap: 30px;
    }
}

@media (max-width: 1024px) {
    .cart-layout {
        grid-template-columns: 1fr 300px;
        gap: 25px;
    }

    .cart-item img {
        width: 90px;
        height: 90px;
    }

    .cart-item {
        gap: 16px;
        padding: 16px;
    }
}

@media (max-width: 768px) {
    .cart-title {
        margin-bottom: 30px;
    }

    .cart-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .cart-summary {
        position: static;
    }

    .cart-item {
        gap: 14px;
        padding: 14px;
    }

    .cart-item img {
        width: 80px;
        height: 80px;
        border-radius: 10px;
    }

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

@media (max-width: 480px) {
    .cart-item {
        flex-wrap: wrap;
        gap: 12px;
        padding: 12px;
    }

    .cart-item img {
        width: 70px;
        height: 70px;
        border-radius: 8px;
    }

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

    .cart-item-actions {
        flex-direction: row-reverse;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        gap: 8px;
    }

    .remove-btn {
        width: 36px;
        height: 36px;
    }

    .cart-summary {
        padding: 20px;
    }

    .cart-empty {
        padding: 50px 16px;
    }
}