/* The pre-order page (Components/Pages/Orders/Preorder.razor), from the approved mockup docs/mockups/preorder-v1.html:
   the order form on the left, what you're paying for on the right. Stripe's card form and wallet buttons render in its
   own frames inside #payment and #express, styled through the Appearance settings in js/preorder.js. */
.po-hero { display: grid; gap: 1rem; padding-block: 2.5rem 1rem; position: relative; z-index: 1; }
.po-hero h1 { margin: 0; font-size: clamp(2.5rem, 8vw, 4.4rem); line-height: 0.98; }
.po-hero h1 .up { color: var(--cream);
    text-shadow: 4px 0 0 var(--ink), -4px 0 0 var(--ink), 0 4px 0 var(--ink), 0 -4px 0 var(--ink),
                 4px 4px 0 var(--ink), -4px 4px 0 var(--ink), 4px -4px 0 var(--ink), -4px -4px 0 var(--ink); }
.po-hero .lead { max-width: 36rem; }
.po-grid { display: grid; gap: 1.5rem; padding-block: 1.5rem 4rem; align-items: start; position: relative; z-index: 1; }
.po-plate { display: grid; gap: 1.1rem; padding: 1.4rem 1.3rem 1.5rem; border: 4px solid var(--ink); background: var(--cream);
    box-shadow: inset 5px 5px 0 var(--white), inset -5px -5px 0 var(--cream-dark); color: var(--ink); }
.po-plate h2 { display: flex; align-items: center; gap: 0.7rem; margin: 0; font-family: var(--font-display); font-size: 1.6rem; line-height: 1.05; }
.po-plate h2 .num { width: 1.9rem; height: 1.9rem; font-size: 1.05rem; }
.po-form { display: grid; gap: 1.25rem; min-width: 0; }
.fields { display: grid; gap: 0.9rem; }
.fields .two { display: grid; gap: 0.9rem; }
.field { display: grid; gap: 0.35rem; min-width: 0; align-content: start; }
.field label { font-weight: 600; }
.field .hint { font-size: 0.9rem; color: var(--ink-soft); }
.field input, .field select { width: 100%; min-width: 0; padding: 0.7rem 0.75rem; border: 3px solid var(--ink); background: var(--white);
    font: inherit; color: var(--ink); border-radius: 0; }
.field select { appearance: none; padding-right: 2.2rem; background-color: var(--white);
    background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(-45deg, transparent 50%, var(--ink) 50%);
    background-position: right 1.1rem top 55%, right 0.75rem top 55%; background-size: 0.45rem 0.45rem; background-repeat: no-repeat; }
.qty { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.stepper { display: inline-flex; align-items: stretch; border: 3px solid var(--ink); background: var(--white); }
.stepper button { width: 2.8rem; border: 0; background: #C9CDD2; font: 700 1.4rem var(--font-body); color: var(--ink); cursor: pointer;
    box-shadow: inset 3px 3px 0 var(--white), inset -3px -3px 0 #8A9097; }
.stepper button:disabled { opacity: 0.45; cursor: default; }
.stepper output { display: grid; place-items: center; min-width: 3.2rem; font-family: var(--font-body); font-size: 1.4rem; font-weight: 700; }
.qty p { margin: 0; color: var(--ink-soft); max-width: 22rem; }

.stripe { display: grid; gap: 0.9rem; }
.wallet-note { margin: 0; font-size: 0.88rem; color: var(--ink-soft); }
.coupon { display: grid; gap: 0.5rem; }
.coupon-row { display: flex; gap: 0.5rem; }
.coupon-row input { flex: 1; min-width: 0; padding: 0.6rem 0.7rem; border: 3px solid var(--ink); background: var(--white); font: inherit; text-transform: uppercase; }
.coupon-row .btn { min-height: 0; padding: 0.6rem 0.9rem; }
.coupon-msg { margin: 0; font-size: 0.92rem; font-weight: 600; }
.coupon-msg.ok { color: var(--bonus); } .coupon-msg.bad { color: var(--fine-dark); }
.lines .discount dd { color: var(--bonus); }
.or { display: flex; align-items: center; gap: 0.75rem; color: var(--ink-soft); font-size: 0.9rem; }
.or::before, .or::after { content: ""; flex: 1; height: 3px; background: var(--cream-dark); }
.secure { display: flex; align-items: center; gap: 0.55rem; margin: 0; font-size: 0.92rem; color: var(--ink-soft); }
.secure::before { content: ""; width: 0.9rem; height: 0.75rem; margin-top: 0.15rem; border: 3px solid var(--ink-soft); border-top-width: 0;
    box-shadow: 0 -0.45rem 0 -0.15rem transparent; background: linear-gradient(var(--ink-soft), var(--ink-soft)) center / 3px 40% no-repeat; flex: none; }
.pay { display: grid; gap: 0.75rem; }
.pay .btn { width: 100%; justify-content: center; font-size: 1.2rem; min-height: 3.6rem; }
.pay .fine-print { text-align: center; }

.summary { display: grid; gap: 1.1rem; }
.summary-art { display: flex; justify-content: center; padding: 1.25rem 0 0.5rem; border: 4px solid var(--ink); background: var(--sky-lo);
    box-shadow: inset 4px 4px 0 var(--sky-mid), inset -4px -4px 0 #7FC3EE; }
.summary-art .brick { --s: 3; }
.lines { display: grid; gap: 0.55rem; margin: 0; }
.lines div { display: flex; justify-content: space-between; gap: 1rem; }
.lines dt { min-width: 0; }
.lines dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lines .total { margin-top: 0.3rem; padding-top: 0.7rem; border-top: 3px solid var(--ink); font-size: 1.25rem; }
.lines .total dd { font-weight: 700; }
.summary .ticks { font-size: 1rem; }
.summary .ticks .sprite { --s: 3; }

@media (min-width: 700px) {
    .fields .two { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 980px) {
    .po-grid { grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.9fr); gap: 2rem; }
    .summary-col { position: sticky; top: 1.5rem; }
}

/* States the script sets */
#express:empty { display: none; }
.express-wrap[hidden] { display: none; }
.pay-error, .field-error { color: var(--fine-dark); font-weight: 600; }
.pay-error { margin: 0; padding: 0.65rem 0.8rem; border: 3px solid var(--fine-dark); background: #FBE3E0; }
.pay-error[hidden], .field-error[hidden] { display: none; }
.field.bad input, .field.bad select { border-color: var(--fine-dark); background: #FFF6F5; }
.field-error { font-size: 0.92rem; }
.btn[aria-busy="true"]::before { content: ""; width: 1rem; height: 1rem; margin-right: 0.6rem; border: 3px solid var(--ink);
    border-right-color: transparent; border-radius: 50%; animation: po-spin 0.8s linear infinite; }
@keyframes po-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .btn[aria-busy="true"]::before { animation: none; } }
.closed-note { margin: 0; padding: 0.6rem 0.8rem; border: 3px dashed var(--ink); background: var(--gold-light); font-weight: 600; max-width: 36rem; }
/* An admin on the Stripe Test switch: their own order goes through Stripe's test mode. */
.test-note { margin-top: 0.6rem; background: #D6ECFB; }
.noscript { margin: 0; padding: 0.65rem 0.8rem; border: 3px solid var(--ink); background: var(--cream); font-weight: 600; }
.coupon-remove { padding: 0; border: 0; background: none; color: var(--ink-soft); font: inherit; text-decoration: underline; cursor: pointer; }

/* ---- Shipping: Aramex's prices for the address (mockup docs/mockups/shipping-v1.html) ---- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ship { display: grid; gap: 0.6rem; padding-top: 0.4rem; border-top: 3px solid var(--cream-dark); }
.ship h3 { margin: 0.4rem 0 0; font-size: 1.1rem; }
.ship-wait { margin: 0; padding: 0.6rem 0.8rem; border: 3px dashed var(--ink-soft); font-weight: 600; color: var(--ink-soft); }
.ship-wait.asking::before { content: ""; display: inline-block; width: 0.7rem; height: 0.7rem; margin-right: 0.55rem; background: var(--ink-soft);
    animation: ship-blink 0.8s steps(2, start) infinite; }
@keyframes ship-blink { to { visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .ship-wait.asking::before { animation: none; } }
.ship-options { display: grid; gap: 0.6rem; margin: 0; padding: 0; border: 0; min-width: 0; }
.ship-option { display: grid; grid-template-columns: auto 1fr auto; gap: 0.15rem 0.8rem; align-items: center; padding: 0.8rem 0.9rem;
    border: 3px solid var(--ink); background: var(--white); cursor: pointer; }
.ship-option input { grid-row: 1 / span 2; width: 1.25rem; height: 1.25rem; margin: 0; accent-color: var(--ink); }
.ship-option .name { font-weight: 700; }
.ship-option .days { grid-column: 2; font-size: 0.92rem; color: var(--ink-soft); }
.ship-option .price { grid-row: 1 / span 2; grid-column: 3; font-weight: 700; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.ship-option:has(input:checked) { background: var(--gold-light); box-shadow: inset 4px 4px 0 var(--white); }
.ship-option:focus-within { outline: 3px solid var(--ink); outline-offset: 2px; }
.ship-note { margin: 0; font-size: 0.9rem; color: var(--ink-soft); }
.ship-error { display: grid; gap: 0.6rem; justify-items: start; margin: 0; padding: 0.7rem 0.85rem; border: 3px solid var(--fine-dark);
    background: var(--fine-wash); color: var(--fine-dark); font-weight: 600; }
.ship-error .btn { min-height: 0; padding: 0.45rem 0.9rem; }
.pay .btn:disabled { opacity: 0.5; cursor: default; }
/* The page's own display rules (grid, flex) would otherwise beat the hidden attribute. */
.po-grid [hidden] { display: none !important; }
