/* AC Appointments - gift voucher purchase form. */
/* ACSD - A theme's own form rules are loaded before this and often
   carry !important, so the handful of properties that decide the
   layout are forced here. Everything else is left to the theme, so
   the form still looks like the site it sits on. */

/* ACSD - Two columns: the card as it will arrive on the left, the order on
   the right. A voucher is bought for somebody else and the buyer never sees
   what they paid for - showing it is what finishes the sale. Below 860px
   the preview goes on top, where a phone can still see it before scrolling
   into the form. */
.ac-voucher-shop { display: grid !important; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 36px; align-items: start; max-width: 1100px; font-size: 16px; }
.ac-voucher-shop .ac-voucher-form { min-width: 0; }
@media (max-width: 860px) { .ac-voucher-shop { grid-template-columns: 1fr !important; gap: 24px; } }

/* ── The preview ──────────────────────────────────────────── */
/* ACSD - The card as the old shop showed it: the photo on top, the name of
   the voucher and its value side by side under it, then who it is from, who
   it is for and the message - filled in as the buyer types. */
.ac-voucher-preview { position: sticky; top: 24px; }
@media (max-width: 860px) { .ac-voucher-preview { position: static; } }
.ac-voucher-card { overflow: hidden; border: 1px solid #e3e7ec; border-radius: 10px; background: #fff; }
.ac-voucher-photo { display: block; width: 100%; height: auto; margin: 0; }
.ac-voucher-card-body { padding: 26px 30px 30px; }
.ac-voucher-card-top { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding-bottom: 18px; border-bottom: 1px solid #e3e7ec; }
.ac-voucher-card-title { font-size: 19px; line-height: 1.3; color: #3b3f45; }
.ac-voucher-card-value { flex: 0 0 auto; font-size: 19px; font-weight: 500; color: var(--ac-voucher-accent); white-space: nowrap; }
.ac-voucher-card-lines { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 8px; margin: 18px 0 0 !important; font-size: 17px; }
.ac-voucher-card-lines > div { display: contents; }
.ac-voucher-card-lines > div[hidden] { display: none; }
.ac-voucher-card-lines dt { margin: 0; font-weight: 700; color: #3b3f45; }
/* ACSD - a name is whatever the buyer typed, and a long one must wrap
   inside the card rather than push the card wider than its column. */
.ac-voucher-card-lines dd { margin: 0; color: var(--ac-voucher-accent); overflow-wrap: anywhere; }
.ac-voucher-preview-note { margin: 12px 0 0 !important; font-size: 13px; opacity: .7; }

/* ── The form ─────────────────────────────────────────────── */
.ac-voucher-shop fieldset { border: 0 !important; padding: 0 !important; margin: 0 0 18px !important; }
.ac-voucher-shop legend { float: none !important; width: auto !important; padding: 0 !important; margin: 0 0 8px !important; font-size: 16px; font-weight: 700; }
.ac-voucher-chips { display: flex !important; flex-wrap: wrap !important; gap: 10px !important; }
.ac-voucher-amount { display: inline-flex !important; align-items: center; gap: 8px; width: auto !important; margin: 0 !important; padding: 10px 16px; border: 1px solid #d7d7d7; border-radius: 10px; line-height: 1.25; cursor: pointer; }
/* ACSD - more specific than the field-label rule below, which gave every
   label > span a 3px bottom margin: inside a chip that pushed the text
   1.5px above the radio, which is just enough to look wrong. */
.ac-voucher-shop .ac-voucher-amount > span { display: inline-flex !important; flex-direction: column; margin: 0 !important; font-size: 16px; }
.ac-voucher-shop .ac-voucher-amount > span strong { font-weight: 700; }
/* ACSD - what the amount buys, under the amount. A buyer looking at a bare
   "380" cannot tell an hour from two, and leaves. */
.ac-voucher-shop .ac-voucher-amount > span small { font-size: 13px; font-weight: 400; opacity: .75; }
/* ACSD - a theme that sets input { width: 100% } reaches the radio
   inside the chip too, and squeezes the price onto two lines. */
.ac-voucher-amount input[type="radio"] { width: auto !important; flex: 0 0 auto !important; margin: 0 !important; padding: 0 !important; }
.ac-voucher-amounts .ac-voucher-amount > span strong { white-space: nowrap; }
/* ACSD - the amounts in a grid of their own, not a loose wrap: with a line of
   words under each one, flex left the last row ragged and the "other amount"
   button looking like an afterthought rather than a choice. */
.ac-voucher-amounts .ac-voucher-chips { display: grid !important; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); align-items: stretch; }
.ac-voucher-amounts .ac-voucher-amount { justify-content: flex-start; }
.ac-voucher-amounts .ac-voucher-amount.has-note { align-items: flex-start; }
.ac-voucher-amount:has(input[type="radio"]:checked) { border-color: var(--ac-voucher-accent); box-shadow: inset 0 0 0 1px var(--ac-voucher-accent); }
.ac-voucher-custom { width: 140px !important; margin: 0 !important; padding: 10px 14px !important; border: 1px solid #d7d7d7; border-radius: 10px; font: inherit; font-size: 16px; }
.ac-voucher-custom[hidden] { display: none !important; }

.ac-voucher-row { display: flex !important; flex-wrap: wrap !important; gap: 14px !important; margin-bottom: 14px; }
.ac-voucher-row > label { flex: 1 1 200px !important; margin: 0 !important; }
.ac-voucher-block { display: block !important; margin: 0 0 14px !important; }
.ac-voucher-shop label > span { display: block !important; margin: 0 0 5px !important; font-size: 15px; line-height: 1.35; }
.ac-voucher-shop input[type="text"],
.ac-voucher-shop input[type="email"],
.ac-voucher-shop input[type="tel"],
.ac-voucher-shop input[type="number"]:not(.ac-voucher-custom),
.ac-voucher-shop textarea { width: 100% !important; box-sizing: border-box !important; margin: 0 !important; padding: 11px 14px !important; border: 1px solid #d7d7d7; border-radius: 10px; font: inherit; font-size: 16px; line-height: 1.35; }
.ac-voucher-shop textarea { min-height: 0 !important; }
.ac-voucher-note { margin: 0 0 16px !important; font-size: 13px; opacity: .7; }
.ac-voucher-submit { margin: 0 !important; padding: 15px 38px !important; border: 0; border-radius: 999px; background: var(--ac-voucher-accent); color: #fff; font: inherit; font-size: 17px; font-weight: 600; cursor: pointer; }
.ac-voucher-submit[disabled] { opacity: .6; cursor: default; }
.ac-voucher-error { color: #b32d2e; margin: 12px 0 0 !important; font-size: 15px; }
.ac-voucher-done { grid-column: 1 / -1; }
.ac-voucher-done h3 { margin-top: 0; }
@media (max-width: 480px) { .ac-voucher-row > label { flex: 1 1 100% !important; } .ac-voucher-card-value { font-size: 32px; } }

/* ACSD - pay at the practice / by card */
.ac-voucher-pay { margin: 0 0 16px; padding: 0; border: 0; }
/* ACSD - [ac_gift_voucher buton="..."]: the form in a pop-up */
.ac-voucher-open { cursor: pointer; }
.ac-voucher-dialog { width: min(980px, calc(100vw - 24px)); max-height: calc(100vh - 24px); padding: 28px 22px 22px; border: 0; border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.25); overflow: auto; }
.ac-voucher-dialog::backdrop { background: rgba(0,0,0,.55); }
.ac-voucher-close { position: sticky; top: 0; float: right; z-index: 2; width: 38px; height: 38px; margin: -14px -8px 0 0; padding: 0; border: 0; border-radius: 50%; background: #f1f1f1; color: #222; font-size: 24px; line-height: 38px; cursor: pointer; }
