.cart-main{
    width:min(1240px,94%);
    margin:0 auto;
    padding:34px 0 110px;
}

.cart-hero{
    display:flex;
    justify-content:space-between;
    align-items:flex-end;
    gap:24px;
    padding:32px;
    border-radius:36px;
    background:
        radial-gradient(circle at top left, rgba(212,175,55,.16), transparent 35%),
        var(--surface);
    border:1px solid var(--border);
    box-shadow:var(--shadow2);
    margin-bottom:24px;
}

.back-link{
    display:inline-flex;
    text-decoration:none;
    color:var(--text);
    background:var(--soft);
    border:1px solid var(--border);
    padding:11px 15px;
    border-radius:16px;
    font-weight:900;
    margin-bottom:18px;
}

.cart-hero h1{
    font-size:clamp(38px,5vw,66px);
    line-height:1;
    letter-spacing:-2.5px;
    margin-bottom:12px;
}

.cart-hero p{
    color:var(--muted);
    line-height:1.7;
}

.cart-hero-card{
    min-width:250px;
    padding:22px;
    border-radius:26px;
    background:
        radial-gradient(circle at top left, rgba(212,175,55,.20), transparent 38%),
        var(--surface2);
    border:1px solid var(--border);
}

.cart-hero-card span{
    color:var(--muted);
    font-size:13px;
    font-weight:800;
}

.cart-hero-card strong{
    display:block;
    color:var(--gold);
    font-size:34px;
    margin:7px 0;
}

.cart-hero-card small{
    color:var(--muted);
}

.cart-alert{
    padding:15px 18px;
    border-radius:16px;
    margin-bottom:20px;
    font-weight:800;
}

.success-alert{
    color:#166534;
    background:rgba(22,163,74,.12);
    border:1px solid rgba(22,163,74,.22);
}

.error-alert{
    color:#7f1d1d;
    background:rgba(239,68,68,.13);
    border:1px solid rgba(239,68,68,.22);
}

html[data-theme="dark"] .success-alert{
    color:#bbf7d0;
}

html[data-theme="dark"] .error-alert{
    color:#fecdd3;
}

.cart-layout{
    display:grid;
    grid-template-columns:minmax(0,1fr) 360px;
    gap:24px;
    align-items:start;
}

.cart-items-area{
    display:flex;
    flex-direction:column;
    gap:20px;
}

.cart-select-bar,
.merchant-cart-group,
.summary-card,
.cart-note-card,
.empty-cart{
    border-radius:30px;
    background:
        radial-gradient(circle at top left, rgba(212,175,55,.10), transparent 34%),
        var(--surface);
    border:1px solid var(--border);
    box-shadow:var(--shadow);
}

.cart-select-bar{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:14px;
    padding:16px 18px;
}

.cart-select-bar label{
    display:flex;
    align-items:center;
    gap:10px;
    cursor:pointer;
    color:var(--text);
    font-weight:900;
}

.cart-select-bar input{
    width:18px;
    height:18px;
    accent-color:var(--gold);
}

.cart-select-bar strong{
    color:var(--gold);
    white-space:nowrap;
}

.merchant-cart-group{
    padding:18px;
}

.merchant-group-header{
    display:flex;
    justify-content:space-between;
    gap:18px;
    align-items:flex-start;
    padding:17px;
    border-radius:24px;
    background:var(--surface2);
    border:1px solid var(--border);
    margin-bottom:14px;
}

.merchant-group-header span{
    color:var(--muted);
    font-size:12px;
    font-weight:800;
}

.merchant-group-header h2{
    color:var(--gold);
    margin:5px 0;
    font-size:24px;
    letter-spacing:-.8px;
}

.merchant-group-header p{
    color:var(--muted);
}

.merchant-group-header strong{
    display:block;
    color:var(--gold);
    font-size:20px;
    margin-top:5px;
}

/* Premium compact cart item */
.cart-item{
    position:relative;
    display:grid;
    grid-template-columns:34px 112px minmax(0,1fr);
    gap:14px;
    align-items:stretch;
    padding:13px;
    border-radius:24px;
    background:
        linear-gradient(145deg, var(--surface2), var(--surface));
    border:1px solid var(--border);
    margin-bottom:12px;
    transition:.25s ease;
}

.cart-item:hover{
    transform:translateY(-2px);
    box-shadow:var(--shadow);
}

.cart-item:last-child{
    margin-bottom:0;
}

.cart-check{
    display:flex;
    align-items:center;
    justify-content:center;
}

.cart-check input{
    display:none;
}

.cart-check span{
    width:23px;
    height:23px;
    border-radius:9px;
    border:2px solid var(--border);
    background:var(--surface);
    box-shadow:inset 0 0 0 3px transparent;
    transition:.2s ease;
}

.cart-check input:checked + span{
    border-color:var(--gold);
    background:linear-gradient(135deg,var(--gold),var(--gold2));
    box-shadow:inset 0 0 0 5px var(--surface);
}

.cart-item-image{
    width:112px;
    height:112px;
    border-radius:22px;
    overflow:hidden;
    background:var(--soft);
    border:1px solid var(--border);
    align-self:start;
}

.cart-item-image img{
    width:100%;
    height:100%;
    object-fit:cover;
    display:block;
}

.cart-item-details{
    min-width:0;
    display:flex;
    flex-direction:column;
    gap:13px;
}

.cart-item-top{
    display:flex;
    justify-content:space-between;
    gap:16px;
}

.cart-item-top span{
    color:var(--muted);
    font-size:12px;
    font-weight:800;
}

.cart-item-top h3{
    font-size:20px;
    letter-spacing:-.5px;
    margin:6px 0;
    color:var(--text);
}

.cart-item-top p{
    color:var(--muted);
    font-size:13px;
    line-height:1.5;
}

.cart-item-top > strong{
    color:var(--gold);
    font-size:22px;
    white-space:nowrap;
}

.cart-item-bottom{
    display:flex;
    justify-content:space-between;
    gap:14px;
    align-items:flex-end;
}

.qty-update-form{
    display:flex;
    gap:9px;
    flex-wrap:wrap;
    align-items:center;
}

.cart-qty{
    height:42px;
    display:flex;
    overflow:hidden;
    border-radius:15px;
    border:1px solid var(--border);
    background:var(--surface);
}

.cart-qty button{
    width:42px;
    border:none;
    cursor:pointer;
    color:#050505;
    background:linear-gradient(135deg,var(--gold),var(--gold2));
    font-weight:900;
    font-size:18px;
}

.cart-qty input{
    width:58px;
    border:none;
    outline:none;
    text-align:center;
    color:var(--text);
    background:transparent;
    font-weight:900;
}

.update-btn,
.remove-btn{
    height:42px;
    border:none;
    cursor:pointer;
    border-radius:15px;
    padding:0 13px;
    font-weight:900;
    font-family:inherit;
}

.update-btn{
    color:#050505;
    background:linear-gradient(135deg,var(--gold),var(--gold2));
}

.remove-btn{
    color:#7f1d1d;
    background:rgba(239,68,68,.14);
}

html[data-theme="dark"] .remove-btn{
    color:#fecdd3;
}

.cart-line-summary{
    display:flex;
    gap:10px;
}

.cart-line-summary div{
    min-width:118px;
    padding:11px 12px;
    border-radius:17px;
    background:var(--surface);
    border:1px solid var(--border);
}

.cart-line-summary span{
    display:block;
    color:var(--muted);
    font-size:11px;
    margin-bottom:5px;
}

.cart-line-summary strong{
    color:var(--gold);
}

.cart-item.not-selected{
    opacity:.48;
    filter:grayscale(.25);
}

.cart-item.not-selected .cart-item-image img{
    transform:scale(.98);
}

/* Summary */
.cart-summary{
    position:sticky;
    top:112px;
    display:flex;
    flex-direction:column;
    gap:18px;
}

.summary-card{
    padding:24px;
}

.summary-heading{
    margin-bottom:20px;
}

.summary-heading h2{
    font-size:26px;
    letter-spacing:-1px;
}

.summary-heading p{
    color:var(--muted);
    margin-top:6px;
}

.summary-line,
.summary-total{
    display:flex;
    justify-content:space-between;
    gap:14px;
    padding:15px 0;
    border-bottom:1px solid var(--border);
}

.summary-line span,
.summary-total span{
    color:var(--muted);
}

.summary-line strong{
    color:var(--text);
}

.summary-total{
    border-bottom:none;
    align-items:center;
}

.summary-total strong{
    color:var(--gold);
    font-size:28px;
}

.checkout-link,
.continue-link,
.empty-cart a{
    min-height:54px;
    border-radius:18px;
    text-decoration:none;
    display:flex;
    align-items:center;
    justify-content:center;
    font-weight:900;
    margin-top:14px;
}

.checkout-link{
    width:100%;
    border:none;
    cursor:pointer;
    font-family:inherit;
    font-size:15px;
    color:#050505;
    background:linear-gradient(135deg,var(--gold),var(--gold2),#b88a1e);
    box-shadow:0 16px 34px rgba(212,175,55,.24);
}

.checkout-submit-btn.disabled,
.checkout-submit-btn:disabled{
    opacity:.45;
    cursor:not-allowed;
    filter:grayscale(.4);
}

.continue-link{
    color:var(--text);
    background:var(--soft);
    border:1px solid var(--border);
}

.cart-note-card{
    padding:22px;
}

.cart-note-card h3{
    color:var(--gold);
    margin-bottom:8px;
}

.cart-note-card p{
    color:var(--muted);
    line-height:1.7;
}

/* Empty */
.empty-cart{
    text-align:center;
    padding:70px 22px;
}

.empty-cart div{
    width:82px;
    height:82px;
    margin:0 auto 20px;
    border-radius:28px;
    display:flex;
    align-items:center;
    justify-content:center;
    color:#050505;
    font-size:36px;
    background:linear-gradient(135deg,var(--gold),var(--gold2));
    box-shadow:0 18px 38px rgba(212,175,55,.22);
}

.empty-cart h2{
    font-size:32px;
    margin-bottom:10px;
}

.empty-cart p{
    color:var(--muted);
    margin-bottom:18px;
}

/* Responsive */
@media(max-width:1050px){
    .cart-layout{
        grid-template-columns:1fr;
    }

    .cart-summary{
        position:relative;
        top:auto;
    }
}

@media(max-width:760px){
    .cart-main{
        width:94%;
        padding-top:22px;
    }

    .cart-hero{
        flex-direction:column;
        align-items:flex-start;
        padding:24px;
        border-radius:30px;
    }

    .cart-hero-card{
        width:100%;
        min-width:0;
    }

    .cart-select-bar{
        flex-direction:column;
        align-items:flex-start;
    }

    .merchant-group-header{
        flex-direction:column;
    }

    .cart-item{
        grid-template-columns:30px 86px minmax(0,1fr);
        gap:10px;
        padding:11px;
        border-radius:22px;
    }

    .cart-item-image{
        width:86px;
        height:86px;
        border-radius:18px;
    }

    .cart-item-top{
        flex-direction:column;
        gap:6px;
    }

    .cart-item-top h3{
        font-size:16px;
        margin:4px 0;
    }

    .cart-item-top p{
        font-size:12px;
    }

    .cart-item-top > strong{
        font-size:18px;
    }

    .cart-item-bottom{
        flex-direction:column;
        align-items:stretch;
    }

    .qty-update-form{
        width:100%;
    }

    .cart-qty{
        flex:1;
    }

    .cart-qty input{
        flex:1;
    }

    .update-btn,
    .remove-btn{
        flex:1;
    }

    .cart-line-summary{
        width:100%;
        flex-direction:column;
    }

    .cart-line-summary div{
        min-width:0;
    }
}

@media(max-width:480px){
    .cart-item{
        grid-template-columns:28px 74px minmax(0,1fr);
    }

    .cart-item-image{
        width:74px;
        height:74px;
    }

    .cart-qty button{
        width:38px;
    }

    .update-btn,
    .remove-btn{
        padding:0 10px;
    }
}

.cart-range-alert{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
}

.cart-range-alert strong{
    display:block;
    margin-bottom:4px;
}

.cart-range-alert span{
    display:block;
    line-height:1.6;
}

.cart-range-alert form{
    flex:0 0 auto;
}

.cart-range-alert button{
    border:none;
    cursor:pointer;
    border-radius:15px;
    padding:12px 16px;
    font-family:inherit;
    font-weight:900;
    color:#050505;
    background:linear-gradient(135deg,var(--gold),var(--gold2));
}

.cart-item.unavailable-location{
    border-color:rgba(239,68,68,.32);
    background:
        radial-gradient(circle at top left, rgba(239,68,68,.08), transparent 35%),
        var(--surface2);
}

.cart-item.unavailable-location .cart-item-image{
    filter:grayscale(.35);
}

.cart-location-warning{
    margin-top:10px;
    padding:12px 14px;
    border-radius:16px;
    background:rgba(239,68,68,.10);
    border:1px solid rgba(239,68,68,.20);
}

.cart-location-warning strong{
    display:block;
    color:#7f1d1d;
    font-size:13px;
    margin-bottom:4px;
}

.cart-location-warning span{
    display:block;
    color:#7f1d1d;
    font-size:12px;
    line-height:1.6;
}

html[data-theme="dark"] .cart-location-warning strong,
html[data-theme="dark"] .cart-location-warning span{
    color:#fecdd3;
}

.cart-check input:disabled + span{
    opacity:.45;
    cursor:not-allowed;
    border-color:rgba(239,68,68,.35);
    background:rgba(239,68,68,.12);
}

.checkout-submit-btn.disabled,
.checkout-submit-btn:disabled{
    opacity:.45;
    cursor:not-allowed;
    filter:grayscale(.4);
}

@media(max-width:720px){
    .cart-range-alert{
        flex-direction:column;
        align-items:flex-start;
    }

    .cart-range-alert form,
    .cart-range-alert button{
        width:100%;
    }
}


.cart-item{
    min-width:0;
}

.cart-item-image{
    flex:0 0 auto;
    overflow:hidden;
}

.cart-item-details{
    min-width:0;
}

.cart-item-details p,
.cart-item-details h3,
.cart-item-title{
    overflow-wrap:anywhere;
}

.cart-item.single-cart-item{
    display:grid;
    grid-template-columns:118px minmax(0,1fr);
    gap:18px;
    align-items:start;
}

.cart-item.single-cart-item .cart-item-image{
    width:118px;
    height:118px;
    grid-column:1;
    grid-row:1 / span 2;
}

.cart-item.single-cart-item .cart-item-details{
    grid-column:2;
    min-width:0;
}

.cart-item.single-cart-item .cart-item-actions,
.cart-item.single-cart-item .cart-item-controls,
.cart-item.single-cart-item .cart-price-block{
    grid-column:1 / -1;
}

.cart-item.single-cart-item .cart-item-image img{
    width:100%;
    height:100%;
    object-fit:cover;
}

@media(max-width:620px){
    .cart-item.single-cart-item{
        grid-template-columns:88px minmax(0,1fr);
        gap:12px;
    }

    .cart-item.single-cart-item .cart-item-image{
        width:88px;
        height:88px;
    }
}