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

.cart-page {
    min-height: 100vh;
    background: var(--cream);
    padding-top: calc(var(--navH) + var(--topbarH, 0px) + 40px);
    padding-bottom: 100px;
}

.cart-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 48px;
}

/* ── STEPS ── */
.cart-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    color: #bbb;
    margin-bottom: 50px;
    margin-top: 50px;
}

.cart-step.is-active { color: var(--text); }
.cart-step-sep {
    color: #ccc;
    letter-spacing: 0;
    font-weight: 400;
    font-size: 11px;
}

/* ── TITLE ── */
.cart-title {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: .5px;
    color: var(--text);
    margin-bottom: 36px;
}

/* ── PAGE LAYOUT: items kiri, summary kanan ── */
/* ── PAGE LAYOUT: items kiri, summary kanan ── */
.cart-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 60px;
    align-items: start;
    /* Tinggi = sisa viewport setelah header */
    height: calc(100dvh - var(--topbar-h) - var(--header-h) - 160px);
    /* 160px = estimasi tinggi steps + title + padding */
}

/* ── KOLOM KIRI: scroll internal ── */
.cart-items-col {
    height: 550px;
    overflow-y: auto;
    padding-right: 12px;      /* biar scrollbar ga nempel konten */
    scrollbar-width: thin;
    scrollbar-color: #ccc8c0 transparent;
}

.cart-items-col::-webkit-scrollbar {
    width: 4px;
}
.cart-items-col::-webkit-scrollbar-track {
    background: transparent;
}
.cart-items-col::-webkit-scrollbar-thumb {
    background: #ccc8c0;
    border-radius: 2px;
}

/* ── KOLOM KANAN: sticky ── */
.cart-summary-col {
    position: sticky;
    top: calc(var(--topbar-h) + var(--header-h) + 24px);
    height: fit-content;
}

/* ── SINGLE CART ITEM ROW ── */
.cart-item {
    display: table;          /* pakai table supaya kolom foto dan info berdampingan bersih */
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    padding-bottom: 28px;
    margin-bottom: 28px;
    border-bottom: 1px solid #ddd8cf;
}

/* Bungkus pakai div biasa, pakai flexbox sederhana */
.cart-item {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 24px;
    padding-bottom: 28px;
    margin-bottom: 28px;
    border-bottom: 1px solid #ddd8cf;
    position: relative;
}

/* ── THUMBNAIL ── */
.cart-thumb {
    flex: 0 0 160px;   /* fixed 100px, ga grow, ga shrink */
    width: 160px;
    height: 213px;
    overflow: hidden;
    background: #e8e2d9;
    display: block;
    text-decoration: none;
}

.cart-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
}

/* ── INFO ── */
.cart-item-info {
    flex: 1 1 0;          /* ambil sisa ruang */
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    margin-left: 120px;
}

.cart-item-name {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: .7px;
    text-transform: uppercase;
    color: var(--text);
    text-decoration: none;
    line-height: 1.4;
}

.cart-item-name:hover { opacity: .6; }

.cart-item-meta {
    font-size: 14px;
    color: var(--muted);
    letter-spacing: .2px;
}

.cart-item-price {
    font-size: 17px;
    font-weight: 500;
    color: var(--text);
    margin-top: 2px;
}

/* Quantity stepper */
.cart-item-qty-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
}

.qty-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--muted);
}

.qty-ctrl {
    display: inline-flex;
    align-items: center;
    border: 1px solid #ccc8c0;
    background: #fff;
}

.qty-btn {
    width: 30px;
    height: 30px;
    border: 0;
    background: transparent;
    cursor: pointer;
    font-size: 15px;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    transition: background .15s;
    line-height: 1;
}

.qty-btn:hover { background: #f0ede6; }

.qty-input {
    width: 36px;
    height: 30px;
    border: 0;
    border-left: 1px solid #ccc8c0;
    border-right: 1px solid #ccc8c0;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    background: transparent;
    font-family: inherit;
    -moz-appearance: textfield;
}

.qty-input::-webkit-inner-spin-button,
.qty-input::-webkit-outer-spin-button { -webkit-appearance: none; }

/* Remove button */
.cart-item-remove {
    background: transparent;
    border: 0;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--muted);
    cursor: pointer;
    padding: 0;
    font-family: inherit;
    margin-top: 70px;
    transition: color .2s;
    align-self: flex-start;
}

.cart-item-remove:hover { color: #b94444; }

/* ── VOUCHER ── */
.cart-voucher-row {
    display: flex;
    margin-top: 8px;
    padding-top: 28px;
    border-top: 1px solid #ddd8cf;
}

.voucher-input {
    flex: 1;
    height: 44px;
    padding: 0 14px;
    border: 1px solid #ccc8c0;
    border-right: 0;
    font-size: 13px;
    font-family: inherit;
    color: var(--text);
    background: #fff;
    outline: none;
}

.voucher-input::placeholder { color: #bbb; }
.voucher-input:focus { border-color: var(--text); }

.voucher-apply {
    height: 44px;
    padding: 0 22px;
    background: #7a7a65;
    color: #fff;
    border: 0;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    font-family: inherit;
    transition: background .2s;
}

.voucher-apply:hover { background: #5f5f4d; }

/* ── ORDER SUMMARY ── */
.cart-summary-col {
    position: sticky;
    top: calc(var(--navH) + var(--topbarH, 0px) + 24px);
}

.cart-summary {
    background: #eeeae2;
    padding: 26px 24px 30px;
}

.summary-heading {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text);
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid #d5d0c6;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 14px;
    color: var(--text);
    margin-bottom: 8px;
}

.summary-shipping-note {
    font-size: 11px;
    color: var(--muted);
    text-align: right;
}

.summary-divider {
    height: 1px;
    background: #d5d0c6;
    margin: 14px 0;
}

.summary-total-row {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 22px;
}

.btn-checkout {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 48px;
    background: var(--text);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-decoration: none;
    margin-bottom: 14px;
    transition: background .2s;
}

.btn-checkout:hover { background: #333; }

.btn-continue {
    display: block;
    text-align: center;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: var(--muted);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color .2s;
}

.btn-continue:hover { color: var(--text); }

/* ── EMPTY ── */
.cart-empty {
    text-align: center;
    padding: 80px 20px;
}

.cart-empty p {
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 20px;
}

.btn-browse {
    display: inline-flex;
    align-items: center;
    height: 44px;
    padding: 0 28px;
    background: var(--text);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    text-decoration: none;
    transition: background .2s;
}

.btn-browse:hover { background: #333; }

/* ================================
   RESPONSIVE — SMALL LAPTOP (≤ 1280px)
================================ */
@media (max-width: 1280px) {
    .cart-container    { padding: 0 36px }
    .cart-layout       { grid-template-columns: 1fr 260px; gap: 40px }
    .cart-thumb        { flex: 0 0 140px; width: 140px; height: 187px }
    .cart-item-remove  { margin-top: 40px }
}

/* ================================
   RESPONSIVE — MEDIUM LAPTOP (≤ 1024px)
================================ */
@media (max-width: 1024px) {
    .cart-container    { padding: 0 28px }
    .cart-layout       { grid-template-columns: 1fr 220px; gap: 28px; }
    .cart-steps        { font-size: 11px; gap: 10px; margin-bottom: 32px }
    .cart-title        { font-size: 24px; margin-bottom: 24px }
    .cart-thumb        { flex: 0 0 120px; width: 120px; height: 160px }
    .cart-item-name    { font-size: 15px }
    .cart-item-meta    { font-size: 13px }
    .cart-item-price   { font-size: 14px }
    .cart-item-remove  { margin-top: 24px; font-size: 12px }
    .summary-heading   { font-size: 15px }
    .summary-row       { font-size: 13px }
    .summary-total-row { font-size: 14px }
    .cart-summary      { padding: 20px 18px 24px }
}

/* ================================
   RESPONSIVE — TABLET (≤ 960px)
================================ */
@media (max-width: 960px) {
    .cart-layout       { grid-template-columns: 1fr; gap: 28px; height: auto }
    .cart-items-col     { height: auto; overflow-y: visible; padding-right: 0 }
    .cart-summary-col  { position: static }
    .cart-summary      { max-width: 480px }
    .cart-thumb        { flex: 0 0 130px; width: 130px; height: 173px }
}

/* ================================
   RESPONSIVE — MOBILE (≤ 768px)
================================ */
@media (max-width: 768px) {
    .cart-container    { padding: 0 20px }
    .cart-title        { font-size: 20px; margin-bottom: 20px }
    .cart-steps        { font-size: 9px; gap: 8px; margin-bottom: 24px }
    .cart-item         { gap: 16px }
    .cart-thumb        { flex: 0 0 100px; width: 100px; height: 133px }
    .cart-item-name    { font-size: 13px }
    .cart-item-meta    { font-size: 12px }
    .cart-item-price   { font-size: 13px }
    .cart-item-remove  { margin-top: 12px; font-size: 11px }
    .qty-btn           { width: 26px; height: 26px }
    .qty-input         { width: 30px; height: 26px; font-size: 12px }
    .cart-summary      { max-width: 100% }
    .cart-item-qty-row { gap: 8px; margin-top: 8px }
}

/* ================================
   RESPONSIVE — SMALL MOBILE (≤ 480px)
================================ */
@media (max-width: 480px) {
    .cart-thumb        { flex: 0 0 80px; width: 80px; height: 107px }
    .cart-item-name    { font-size: 12px }
    .voucher-input     { font-size: 12px }
    .voucher-apply     { padding: 0 16px; font-size: 10px }
    .btn-checkout      { font-size: 10px; height: 44px }
}