/* Cart PDF Export – restore veil + empty-cart rebuild panel (3.9.0)
 *
 * Direction: a showroom spec sheet, not a widget.
 *  - One typeface (the site's Montserrat). Hierarchy from size and weight.
 *  - Sentence case everywhere; labels are quiet gray, never tracked capitals.
 *  - White with cool hairlines; navy for structure, red only for the one action.
 *  - The drop target is drawn as a Shaker door: frame + recessed panel.
 *  - Square corners (brand). Product photos on white in a hairline frame.
 */

@font-face { font-family: "CPE Montserrat"; font-weight: 400; font-display: swap; src: url("../fonts/Montserrat-Regular.ttf") format("truetype"); }
@font-face { font-family: "CPE Montserrat"; font-weight: 500; font-display: swap; src: url("../fonts/Montserrat-Medium.ttf") format("truetype"); }
@font-face { font-family: "CPE Montserrat"; font-weight: 600; font-display: swap; src: url("../fonts/Montserrat-SemiBold.ttf") format("truetype"); }
@font-face { font-family: "CPE Montserrat"; font-weight: 700; font-display: swap; src: url("../fonts/Montserrat-Bold.ttf") format("truetype"); }

:root {
    --cpe-navy: #0a2456;
    --cpe-navy-2: #12306b;
    --cpe-ink: #0f1729;
    --cpe-body: #3b4456;
    --cpe-mute: #5b6475;
    --cpe-faint: #8a93a3;
    --cpe-hair: #e3e7ee;
    --cpe-rule: #c9d0db;
    --cpe-tint: #f5f7fa;
    --cpe-red: #d92237;
    --cpe-red-d: #b81b2e;
    --cpe-green: #15803d;
    --cpe-sans: "Montserrat", "CPE Montserrat", "Helvetica Neue", Arial, sans-serif;
}

/* An empty cart has nothing to save: hide the "email me my cart" card there. */
html.cpe-cart-empty #cart-email-export-wrap { display: none !important; }

/* ================================================================
 *  Restore veil
 * ============================================================== */
.cpe-veil {
    position: fixed; inset: 0; z-index: 2147483001;
    display: grid; place-items: center;
    background: #fff;
    opacity: 0; transition: opacity .3s ease;
    font-family: var(--cpe-sans);
}
.cpe-veil.is-in { opacity: 1; }
.cpe-veil.is-out { opacity: 0; }
.cpe-veil__inner { width: min(560px, calc(100vw - 48px)); text-align: center; }
.cpe-veil__mark { font-weight: 800; font-size: 13px; letter-spacing: .04em; color: var(--cpe-navy); }
.cpe-veil__mark span { color: var(--cpe-red); }
.cpe-veil__title { margin: 28px 0 0; font-family: var(--cpe-sans); font-weight: 700; font-size: clamp(26px, 4.4vw, 34px); line-height: 1.15; letter-spacing: -.02em; color: var(--cpe-navy); text-transform: none; text-wrap: balance; }
.cpe-veil__sub { margin: 10px 0 0; font-size: 15px; line-height: 1.5; color: var(--cpe-mute); }
.cpe-veil__bar { position: relative; height: 2px; width: 160px; margin: 28px auto 0; background: var(--cpe-hair); overflow: hidden; }
.cpe-veil__bar i { position: absolute; top: 0; bottom: 0; left: 0; width: 40%; background: var(--cpe-navy); animation: cpe-run 1.1s cubic-bezier(.65,0,.35,1) infinite; }
.cpe-veil.is-done .cpe-veil__bar i { animation: none; width: 100%; transition: width .4s ease; }
@keyframes cpe-run { 0% { transform: translateX(-100%); } 100% { transform: translateX(250%); } }

.cpe-banner { display: flex; gap: 12px; align-items: center; justify-content: space-between; margin: 0 0 18px; padding: 12px 16px; background: #fff; border: 1px solid var(--cpe-hair); border-left: 3px solid var(--cpe-red); font: 500 14px/1.45 var(--cpe-sans); color: var(--cpe-ink); }
.cpe-banner button { background: none; border: 0; font-size: 20px; line-height: 1; cursor: pointer; color: var(--cpe-mute); padding: 0 4px; }

/* ================================================================
 *  Empty-cart panel
 * ============================================================== */
.cpe-dz {
    position: relative;
    display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(28px, 5vw, 72px);
    max-width: 1080px; margin: 24px auto 48px; padding: clamp(28px, 4.2vw, 52px);
    background: #fff; border: 1px solid var(--cpe-hair);
    font-family: var(--cpe-sans); color: var(--cpe-ink); text-align: left;
}
.cpe-dz *, .cpe-dz *::before, .cpe-dz *::after { box-sizing: border-box; }
.cpe-dz > * { min-width: 0; }

.cpe-dz__title { margin: 0; font-family: var(--cpe-sans); font-weight: 700; font-size: clamp(28px, 3.2vw, 38px); line-height: 1.1; letter-spacing: -.025em; color: var(--cpe-navy); text-transform: none; }
.cpe-dz__lede { margin: 14px 0 26px; font-size: 16px; line-height: 1.6; color: var(--cpe-body); max-width: 38ch; }
.cpe-dz__points { list-style: none; margin: 0 0 26px; padding: 0; display: grid; gap: 12px; }
.cpe-dz__points li { display: flex; gap: 12px; align-items: flex-start; margin: 0; font-size: 14px; font-weight: 500; line-height: 1.45; color: var(--cpe-ink); }
.cpe-dz__points svg { flex: 0 0 16px; width: 16px; height: 16px; margin-top: 2px; color: var(--cpe-navy); }
.cpe-dz__help { margin: 0; padding-top: 20px; border-top: 1px solid var(--cpe-hair); font-size: 13.5px; line-height: 1.55; color: var(--cpe-mute); }
.cpe-dz__help a { color: var(--cpe-navy); font-weight: 600; text-decoration: none; white-space: nowrap; }
.cpe-dz__help a:hover { text-decoration: underline; }

/* Drop target, drawn as a Shaker door: outer frame + recessed panel. */
.cpe-dz__drop {
    display: block; margin: 0; padding: 14px; cursor: pointer;
    background: #fff; border: 1px solid var(--cpe-rule);
    transition: border-color .2s ease, box-shadow .2s ease;
}
.cpe-dz__panel {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    min-height: 212px; padding: 28px 22px; text-align: center;
    background: var(--cpe-tint);
    box-shadow: inset 0 0 0 1px var(--cpe-hair), inset 0 6px 14px -10px rgba(10, 36, 86, .18);
    transition: background-color .2s ease, box-shadow .2s ease;
}
.cpe-dz__icon { width: 40px; height: 48px; margin-bottom: 12px; color: var(--cpe-navy); transition: transform .25s cubic-bezier(.2,.8,.2,1); }
.cpe-dz__drop-title { font-size: 17px; font-weight: 600; letter-spacing: -.01em; color: var(--cpe-navy); }
.cpe-dz__drop-sub { font-size: 14px; color: var(--cpe-mute); }
.cpe-dz__drop-sub u { color: var(--cpe-navy); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

.cpe-dz__drop:hover { border-color: var(--cpe-navy); }
.cpe-dz__drop:hover .cpe-dz__icon { transform: translateY(-3px); }
.cpe-dz__drop:focus-visible { outline: 2px solid var(--cpe-navy); outline-offset: 3px; }
.cpe-dz.is-over .cpe-dz__drop { border-color: var(--cpe-navy); box-shadow: 0 0 0 1px var(--cpe-navy); }
.cpe-dz.is-over .cpe-dz__panel { background: #eaf0f9; box-shadow: inset 0 0 0 1px var(--cpe-navy); }
.cpe-dz.is-over .cpe-dz__icon { transform: translateY(-6px); }
.cpe-dz.is-busy .cpe-dz__drop { cursor: progress; }
.cpe-dz.is-busy .cpe-dz__arrow { animation: cpe-lift .9s ease-in-out infinite; }
@keyframes cpe-lift { 50% { transform: translateY(-4px); } }

.cpe-dz__or { margin: 24px 0 10px; font-size: 13.5px; font-weight: 500; color: var(--cpe-mute); }

.cpe-dz__row { display: flex; margin: 0; }
.cpe-dz__row input {
    flex: 1; min-width: 0; height: 50px; margin: 0; padding: 0 16px;
    font: 500 16px/1 var(--cpe-sans); letter-spacing: .02em; color: var(--cpe-ink);
    background: #fff; border: 1px solid var(--cpe-rule); border-right: 0; border-radius: 0; box-shadow: none;
}
.cpe-dz__code input { font-weight: 600; letter-spacing: .06em; }
.cpe-dz__row input::placeholder { color: var(--cpe-faint); font-weight: 400; letter-spacing: 0; }
.cpe-dz__row input:focus { outline: none; border-color: var(--cpe-navy); box-shadow: inset 0 0 0 1px var(--cpe-navy); }
.cpe-dz__row button, .cpe-btn {
    height: 50px; margin: 0; padding: 0 24px; border: 0; border-radius: 0; cursor: pointer;
    font: 600 15px/1 var(--cpe-sans); letter-spacing: 0; text-transform: none; white-space: nowrap;
    color: #fff; background: var(--cpe-navy); transition: background-color .2s ease;
}
.cpe-dz__row button:hover { background: var(--cpe-navy-2); color: #fff; }
.cpe-dz__row button:disabled { opacity: .55; cursor: default; }
.cpe-dz__resend { margin-top: 10px; }
.cpe-dz [hidden] { display: none !important; }
.cpe-dz__lost { display: inline-block; text-align: left; margin: 14px 0 0; padding: 0; background: none; border: 0; cursor: pointer; font: 500 13.5px/1.4 var(--cpe-sans); letter-spacing: 0; text-transform: none; color: var(--cpe-mute); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--cpe-rule); }
.cpe-dz__lost:hover { color: var(--cpe-navy); background: none; text-decoration-color: currentColor; }
.cpe-dz__msg { min-height: 1.2em; margin: 12px 0 0; font-size: 14px; line-height: 1.5; color: var(--cpe-body); }
.cpe-dz__msg.is-error { color: var(--cpe-red-d); }
.cpe-dz__msg.is-ok { color: var(--cpe-green); }

/* ── review ── */
.cpe-dz.is-review { grid-template-columns: 1fr; }
.cpe-dz.is-review .cpe-dz__intro { display: none; }
.cpe-rv-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding-bottom: 18px; border-bottom: 1px solid var(--cpe-navy); }
.cpe-rv-head__title { margin: 0; font-family: var(--cpe-sans); font-weight: 700; font-size: clamp(24px, 2.8vw, 32px); line-height: 1.1; letter-spacing: -.025em; color: var(--cpe-navy); text-transform: none; }
.cpe-rv-head__src { margin: 6px 0 0; font-size: 14px; color: var(--cpe-mute); }
.cpe-rv-head__count { margin: 0; text-align: right; font-size: 14px; color: var(--cpe-mute); line-height: 1.4; }
.cpe-rv-head__count b { font-size: 24px; font-weight: 700; letter-spacing: -.02em; color: var(--cpe-navy); margin-right: 2px; }
.cpe-rv-head__count span { display: block; color: var(--cpe-red-d); }

.cpe-rv-list { list-style: none; margin: 0; padding: 0; }
.cpe-rv { display: grid; grid-template-columns: 72px minmax(0, 1fr) 56px 120px; gap: 20px; align-items: start; margin: 0; padding: 18px 0; border-bottom: 1px solid var(--cpe-hair); }
.cpe-rv__media { width: 72px; height: 72px; background: #fff; border: 1px solid var(--cpe-hair); display: grid; place-items: center; overflow: hidden; }
.cpe-rv__media img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.cpe-rv__ph { width: 22px; height: 30px; border: 1px solid var(--cpe-rule); }
.cpe-rv__name { font-size: 15px; font-weight: 600; line-height: 1.35; color: var(--cpe-ink); }
.cpe-rv__meta { margin-top: 4px; font-size: 13px; color: var(--cpe-mute); }
.cpe-rv__meta i { font-style: normal; margin: 0 7px; color: var(--cpe-rule); }
.cpe-rv__sku { color: var(--cpe-body); font-weight: 500; }
.cpe-rv__meta strong { color: var(--cpe-navy); font-weight: 600; }
.cpe-rv__qty, .cpe-rv__price { padding-top: 1px; font-size: 15px; font-weight: 600; color: var(--cpe-ink); }
.cpe-rv__qty { text-align: center; }
.cpe-rv__price { text-align: right; }
.cpe-rv__price small { display: block; margin-top: 2px; font-size: 12px; font-weight: 400; color: var(--cpe-mute); }

.cpe-rv__choose, .cpe-rv__hinge { margin-top: 12px; }
.cpe-rv__ask { display: block; margin-bottom: 8px; font-size: 13.5px; font-weight: 500; line-height: 1.45; color: var(--cpe-ink); }
.cpe-segs { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--cpe-rule); }
.cpe-seg { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; margin: 0; padding: 10px 16px; min-width: 112px; border: 0; border-radius: 0; cursor: pointer; background: #fff; color: var(--cpe-ink); font: 600 13.5px/1.2 var(--cpe-sans); text-align: left; text-transform: none; letter-spacing: 0; }
.cpe-seg + .cpe-seg { border-left: 1px solid var(--cpe-rule); }
.cpe-seg small { font-size: 12px; font-weight: 400; color: var(--cpe-mute); }
.cpe-seg:hover { background: var(--cpe-tint); color: var(--cpe-ink); }
.cpe-seg[aria-pressed="true"] { background: var(--cpe-navy); color: #fff; }
.cpe-seg[aria-pressed="true"] small { color: #b9c6e0; }
.cpe-rv__split { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 13.5px; color: var(--cpe-ink); }
.cpe-rv__split b { min-width: 18px; text-align: center; }
.cpe-rv__split span { margin-left: 10px; }
.cpe-step { width: 32px; height: 32px; padding: 0; margin: 0; border: 1px solid var(--cpe-rule); border-radius: 0; background: #fff; color: var(--cpe-navy); font: 600 16px/1 var(--cpe-sans); cursor: pointer; }
.cpe-step:hover { border-color: var(--cpe-navy); background: #fff; color: var(--cpe-navy); }

.cpe-rv.is-pending { box-shadow: inset 3px 0 0 var(--cpe-red); padding-left: 16px; }
.cpe-rv.is-missing { opacity: .5; }
.cpe-rv__gone { margin-top: 6px; font-size: 13px; font-weight: 600; color: var(--cpe-red-d); }

.cpe-rv-foot { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding-top: 24px; }
.cpe-btn--primary { height: 54px; padding: 0 30px; background: var(--cpe-red); font-size: 15.5px; }
.cpe-btn--primary:hover:not(:disabled) { background: var(--cpe-red-d); color: #fff; }
.cpe-btn--primary:disabled { background: #c3c8d1; color: #fff; cursor: default; }
.cpe-btn--ghost { height: 54px; background: #fff; color: var(--cpe-navy); border: 1px solid var(--cpe-rule); }
.cpe-btn--ghost:hover { border-color: var(--cpe-navy); background: #fff; color: var(--cpe-navy); }
.cpe-dz.is-done .cpe-btn--primary { background: var(--cpe-green); }

/* ── responsive ── */
/* ── Hinge choice: same look as the hinge popup (rounded toggle, #2b6cb0) ── */
.cpe-dz .cpe-segs--hinge { border-color: #cbd5e0; border-radius: 6px; overflow: hidden; }
.cpe-dz .cpe-segs--hinge .cpe-seg { min-width: 0; padding: 9px 16px; font-size: 13px; }
.cpe-dz .cpe-segs--hinge .cpe-seg + .cpe-seg { border-left-color: #cbd5e0; }
.cpe-dz .cpe-segs--hinge .cpe-seg,
.cpe-dz .cpe-segs--hinge .cpe-seg:focus { background: #f7fafc !important; color: #4a5568 !important; }
.cpe-dz .cpe-segs--hinge .cpe-seg:hover { background: #ebf4ff !important; color: #2b6cb0 !important; }
.cpe-dz .cpe-segs--hinge .cpe-seg[aria-pressed="true"],
.cpe-dz .cpe-segs--hinge .cpe-seg[aria-pressed="true"]:hover,
.cpe-dz .cpe-segs--hinge .cpe-seg[aria-pressed="true"]:focus { background: #2b6cb0 !important; color: #fff !important; }
.cpe-dz .cpe-rv__split .cpe-step { border-radius: 6px; border-color: #cbd5e0; }

/* ── Pin every button state. The theme paints all button:hover / :focus pink
      (#c36); without !important that wins on hover and after a click. ── */
.cpe-dz button, .cpe-banner button, .cpe-veil button { box-shadow: none !important; text-decoration: none !important; }
.cpe-dz .cpe-dz__row button, .cpe-dz .cpe-dz__row button:focus { background: var(--cpe-navy) !important; color: #fff !important; }
.cpe-dz .cpe-dz__row button:hover { background: var(--cpe-navy-2) !important; color: #fff !important; }
.cpe-dz .cpe-btn--primary, .cpe-dz .cpe-btn--primary:focus { background: var(--cpe-red) !important; color: #fff !important; }
.cpe-dz .cpe-btn--primary:hover:not(:disabled) { background: var(--cpe-red-d) !important; color: #fff !important; }
.cpe-dz .cpe-btn--primary:disabled { background: #c3c8d1 !important; color: #fff !important; }
.cpe-dz.is-done .cpe-btn--primary { background: var(--cpe-green) !important; }
.cpe-dz .cpe-btn--ghost, .cpe-dz .cpe-btn--ghost:focus, .cpe-dz .cpe-btn--ghost:hover { background: #fff !important; color: var(--cpe-navy) !important; }
.cpe-dz .cpe-seg, .cpe-dz .cpe-seg:focus { background: #fff !important; color: var(--cpe-ink) !important; }
.cpe-dz .cpe-seg:hover { background: var(--cpe-tint) !important; color: var(--cpe-ink) !important; }
.cpe-dz .cpe-seg[aria-pressed="true"], .cpe-dz .cpe-seg[aria-pressed="true"]:hover, .cpe-dz .cpe-seg[aria-pressed="true"]:focus { background: var(--cpe-navy) !important; color: #fff !important; }
.cpe-dz .cpe-step, .cpe-dz .cpe-step:focus, .cpe-dz .cpe-step:hover { background: #fff !important; color: var(--cpe-navy) !important; }
.cpe-dz .cpe-dz__lost, .cpe-dz .cpe-dz__lost:focus, .cpe-dz .cpe-dz__lost:hover { background: none !important; }
.cpe-banner button, .cpe-banner button:hover, .cpe-banner button:focus { background: none !important; color: var(--cpe-mute) !important; }
.cpe-dz button:focus-visible { outline: 2px solid var(--cpe-navy); outline-offset: 2px; }

@media (max-width: 860px) {
    .cpe-dz { grid-template-columns: minmax(0, 1fr); margin: 16px 0 32px; }
    .cpe-dz__lede { max-width: none; }
    .cpe-dz__points { display: none; }
    .cpe-dz__help { display: none; }
    .cpe-dz__panel { min-height: 176px; }
}
@media (max-width: 560px) {
    .cpe-dz { padding: 26px 16px; border-left: 0; border-right: 0; }
    .cpe-rv { grid-template-columns: 56px minmax(0, 1fr) auto; gap: 14px; }
    .cpe-rv__media { width: 56px; height: 56px; }
    .cpe-rv__qty { grid-column: 3; grid-row: 1; }
    .cpe-rv__price { grid-column: 2 / -1; text-align: left; }
    .cpe-rv__price small { display: inline; margin-left: 6px; }
    .cpe-segs { display: flex; width: 100%; }
    .cpe-seg { flex: 1; min-width: 0; }
    .cpe-rv-head { flex-direction: column; align-items: flex-start; }
    .cpe-rv-head__count { text-align: left; }
    .cpe-btn--primary, .cpe-btn--ghost { width: 100%; }
    .cpe-dz__row button { padding: 0 18px; }
}
@media (prefers-reduced-motion: reduce) {
    .cpe-veil, .cpe-dz__drop, .cpe-dz__icon, .cpe-veil__bar i, .cpe-dz__arrow { transition: none !important; animation: none !important; }
}
