/* Commerce storefront: cart, mini cart, checkout and order pages (built on Catalog's shop-base.css; every rule under .cw-shop). */

.cw-shop .cws-title-note { font-size: .5em; font-weight: 500; color: var(--cws-muted); margin-left: .5rem; letter-spacing: 0; }
.cw-shop .cws-note { color: var(--cws-muted); font-size: .85rem; margin: .75rem 0; }
.cw-shop .cws-back-link { display: inline-block; margin-top: 1.25rem; color: var(--cws-muted); text-decoration: none; font-size: .95rem; }
.cw-shop .cws-back-link:hover { color: var(--cws-accent); }

/* ------------------------------------------------------------- steps */
.cw-shop .cws-steps { display: flex; gap: .5rem; list-style: none; padding: 0; margin: 0 0 1.5rem; flex-wrap: wrap; }
.cw-shop .cws-steps li { display: inline-flex; align-items: center; gap: .5rem; color: var(--cws-muted); font-size: .9rem; font-weight: 550; }
.cw-shop .cws-steps li + li::before { content: ""; width: 1.75rem; height: 1px; background: var(--cws-line); margin-right: .25rem; }
.cw-shop .cws-step-dot { display: inline-flex; align-items: center; justify-content: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; border: 1.5px solid var(--cws-line); font-size: .8rem; background: var(--cws-surface); }
.cw-shop .cws-steps .is-current { color: var(--cws-ink); }
.cw-shop .cws-steps .is-current .cws-step-dot { background: var(--cws-accent); border-color: var(--cws-accent); color: var(--cws-accent-ink); }
.cw-shop .cws-steps .is-done .cws-step-dot { background: var(--cws-ok); border-color: var(--cws-ok); color: #fff; }
.cw-shop .cws-steps .is-done { color: var(--cws-ink); }
@media (max-width: 575.98px) { .cw-shop .cws-steps .cws-step-label { display: none; } .cw-shop .cws-steps .is-current .cws-step-label { display: inline; } }

/* -------------------------------------------------------------- cart */
.cw-shop .cws-cart-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; align-items: start; }
@media (min-width: 992px) { .cw-shop .cws-cart-layout { grid-template-columns: minmax(0, 1fr) 24rem; gap: 2rem; } .cw-shop .cws-cart-summary { position: sticky; top: 1.5rem; } }
.cw-shop .cws-lines { list-style: none; margin: 0; padding: 0; border: 1px solid var(--cws-line); border-radius: var(--cws-radius); background: var(--cws-surface); overflow: hidden; }
.cw-shop .cws-line { display: grid; grid-template-columns: 5rem minmax(0, 1fr) auto; gap: 1rem; padding: 1rem 1.1rem; border-bottom: 1px solid var(--cws-line); }
.cw-shop .cws-line:last-child { border-bottom: 0; }
@media (min-width: 576px) { .cw-shop .cws-line { grid-template-columns: 6.5rem minmax(0, 1fr) auto; gap: 1.25rem; padding: 1.25rem; } }
.cw-shop .cws-line-media { aspect-ratio: 1 / 1; border-radius: var(--cws-radius-sm); overflow: hidden; background: var(--cws-soft); }
.cw-shop .cws-line-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cw-shop .cws-line-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: color-mix(in srgb, var(--cws-muted) 60%, transparent); }
.cw-shop .cws-line-name { font-weight: 600; line-height: 1.35; }
.cw-shop .cws-line-name a { color: var(--cws-ink); text-decoration: none; }
.cw-shop .cws-line-name a:hover { color: var(--cws-accent); }
.cw-shop .cws-line-meta { color: var(--cws-muted); font-size: .85rem; margin-top: .15rem; }
.cw-shop .cws-line-issue { color: var(--cws-sale); font-size: .85rem; margin-top: .35rem; }
.cw-shop .cws-line-controls { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin-top: .75rem; }
.cw-shop .cws-line-qty { display: flex; align-items: center; gap: .5rem; margin: 0; }
.cw-shop .cws-line-qty.is-ready [data-cws-qty-submit] { display: none; }
.cw-shop .cws-line-qty .cws-qty input[type=number] { min-height: 2.25rem; width: 2.75rem; }
.cw-shop .cws-line-qty .cws-qty button { width: 2.25rem; }
.cw-shop .cws-line-price { text-align: right; display: flex; flex-direction: column; gap: .15rem; white-space: nowrap; }
.cw-shop .cws-line-price .cws-price { font-size: 1.05rem; }
.cw-shop .cws-line-unit { color: var(--cws-muted); font-size: .8rem; }

.cw-shop .cws-totals { margin: 0; display: grid; gap: .5rem; }
.cw-shop .cws-totals > div { display: flex; justify-content: space-between; gap: 1rem; }
.cw-shop .cws-totals dt { font-weight: 400; color: var(--cws-muted); }
.cw-shop .cws-totals dd { margin: 0; font-variant-numeric: tabular-nums; text-align: right; }
.cw-shop .cws-totals .is-total { border-top: 1px solid var(--cws-line); padding-top: .75rem; margin-top: .25rem; }
.cw-shop .cws-totals .is-total dt, .cw-shop .cws-totals .is-total dd { color: var(--cws-ink); font-weight: 700; font-size: 1.1rem; }
.cw-shop .cws-totals .is-discount { color: var(--cws-ok); }
.cw-shop .cws-totals .is-discount dt { color: var(--cws-ok); }
.cw-shop .cws-summary-coupon { margin: 1rem 0; padding: 1rem 0; border-top: 1px solid var(--cws-line); border-bottom: 1px solid var(--cws-line); }

/* the free-shipping progress (cart, summary, mini cart) */
.cw-shop .commerce-free-shipping { margin: .75rem 0; }
.cw-shop .commerce-free-shipping p { font-size: .85rem; margin: 0 0 .4rem; }
.cw-shop .commerce-free-shipping .progress { height: .45rem !important; background: var(--cws-line); border-radius: 999px; overflow: hidden; }
.cw-shop .commerce-free-shipping .progress-bar { background: var(--cws-accent); transition: width 300ms ease; }
.cw-shop .commerce-free-shipping .progress-bar.bg-success { background: var(--cws-ok) !important; }

/* ---------------------------------------------------------- mini cart */
.commerce-minicart-panel { position: absolute; right: 0; top: 100%; width: 24rem; max-width: calc(100vw - 2rem); z-index: 1060; margin-top: .5rem; padding: 1rem; background: var(--cws-surface, #fff); color: var(--cws-ink, inherit); border: 1px solid var(--cws-line, #e5e7eb); border-radius: var(--cws-radius, 12px); box-shadow: 0 16px 40px rgba(17, 24, 39, .16); text-align: left; }
.commerce-minicart-panel[hidden] { display: none; }
@media (max-width: 575.98px) { .commerce-minicart-panel { position: fixed; left: 1rem; right: 1rem; top: 4.5rem; width: auto; max-width: none; } }
.commerce-minicart .commerce-cart-count.badge { background: var(--cws-accent, var(--bs-primary, #2563eb)); color: var(--cws-accent-ink, #fff); font-weight: 650; font-size: .7rem; }
.cw-shop .cws-mini-lines { list-style: none; margin: 0 0 .75rem; padding: 0; max-height: 19rem; overflow-y: auto; }
.cw-shop .cws-mini-line { display: grid; grid-template-columns: 3.25rem minmax(0, 1fr) auto; gap: .75rem; padding: .75rem 0; border-bottom: 1px solid var(--cws-line); }
.cw-shop .cws-mini-line:first-child { padding-top: 0; }
.cw-shop .cws-mini-media { width: 3.25rem; height: 3.25rem; border-radius: 8px; overflow: hidden; background: var(--cws-soft); }
.cw-shop .cws-mini-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cw-shop .cws-mini-media span { display: block; width: 100%; height: 100%; }
.cw-shop .cws-mini-name { font-size: .9rem; font-weight: 600; line-height: 1.3; }
.cw-shop .cws-mini-name a { color: var(--cws-ink); text-decoration: none; }
.cw-shop .cws-mini-name a:hover { color: var(--cws-accent); }
.cw-shop .cws-mini-meta { display: block; font-size: .78rem; color: var(--cws-muted); }
.cw-shop .cws-mini-side { text-align: right; font-size: .85rem; white-space: nowrap; display: flex; flex-direction: column; align-items: flex-end; gap: .2rem; }
.cw-shop .cws-mini-total { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.cw-shop .cws-mini-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-top: .85rem; }
.cw-shop .cws-mini-actions .btn { min-height: 2.5rem; }

/* ---------------------------------------------------------- checkout */
.cw-shop .cws-checkout-main { counter-reset: cws-section; }
@media (min-width: 992px) { .cw-shop .cws-checkout-aside { position: sticky; top: 1.5rem; align-self: start; } }
.cw-shop .cws-checkout-main > fieldset, .cw-shop .cws-checkout-extras {
    background: var(--cws-surface); border: 1px solid var(--cws-line); border-radius: var(--cws-radius); box-shadow: var(--cws-shadow); padding: 1.25rem 1.25rem .5rem; margin: 0 0 1.25rem !important; min-width: 0;
}
.cw-shop .cws-checkout-extras { padding-bottom: 1.25rem; }
.cw-shop .cws-checkout-main > fieldset > legend {
    float: left; width: 100%; display: flex; align-items: center; gap: .65rem; font-size: 1.1rem; font-weight: 650; margin: 0 0 1rem; padding: 0; counter-increment: cws-section;
}
.cw-shop .cws-checkout-main > fieldset > legend + * { clear: left; }
.cw-shop .cws-checkout-main > fieldset > legend::before {
    content: counter(cws-section); display: inline-flex; align-items: center; justify-content: center; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--cws-soft); border: 1px solid var(--cws-line); font-size: .8rem; font-weight: 700; flex: none;
}
.cw-shop .cws-checkout-main .mb-3 > .form-label { font-size: .875rem; }
.cw-shop .cws-checkout-main .form-text { font-size: .8rem; }

/* radio choices (shipping, payment) as selectable cards */
.cw-shop .cws-option { position: relative; display: flex; align-items: flex-start; gap: .75rem; padding: .9rem 1rem !important; margin-bottom: .6rem !important; border: 1px solid var(--cws-line); border-radius: var(--cws-radius-sm); background: var(--cws-surface); transition: border-color var(--cws-ease), background-color var(--cws-ease), box-shadow var(--cws-ease); }
.cw-shop .cws-option .form-check-input { float: none; margin: .2rem 0 0; flex: none; }
.cw-shop .cws-option .form-check-label { flex: 1; font-weight: 600; cursor: pointer; }
.cw-shop .cws-option .form-check-label::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.cw-shop .cws-option .form-check-label small { font-weight: 400; margin-top: .15rem; }
.cw-shop .cws-option:hover { border-color: color-mix(in srgb, var(--cws-line) 50%, var(--cws-ink)); }
.cw-shop .cws-option:has(input:checked) { border-color: var(--cws-accent); background: color-mix(in srgb, var(--cws-accent) 6%, var(--cws-surface)); box-shadow: 0 0 0 1px var(--cws-accent); }
.cw-shop .cws-option:has(input:focus-visible) { box-shadow: var(--cws-ring); }

/* the order summary */
.cw-shop.commerce-summary, .cw-shop .commerce-summary { border-radius: var(--cws-radius); }
.cw-shop .commerce-summary .card-body { padding: 1.35rem; }
.cw-shop .commerce-summary hr { border-color: var(--cws-line); opacity: 1; margin: 1rem 0; }
.cw-shop .cws-sum-line { align-items: flex-start; }
.cw-shop .cws-sum-media { flex: none; width: 3rem; height: 3rem; border-radius: 8px; overflow: hidden; background: var(--cws-soft); }
.cw-shop .cws-sum-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cw-shop .cws-sum-media i { display: block; width: 100%; height: 100%; }
.cw-shop .cws-sum-name { flex: 1; min-width: 0; font-size: .92rem; }
.cw-shop .commerce-summary [data-commerce-total] { font-size: 1.2rem; }
.cw-shop .commerce-summary details summary { cursor: pointer; }
.cw-shop #place-order-notice { color: var(--cws-muted); }

/* ------------------------------------------------- order pages (confirmation + account) */
.cw-shop .cws-hero { text-align: center; padding: 1.5rem 0 2rem; }
.cw-shop .cws-hero-icon { display: inline-flex; align-items: center; justify-content: center; width: 4rem; height: 4rem; border-radius: 50%; background: color-mix(in srgb, var(--cws-ok) 14%, transparent); color: var(--cws-ok); margin-bottom: 1rem; }
.cw-shop .cws-hero h1 { margin-bottom: .5rem; }
.cw-shop .cws-hero-number { font-size: 1.1rem; margin: 0 0 .25rem; }
.cw-shop .cws-hero-number strong { background: var(--cws-soft); border: 1px solid var(--cws-line); border-radius: 999px; padding: .2rem .8rem; font-variant-numeric: tabular-nums; }
.cw-shop .cws-hero-meta { color: var(--cws-muted); font-size: .875rem; margin: 0; }
.cw-shop .cws-order .cws-steps { justify-content: center; }
.cw-shop .cws-order > .alert, .cw-shop .cws-order > .text-muted, .cw-shop .cws-order > .cws-card { max-width: 56rem; margin-left: auto; margin-right: auto; }
.cw-shop .cws-order > section, .cw-shop .cws-order > .row, .cw-shop .cws-order > .d-flex, .cw-shop .cws-order > p { max-width: 56rem; margin-left: auto; margin-right: auto; }
.cw-shop .cws-order address { font-style: normal; line-height: 1.6; }

/* tables (confirmation items, account orders) */
.cw-shop .table-responsive { border: 1px solid var(--cws-line); border-radius: var(--cws-radius); background: var(--cws-surface); }
.cw-shop .cws-card .table-responsive { border: 0; border-radius: 0; background: transparent; }
.cw-shop .table { --bs-table-bg: transparent; --bs-table-border-color: var(--cws-line); margin: 0; }
.cw-shop .table > :not(caption) > * > * { padding: .85rem 1rem; border-bottom-color: var(--cws-line); }
.cw-shop .table thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--cws-muted); font-weight: 650; background: var(--cws-soft); border-bottom: 1px solid var(--cws-line); }
.cw-shop .table tbody tr:last-child > *, .cw-shop .table tfoot tr:last-child > * { border-bottom: 0; }
.cw-shop .table tfoot th, .cw-shop .table tfoot td { background: transparent; }
.cw-shop .table tfoot tr:last-child th, .cw-shop .table tfoot tr:last-child td { font-size: 1.05rem; font-weight: 700; }
.cw-shop h2.h5, .cw-shop .cws-section-title { font-size: 1.05rem; font-weight: 650; margin: 0 0 .75rem; }
.cw-shop .cws-pill { margin-right: .25rem; }
.cw-shop .table-responsive { overflow-y: hidden; }
