﻿.cart-container {
    max-width: 1100px;
    width: calc(100% - 32px);
    margin: 32px auto 96px;
    /* padding: 0 16px; */
}

.cart-title {
    text-align: center;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 0.02em;
    margin-bottom: 28px;
}

.cart-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) minmax(320px, 1fr);
    gap: 20px;
    align-items: start;
    justify-items: stretch;
}

.cart-main {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cart-summary {
    display: none;
    position: sticky;
    top: 96px;
    align-self: start;
    flex-direction: column;
    gap: 40px;
}

@media (max-width: 960px) {
    .cart-container { width: 100%; padding: 0 18px; margin-bottom: 72px; }
    .cart-layout { grid-template-columns: 1fr; }
    .cart-summary { position: static; }
    .cartActions {
        margin: 0 auto;
        display: flex;
    }
}

.cart-empty {
    display: none;
    /* background: linear-gradient(145deg, #ffffff, #f7f9fb); */
    /* border: 1px solid #ebedf1; */
    border-radius: 16px;
    padding: 32px 24px;
    text-align: center;
    color: #5b6172;
    /* box-shadow: 0 20px 40px -24px rgba(15, 23, 42, 0.2); */
    max-width: 720px;
    margin: 0 auto;
    width: 100%;
}
.cart-empty svg { margin-bottom: 8px; }
.cart-empty p { margin: 12px 0 40px; }

.cart-list { display: flex; flex-direction: column; gap: 12px; }

.cart-item {
    display: grid;
    grid-template-columns: 120px 1fr;
    grid-template-areas: "thumb content";
    gap: 16px;
    align-items: start;
    padding: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 12px 32px -24px rgba(15, 23, 42, 0.24);
}
.cart-thumb {
    grid-area: thumb;
    width: 100%;
    aspect-ratio: 1 / 1;
    max-width: 100%;
    border-radius: 14px;
    background: linear-gradient(135deg, #f7f7fb, #eef1f6);
    border: 1px solid #e5e7eb;
    display: grid;
    place-items: center;
    font-weight: 800;
    color: #1f2937;
    font-size: 13px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    overflow: hidden;
    position: relative;
}
.cart-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cart-thumb-count {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0,0,0,0.72);
    color: #fff;
    font-weight: 800;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 999px;
    box-shadow: 0 6px 12px rgba(0,0,0,0.2);
}
.cart-name a { color: inherit; text-decoration: none; }
.cart-name a:hover { text-decoration: underline; }
.cart-info {
    color: #1f2937;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
}
.cart-name { font-weight: 800; font-size: 16px; line-height: 1.5; }
.cart-name a { color: inherit; text-decoration: none; }
.cart-name a:hover { text-decoration: underline; }
.cart-meta { color: #6b7280; font-size: 13px; line-height: 1.4; }
.cart-content { grid-area: content; display: flex; flex-direction: column; gap: 10px; }
.cart-head { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; }
.cart-amount { min-width: 180px; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.cart-qtywrap { display: flex; align-items: center; gap: 10px; }
.cart-line-total { font-weight: 900; font-size: 16px; color: #111827; }

.cart-fees {
    display: grid;
    gap: 6px;
    padding-top: 10px;
    border-top: 1px solid #f3f4f6;
    font-size: 12px;
    color: #4b5563;
}
.cart-fees > div {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}
.cart-fees span:last-child {
    font-weight: 800;
    min-width: 96px;
    text-align: right;
    color: #111827;
}
.cart-qty {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    align-self: center;
}
.cart-qty .qty-btn.is-hidden {
    visibility: hidden;
    pointer-events: none;
}
.cart-qty .qty-btn {
    width: 28px;
    height: 28px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.cart-qty .qty-val {
    min-width: 20px;
    text-align: center;
    font-weight: 700;
}

.del-btn {
    background: #fff8f8;
    border: 1px solid #f2d7d7;
    color: #d23030;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 12px -10px rgba(0,0,0,0.12);
    transition: all .15s ease;
    margin-left: 0;
}
.del-btn svg { stroke: currentColor; }
.del-btn:hover { background: #ffeaea; border-color: #f3bcbc; }
.del-btn:focus-visible { outline: 2px solid #d23030; outline-offset: 2px; }

.cart-actions {
    /* display: none; */
}
.cart-actions .btn-pill { width: 100%; text-align: center; display: inline-block; display: flex; align-items: center; min-width: 220px; }

.cart-footer {
    display: none;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: 0 12px 32px -24px rgba(15, 23, 42, 0.28);
}
.cart-total .row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    color: #4b5563;
    font-size: 14px;
}
.cart-total .row-divider { border-bottom: 1px solid #e5e7eb; padding-bottom: 8px; margin-bottom: 10px; }
.cart-total .total {
    color: #d42323;
    font-size: 22px;
    margin-bottom: 10px;
    align-items: center;
}
.cart-total .total span:first-child {
    font-size: 12px;
    color: #8b8f9a;
}
.cart-total .total span:last-child {
    font-size: 22px;
    font-weight: 800;
}
.cart-note {
    font-size: 12px;
    color: #6b7280;
    text-align: right;
}

.cart-container.is-empty .cart-layout {
    grid-template-columns: 1fr;
    justify-items: center;
}
.cart-container.is-empty .cart-main {
    align-items: center;
}

@media (max-width: 720px) {
    .cart-info {
        flex-direction: column;
        align-items: flex-start;
    }
    .cart-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .cart-amount {
        width: 100%;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }
    .cart-qtywrap {
        gap: 10px;
    }
    .cart-line-total {
        margin-left: auto;
    }
    .cart-qty {
        margin-left: 0;
    }
    .cart-item {
        grid-template-columns: 1fr;
        grid-template-areas:
            "thumb"
            "content";
        align-items: flex-start;
    }
    .cart-thumb { width: 100%; aspect-ratio: 1 / 1; margin: 0 auto; }
    .cart-content { width: 100%; }
    .cart-actions {
        margin: 0 auto;
        text-align: center;
    }
    .cart-actions .btn-pill {
        width: fit-content;
        min-width: 220px;
        margin: 0 auto;
    }
}
