/* Photo order form + review page. Scoped under .of so other pages are untouched. */
.of {
	--of-ink: #1d2433;
	--of-muted: #5d6677;
	--of-line: #dde2ea;
	--of-bg: #f5f7fa;
	--of-card: #ffffff;
	--of-accent: #0b5cad;
	--of-accent-ink: #ffffff;
	--of-accent-soft: #e7f0fb;
	--of-ok: #1f7a4d;
	--of-err: #b3261e;
	--of-err-soft: #fdecea;
	--of-radius: 12px;
	color: var(--of-ink);
	max-width: 1040px;
	padding: 0 16px 140px;
	font-size: 16px;
	line-height: 1.5;
}
.of *, .of *::before, .of *::after { box-sizing: border-box; }

/* Header + steps */
.of-head { padding: 28px 0 8px; }
.of-title { font-size: 1.9rem; font-weight: 700; margin: 0 0 12px; }
.of-sport { display: inline-block; margin-left: 8px; padding: 2px 10px; border-radius: 999px; background: var(--of-accent-soft); color: var(--of-accent); font-size: .95rem; font-weight: 600; vertical-align: middle; }
.of-steps { display: flex; gap: 8px; list-style: none; padding: 0; margin: 0; counter-reset: s; flex-wrap: wrap; }
.of-steps li { counter-increment: s; color: var(--of-muted); font-size: .9rem; display: flex; align-items: center; gap: 6px; }
.of-steps li::before { content: counter(s); width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--of-line); display: inline-flex; align-items: center; justify-content: center; font-size: .75rem; }
.of-steps li + li::after { content: none; }
.of-steps li:not(:last-child) { margin-right: 10px; }
.of-steps .is-current { color: var(--of-ink); font-weight: 600; }
.of-steps .is-current::before { background: var(--of-accent); border-color: var(--of-accent); color: var(--of-accent-ink); }
.of-steps .is-done::before { content: "\2713"; background: var(--of-ok); border-color: var(--of-ok); color: #fff; }

/* Price strip */
.of-prices { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 20px; }
.of-price-chip { background: var(--of-card); border: 1px solid var(--of-line); border-radius: 10px; padding: 8px 12px; display: flex; flex-direction: column; min-width: 92px; }
.of-price-chip strong { font-size: 1.15rem; }
.of-price-chip span { font-size: .8rem; color: var(--of-muted); }
.of-price-chip--alt { background: var(--of-bg); }
.of-prices-note { flex-basis: 100%; margin: 4px 0 0; font-size: .85rem; color: var(--of-muted); }

/* Cards */
.of-card { background: var(--of-card); border: 1px solid var(--of-line); border-radius: var(--of-radius); padding: 20px; margin-bottom: 18px; }
.of-h2 { font-size: 1.25rem; font-weight: 700; margin: 0 0 14px; display: flex; align-items: center; gap: 10px; }
.of-num { width: 28px; height: 28px; border-radius: 50%; background: var(--of-accent); color: var(--of-accent-ink); display: inline-flex; align-items: center; justify-content: center; font-size: .9rem; }
.of-h3 { font-size: 1.05rem; font-weight: 700; margin: 22px 0 10px; }
.of-sub { color: var(--of-muted); margin: -4px 0 14px; font-size: .95rem; }
.of-subcard { margin-top: 16px; padding: 16px; border: 1px dashed var(--of-accent); border-radius: 10px; background: var(--of-accent-soft); }
.of-subcard .of-h3 { margin-top: 0; }

/* Fields */
.of-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.of-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.of-span-2 { grid-column: span 2; }
.of-field { display: flex; flex-direction: column; gap: 4px; margin: 0; font-size: .9rem; font-weight: 600; }
.of-field small { font-weight: 400; color: var(--of-muted); }
.of-field input, .of-field select {
	font: inherit; font-weight: 400; font-size: 1rem; padding: 10px 12px; min-height: 44px;
	border: 1px solid #c3cad6; border-radius: 8px; background: #fff; color: var(--of-ink); width: 100%;
}
.of-field input:focus, .of-field select:focus { outline: 2px solid var(--of-accent); outline-offset: 1px; border-color: var(--of-accent); }
.of-field.is-invalid input, .of-field.is-invalid select { border-color: var(--of-err); background: var(--of-err-soft); }

/* Products */
.of-products { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.of-product { display: flex; gap: 14px; padding: 12px; border: 1.5px solid var(--of-line); border-radius: 12px; background: #fff; transition: border-color .15s, background .15s; }
.of-product.is-selected { border-color: var(--of-accent); background: var(--of-accent-soft); }
.of-thumb { flex: 0 0 112px; height: 112px; padding: 0; border: 0; border-radius: 8px; overflow: hidden; background: var(--of-bg); cursor: zoom-in; }
.of-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.of-thumb--icon { display: flex; align-items: center; justify-content: center; cursor: default; }
.of-thumb--icon span { font-weight: 700; color: var(--of-accent); border: 2px solid var(--of-accent); border-radius: 6px; padding: 6px 8px; }
.of-product-body { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.of-product-name { font-weight: 700; line-height: 1.3; }
.of-product-price { color: var(--of-muted); font-size: .9rem; margin: 2px 0 6px; }
.of-link { align-self: flex-start; background: none; border: 0; padding: 0; color: var(--of-accent); text-decoration: underline; font-size: .85rem; margin-bottom: 6px; cursor: pointer; }
.of-stepper { margin-top: auto; display: inline-flex; align-items: stretch; align-self: flex-start; border: 1px solid #c3cad6; border-radius: 10px; overflow: hidden; background: #fff; }
.of-step { width: 44px; height: 44px; border: 0; background: #fff; font-size: 1.35rem; line-height: 1; color: var(--of-accent); cursor: pointer; }
.of-step:hover { background: var(--of-accent-soft); }
.of-step:disabled { color: #b8bfcc; cursor: default; background: #fff; }
.of-qty { width: 48px; border: 0; border-left: 1px solid #e3e7ee; border-right: 1px solid #e3e7ee; text-align: center; font: inherit; font-weight: 700; font-size: 1.05rem; -moz-appearance: textfield; }
.of-qty::-webkit-outer-spin-button, .of-qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Notes + alerts */
.of-note { background: #fff8e1; border: 1px solid #f1d27a; border-radius: 10px; padding: 12px 14px; font-size: .95rem; }
.of-alert { border-radius: 10px; padding: 12px 16px; margin: 0 0 18px; }
.of-alert ul { margin: 6px 0 0; padding-left: 20px; }
.of-alert--error { background: var(--of-err-soft); border: 1px solid #f3b8b3; color: #6e1a15; }

/* Sticky total bar */
.of-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030; background: #fff; border-top: 1px solid var(--of-line); box-shadow: 0 -6px 20px rgba(20, 30, 50, .08); }
.of-bar-inner { max-width: 1040px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.of-bar-total { font-size: 1.05rem; }
.of-bar-total span { color: var(--of-muted); }
.of-bar-total strong { font-size: 1.5rem; }
.of-bar-detail { font-size: .85rem; color: var(--of-muted); }
.of-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 0 22px; border: 0; border-radius: 10px; background: var(--of-accent); color: var(--of-accent-ink); font-weight: 700; font-size: 1.05rem; cursor: pointer; text-decoration: none; white-space: nowrap; }
.of-btn:hover { background: #094c8f; color: #fff; text-decoration: none; }
.of-btn--ghost { background: #fff; color: var(--of-accent); border: 1.5px solid var(--of-accent); }
.of-btn--ghost:hover { background: var(--of-accent-soft); color: var(--of-accent); }

/* Image preview. Bootstrap 4 beta sets dialog{display:block}, which would leave a closed dialog on the page. */
.of-dialog:not([open]) { display: none; }
.of-dialog { border: 0; border-radius: 12px; padding: 16px; max-width: min(92vw, 900px); }
.of-dialog::backdrop { background: rgba(15, 20, 30, .7); }
.of-dialog h3 { font-size: 1.1rem; margin: 0 36px 10px 0; }
.of-dialog img { display: block; max-width: 100%; max-height: 78vh; margin: 0 auto; }
.of-dialog-close { position: absolute; top: 8px; right: 10px; border: 0; background: none; font-size: 1.8rem; line-height: 1; cursor: pointer; color: var(--of-muted); }

/* Review page */
.of-review-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.of-dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; margin: 0; }
.of-dl dt { color: var(--of-muted); font-weight: 400; }
.of-dl dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.of-lines { width: 100%; border-collapse: collapse; }
.of-lines td { padding: 8px 0; border-bottom: 1px solid var(--of-line); vertical-align: top; }
.of-lines td:last-child { text-align: right; white-space: nowrap; padding-left: 12px; }
.of-lines .of-qtycol { width: 44px; color: var(--of-muted); }
.of-lines .of-subtotal td { font-weight: 600; background: var(--of-bg); padding-left: 8px; padding-right: 8px; }
.of-lines .of-small { font-size: .85rem; color: var(--of-muted); font-weight: 400; }
.of-grand { display: flex; justify-content: space-between; align-items: baseline; font-size: 1.1rem; margin-top: 14px; }
.of-grand strong { font-size: 1.6rem; }
.of-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: space-between; margin-top: 18px; }

@media (max-width: 767px) {
	.of { padding-bottom: 150px; }
	.of-title { font-size: 1.5rem; }
	.of-grid, .of-grid--4, .of-products, .of-review-grid { grid-template-columns: minmax(0, 1fr); }
	.of-span-2 { grid-column: auto; }
	.of-card { padding: 16px; }
	.of-thumb { flex-basis: 92px; height: 92px; }
	.of-bar-total strong { font-size: 1.3rem; }
	.of-btn { padding: 0 16px; }
}
@media print {
	.of-bar, .of-steps, .of-prices, nav, .navbar { display: none !important; }
	.of { padding-bottom: 0; }
}

/* Receipt */
.of-receipt .of-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.of-status { border-radius: var(--of-radius); padding: 16px 20px; margin: 8px 0 14px; border: 2px solid; }
.of-status-main { font-size: 1.15rem; font-weight: 700; letter-spacing: .02em; }
.of-status-main strong { font-size: 1.6rem; margin-left: 8px; }
.of-status ul { margin: 8px 0 0; padding-left: 20px; }
.of-status--paid { border-color: var(--of-ok); background: #e8f5ee; color: #13482e; }
.of-status--due { border-color: #c77700; background: #fff4e0; color: #5a3600; }
.of-status--unpaid { border-color: var(--of-line); background: var(--of-bg); display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.of-office { background: #d9dde3; font-size: 1.4rem; font-weight: 700; padding: 10px 16px; border-radius: 8px; margin-bottom: 14px; font-family: Consolas, "Courier New", monospace; }
@media print {
	.of-noprint { display: none !important; }
	.of-receipt { max-width: none; font-size: 12pt; }
	.of-receipt .of-card { break-inside: avoid; border-color: #999; }
	.of-status, .of-office { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
	footer, .container > .row > .col.mt-5 { display: none; }
}

/* Trader card units switch */
.of-units { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin: 0 0 12px; font-size: .95rem; }
.of-units span { color: var(--of-muted); }
.of-units label { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 600; cursor: pointer; }
.of-units input { width: 18px; height: 18px; }
.of-field[hidden] { display: none; }

/* Payment page */
.of-pay-grid { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
.of-check { display: flex; gap: 10px; align-items: flex-start; margin: 16px 0; font-size: .95rem; font-weight: 400; cursor: pointer; }
.of-check input { width: 20px; height: 20px; margin-top: 2px; flex: 0 0 auto; }
.of-btn--block { width: 100%; }
.of-btn:disabled { opacity: .65; cursor: progress; }
.of-cash { background: #fffaf0; border-color: #f1d27a; }
@media (max-width: 767px) { .of-pay-grid { grid-template-columns: minmax(0, 1fr); } }

/* Receipt: reorder marker next to the office code */
.of-office { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.of-office-tag { font-family: inherit; font-size: 1rem; font-weight: 700; letter-spacing: .03em; color: #fff; background: #b3261e; border-radius: 6px; padding: 4px 10px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
@media print { .of-office-tag { border: 2px solid #b3261e; } }

/* ---- Receipt: one printed page -------------------------------------------------------- */
.of-printonly { display: none; }
@media print {
	@page { size: letter; margin: 12mm; }
	/* Blank 2" band at the top of page 1 for the office's barcode label. */
	@page :first { margin-top: 2in; }
	/* Print only the receipt: hide the site menu, footer, seal and scripts around it. */
	body:has(.of-receipt) > :not(.of-receipt) { display: none !important; }
	body:has(.of-receipt) { background: #fff; }
	.of-receipt { font-size: 10pt; line-height: 1.3; padding: 0 !important; margin: 0; max-width: none; width: auto; }
	.of-receipt .of-card { padding: 6px 10px; margin: 0 0 6px; border-radius: 6px; border: 1px solid #999; break-inside: avoid; }
	.of-receipt .of-h2 { font-size: 11.5pt; margin: 0 0 4px; gap: 6px; }
	.of-receipt .of-dl { gap: 1px 10px; }
	.of-receipt .of-small { font-size: 8.5pt; }
	/* Sections 1+2 and 3+4 side by side (a lone section takes the full width). */
	.of-rc-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 0 8px; align-items: stretch; break-inside: avoid; }
	.of-rc-pair > .of-card, .of-rc-pair > .of-status, .of-rc-pair > .of-office { margin-bottom: 6px; }
	.of-receipt .of-status { padding: 6px 10px; margin: 0; border-width: 1.5px; border-radius: 6px; }
	.of-receipt .of-status-main { font-size: 11pt; }
	.of-receipt .of-status-main strong { font-size: 13pt; margin-left: 4px; }
	.of-receipt .of-status--due ul { display: none; }
	.of-receipt .of-printonly { display: block; margin: 3px 0 0; font-size: 9pt; }
	.of-receipt .of-office { font-size: 11pt; padding: 6px 10px; margin: 0; border-radius: 6px; flex-direction: column; align-items: flex-start; gap: 4px; justify-content: center; }
	.of-receipt .of-office-tag { font-size: 9pt; padding: 2px 6px; }
	.of-receipt .of-lines td { padding: 2px 0; }
	.of-receipt .of-lines .of-subtotal td { padding: 2px 6px; }
	.of-receipt .of-grand { margin-top: 4px; font-size: 10.5pt; }
	.of-receipt .of-grand strong { font-size: 13pt; }
}

/* Association has paid for a Combo for every player */
.of-combo-note { background: #e8f5ee; border: 1px solid #9fd3b6; color: #13482e; margin: 0; font-size: .95rem; }
.of-free-tag { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--of-ok); color: #fff; font-size: .75rem; font-weight: 700; vertical-align: middle; }
.of-free-tag[hidden] { display: none; }
