/* UK Imports demo — order sheet + stockist box styling.
   Presentation only (plugin logic untouched) — restyled mesh-plan phase 2,
   item 1, to match the uki theme's design language rather than a generic
   striped-table look. Reads the theme's CSS custom properties (--navy,
   --red, etc. — defined in style.css :root, loaded site-wide) so this stays
   in lockstep with the rest of the site instead of hardcoding a second copy
   of the palette. Falls back to the literal hex values if those custom
   properties are ever unavailable (e.g. theme swapped without the plugin
   being touched). */

.uki-order-sheet {
	margin: 0;
}

/* Anchor targets (#p-<id> deep links from the admin panel) land BELOW the
   sticky site header instead of underneath it. */
table.uki-order-grid tr {
	scroll-margin-top: 100px;
}

table.uki-order-grid {
	width: 100%;
	border-collapse: collapse;
	font-family: 'Inter', system-ui, sans-serif;
	font-size: 0.95em;
	background: #fff;
	border: 1px solid var(--line, #e0d6c0);
	border-radius: 4px;
	overflow: hidden;
}

table.uki-order-grid thead th {
	background: var(--navy, #0d1f3c);
	color: #fff;
	text-align: left;
	padding: 0.75em 0.9em;
	font-weight: 600;
	font-size: 0.78rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

table.uki-order-grid tbody td {
	padding: 0.65em 0.9em;
	border-bottom: 1px solid var(--line, #e0d6c0);
	vertical-align: middle;
}

table.uki-order-grid tbody tr:last-child td {
	border-bottom: none;
}

table.uki-order-grid tbody tr:nth-child(even) {
	background: var(--cream, #f6efe2);
}

table.uki-order-grid tbody tr:hover {
	background: var(--cream-2, #efe6d4);
}

/* Round-4, item 1: the table was never actually narrower than 100% of its
   parent — the real constraint was the *page* container (page.php now uses
   .wrap-order, ~1160px, for the order-form page instead of the shared
   820px prose width). With that room available, give the fixed-content
   columns (badge, price, pack size, UPC, qty) a sensible width and stop
   them wrapping, so the Product column gets the rest of the space instead
   of everything fighting for a cramped 820px. */
td.uki-thumb {
	width: 68px;
}

.uki-col-name {
	width: auto;
}

.uki-col-pack,
.uki-col-upc,
.uki-col-price,
.uki-col-stock,
.uki-col-qty {
	white-space: nowrap;
}

.uki-col-pack {
	width: 12%;
}

.uki-col-upc {
	width: 11%;
}

.uki-col-price {
	width: 9%;
	font-weight: 600;
	color: var(--navy, #0d1f3c);
}

.uki-col-stock {
	width: 11%;
}

.uki-col-qty {
	width: 7%;
}

.uki-thumb-img {
	width: 60px;
	height: 60px;
	object-fit: contain;
	background: #fff;
	border: 1px solid var(--line, #e0d6c0);
	border-radius: 4px;
	display: block;
}

.uki-badge {
	display: inline-block;
	padding: 0.2em 0.65em;
	border-radius: 3px;
	font-size: 0.78rem;
	font-weight: 600;
	letter-spacing: 0.02em;
}

.uki-badge.uki-in {
	background: #e5f4e5;
	color: #1e7a1e;
}

.uki-badge.uki-out {
	background: #fbe4e6;
	color: var(--red, #b1202c);
}

table.uki-order-grid input[type="number"] {
	width: 4.5em;
	padding: 0.4em 0.5em;
	border: 1.5px solid var(--line, #e0d6c0);
	border-radius: 3px;
	font-family: inherit;
	font-size: 1em;
}

table.uki-order-grid input[type="number"]:focus {
	outline: none;
	border-color: var(--navy, #0d1f3c);
}

table.uki-order-grid input[type="number"]:disabled {
	background: #f0f0f0;
	color: #999;
	border-color: #e2e2e2;
}

/* Sticky submit bar — rides the viewport bottom while the (tall) order form
   is on screen, settles into its natural end-of-form position once you reach
   it, so it never covers the site footer. Requires the form itself to never
   be an overflow container (the mobile x-scroll lives on .uki-order-scroll,
   around the table only). Opaque background: table rows scroll beneath it. */
.uki-order-submit-bar {
	position: sticky;
	bottom: 0;
	z-index: 20;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1.1em;
	margin-top: 1em;
	padding: 0.8em 1.1em;
	background: #fff;
	border-top: 2px solid var(--navy, #0d1f3c);
	box-shadow: 0 -10px 24px -18px rgba(13, 31, 60, 0.45);
}

/* Reorder prefill chip (in the filter row) + its result note */
.uki-load-last {
	margin-left: 14px;
	font-family: 'Inter', system-ui, sans-serif;
	font-size: 0.84rem;
	font-weight: 600;
	color: var(--navy, #0d1f3c);
	background: #fff;
	border: 1px solid var(--navy, #0d1f3c);
	border-radius: 16px;
	padding: 0.5em 1.1em;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}

.uki-load-last:hover {
	background: var(--navy, #0d1f3c);
	color: #fff;
}

.uki-load-last-note {
	margin-left: 8px;
	font-size: 0.84rem;
	font-weight: 600;
	color: #1e7a4d;
}

@media print {
	.uki-load-last, .uki-load-last-note { display: none; }
}

/* Left cluster of the sticky bar: tally pill + clear button, centered with
   the submit button on the right (bar is space-between + align-items:center). */
.uki-bar-left {
	display: flex;
	align-items: center;
	gap: 0.8em;
}

.uki-clear-qty {
	font-family: 'Inter', system-ui, sans-serif;
	font-size: 0.84rem;
	font-weight: 600;
	color: var(--red, #b1202c);
	background: #fff;
	border: 1px dashed var(--red, #b1202c);
	border-radius: 16px;
	padding: 0.45em 1em;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}

.uki-clear-qty:hover {
	background: var(--red, #b1202c);
	color: #fff;
	border-style: solid;
}

/* The tally is a BUTTON: click toggles review mode (show only selected rows). */
.uki-order-items {
	font-family: 'Inter', system-ui, sans-serif;
	font-size: 0.88rem;
	line-height: 1.4;
	font-weight: 600;
	color: var(--navy, #0d1f3c);
	background: #fff;
	border: 1px dashed var(--navy, #0d1f3c);
	border-radius: 16px;
	padding: 0.45em 1em;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}

.uki-order-items:hover {
	background: var(--navy, #0d1f3c);
	color: #fff;
}

.uki-order-items.uki-review-on {
	background: var(--navy, #0d1f3c);
	color: #fff;
	border-style: solid;
}

/* element+classes outranks .uki-order-sheet .btn-red (declared later in this
   file), whose 1.25em top margin otherwise shoves the submit button below the
   bar's centerline. */
.uki-order-submit-bar button.btn-red {
	margin-top: 0;
}

@media print {
	.uki-order-submit-bar {
		display: none;
	}
}

.uki-order-sheet .btn-red {
	margin-top: 1.25em;
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	background: var(--red, #b1202c);
	color: #fff;
	border: none;
	font-family: 'Inter', system-ui, sans-serif;
	padding: 0.85em 2em;
	font-size: 0.9rem;
	font-weight: 600;
	letter-spacing: 0.01em;
	border-radius: 3px;
	cursor: pointer;
	transition: background 0.18s ease;
}

.uki-order-sheet .btn-red:hover {
	background: var(--red-dark, #8d1820);
}

.uki-order-sent {
	display: flex;
	align-items: center;
	gap: 0.8em;
	margin: 0 0 1.1em;
	padding: 1em 1.3em;
	background: #dcf3e1;
	color: #12421c;
	border: 1px solid #9fd8ad;
	border-left: 6px solid #1e7a1e;
	border-radius: 6px;
	font-weight: 700;
	font-size: 1.12rem;
	box-shadow: 0 6px 18px rgba(30, 122, 30, 0.14);
}
.uki-order-sent::before {
	content: "\2713";
	flex: 0 0 auto;
	width: 1.7em;
	height: 1.7em;
	border-radius: 50%;
	background: #1e7a1e;
	color: #fff;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 1em;
}

/* Submit "thinking" state: spinner + label swap, set by the inline JS on submit */
.uki-order-sheet .btn-red.is-sending {
	background: #8d1820;
	cursor: progress;
	opacity: 1;
}
.uki-spin {
	width: 1em;
	height: 1em;
	border: 2px solid rgba(255, 255, 255, 0.35);
	border-top-color: #fff;
	border-radius: 50%;
	animation: uki-spin 0.8s linear infinite;
}
@keyframes uki-spin {
	to { transform: rotate(360deg); }
}

/* Signed-out wholesale gating (site policy: no prices, no ordering, until login) */
.uki-signin-banner {
	margin-bottom: 1.25em;
	padding: 0.85em 1.1em;
	background: #fdf3e0;
	color: #7a5b1e;
	border-left: 4px solid var(--red, #b1202c);
	border-radius: 3px;
	font-weight: 600;
	font-size: 0.94rem;
}

.uki-signin-banner a,
a.uki-signin-price {
	color: var(--red, #b1202c);
	text-decoration: underline;
	font-weight: 600;
}

.uki-order-sheet .btn-red[disabled] {
	background: #ccc;
	color: #777;
	cursor: not-allowed;
}

.uki-order-sheet .btn-red[disabled]:hover {
	background: #ccc;
}

/* Where-to-buy stockist box (single product template) */
.uki-where-to-buy {
	margin-top: 1.75em;
	padding: 1.1em 1.35em;
	background: var(--cream, #f6efe2);
	border-left: 4px solid var(--navy, #0d1f3c);
	border-radius: 3px;
}

.uki-where-to-buy h4 {
	margin: 0 0 0.4em;
	font-family: 'Fraunces', Georgia, serif;
	font-weight: 600;
	color: var(--navy, #0d1f3c);
}

.uki-where-to-buy .uki-example-note {
	margin: 0 0 0.6em;
	font-size: 0.8em;
	color: #888;
	font-style: italic;
}

.uki-where-to-buy ul {
	margin: 0;
	padding-left: 1.2em;
}

.uki-where-to-buy a {
	color: var(--red, #b1202c);
	text-decoration: none;
	font-weight: 600;
}

.uki-where-to-buy a:hover {
	text-decoration: underline;
}

/* Wholesale credit application (mesh-plan round 4, item 3) — fieldset card
   language matches the theme's Account Details form (parchment card, hairline
   border, Fraunces legend), so this new form doesn't invent a third form
   style on the site alongside the order sheet + account forms. */
.uki-wholesale-app-form {
	max-width: 100%;
}

.uki-wa-fieldset {
	border: 1px solid var(--line, #e0d6c0);
	border-radius: 6px;
	background: var(--parchment, #fbf7ee);
	padding: 30px 26px 26px;
	margin: 0 0 26px;
}

.uki-wa-fieldset legend {
	padding: 0 12px;
	margin: 0 0 6px -12px;
	width: auto;
	font-family: 'Fraunces', Georgia, serif;
	font-weight: 600;
	font-size: 1.1rem;
	color: var(--navy, #0d1f3c);
}

.uki-wa-note {
	margin: 0 0 18px;
	font-size: 0.88rem;
	color: var(--muted, #6b6557);
	font-style: italic;
}

.uki-wa-note a {
	color: var(--red, #b1202c);
	font-weight: 600;
}

.uki-wa-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 18px 20px;
}

.uki-wa-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.uki-wa-field span {
	font-weight: 600;
	font-size: 0.86rem;
	color: var(--navy, #0d1f3c);
}

.uki-wa-req {
	color: var(--red, #b1202c);
}

.uki-wa-field input {
	padding: 11px 13px;
	border: 1.5px solid var(--line, #e0d6c0);
	border-radius: 3px;
	font-family: 'Inter', system-ui, sans-serif;
	font-size: 0.96rem;
	background: #fff;
	color: #1a1a1a;
}

.uki-wa-field input:focus {
	outline: none;
	border-color: var(--navy, #0d1f3c);
}

.uki-wa-terms-list {
	margin: 0 0 20px 20px;
	color: var(--ink-soft, #3a3a3a);
	font-size: 0.92rem;
	line-height: 1.6;
}

.uki-wa-terms-list li {
	margin-bottom: 6px;
}

.uki-wa-agree {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	font-size: 0.92rem;
	line-height: 1.5;
	color: var(--ink, #1a1a1a);
	font-weight: 600;
}

.uki-wa-agree input {
	margin-top: 4px;
	flex-shrink: 0;
	width: 18px;
	height: 18px;
}

.uki-wa-privacy {
	margin: 0 0 24px;
	padding: 0.85em 1.1em;
	background: #fff;
	border-left: 4px solid var(--navy, #0d1f3c);
	border-radius: 3px;
	font-size: 0.86rem;
	color: var(--muted, #6b6557);
}

.uki-wa-error {
	margin-bottom: 1.25em;
	padding: 0.85em 1.1em;
	background: #fbe4e6;
	color: var(--red-dark, #8d1820);
	border-left: 4px solid var(--red, #b1202c);
	border-radius: 3px;
	font-weight: 600;
	font-size: 0.94rem;
}

/* ---- Business license upload (0.9.0-demo) ---- */
.uki-wa-upload .uki-wa-field input[type="file"] {
	padding: 14px 13px;
	border: 1.5px dashed var(--line, #e0d6c0);
	background: #fff;
	cursor: pointer;
}

.uki-wa-upload .uki-wa-field input[type="file"]:hover,
.uki-wa-upload .uki-wa-field input[type="file"]:focus {
	border-color: var(--navy, #0d1f3c);
}

.uki-wa-upload-hint {
	margin: 10px 0 0;
	font-size: 0.86rem;
	color: var(--muted, #6b6557);
	line-height: 1.5;
}

.uki-wa-upload-hint a {
	color: var(--red, #b1202c);
	font-weight: 600;
}

.uki-wa-upload-msg {
	margin: 8px 0 0;
	min-height: 1.2em;
	font-size: 0.88rem;
	font-weight: 600;
	color: var(--navy, #0d1f3c);
}

.uki-wa-upload-msg.is-error {
	color: var(--red-dark, #8d1820);
}

/* Bot trap: off-screen for people, still in the DOM for form-filling bots. */
.uki-wa-hp {
	position: absolute !important;
	left: -10000px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

@media (max-width: 620px) {
	.uki-wa-grid {
		grid-template-columns: 1fr;
	}
}

/* ---- Left category rail + section dividers (order form, 2026-08-11) ---- */
.uki-of-layout {
	display: flex;
	gap: 26px;
	align-items: flex-start;
}

.uki-of-toc {
	position: sticky;
	top: 100px;
	flex: 0 0 190px;
	max-height: calc(100vh - 130px);
	overflow-y: auto;
}

.uki-of-toc ul {
	list-style: none;
	margin: 0;
	padding: 0;
	border-left: 2px solid var(--line, #e0d6c0);
}

/* .page-content prefix outranks the theme's red-underlined
   .page-content a rule that was bleeding onto the rail. Navy at rest,
   red + bold when the section is in view (Derek's spec). */
.page-content .uki-of-toc a:link,
.page-content .uki-of-toc a:visited,
.page-content .uki-of-toc a,
.uki-of-toc a {
	display: block;
	padding: 6px 12px;
	font-family: 'Inter', system-ui, sans-serif;
	font-size: 0.84rem;
	color: var(--navy, #0d1f3c);
	text-decoration: none;
	border-left: 2px solid transparent;
	margin-left: -2px;
	font-weight: 400;
}

.page-content .uki-of-toc a:hover,
.uki-of-toc a:hover {
	color: var(--red, #b1202c);
	text-decoration: none;
}

.page-content .uki-of-toc a.uki-toc-active,
.uki-of-toc a.uki-toc-active {
	color: var(--red, #b1202c);
	font-weight: 700;
	border-left-color: var(--red, #b1202c);
	text-decoration: none;
}

.uki-of-main {
	flex: 1 1 auto;
	min-width: 0;
}

tr.uki-cat-divider td {
	background: var(--navy, #0d1f3c);
	color: #f0ead9;
	font-family: 'Inter', system-ui, sans-serif;
	font-weight: 700;
	font-size: 0.82rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	padding: 0.6em 0.9em;
}

@media (max-width: 1100px) {
	.uki-of-toc { display: none; }
}

@media print {
	.uki-of-toc { display: none; }
	tr.uki-cat-divider td { background: #eee; color: #000; }
}

/* ---- Column proportions (Derek 2026-08-11): Product gets the room; Pack
   Size and Stock slim down; stock pills stack vertically, centered; Item #
   never wraps, sits between Stock and Qty. ---- */
table.uki-order-grid th.uki-col-pack, table.uki-order-grid td.uki-col-pack { width: 84px; text-align: center; }
.uki-name-size { color: #697585; font-weight: 400; }
table.uki-order-grid th.uki-col-upc, table.uki-order-grid td.uki-col-upc { width: 128px; }
table.uki-order-grid th.uki-col-price, table.uki-order-grid td.uki-col-price { width: 80px; }
table.uki-order-grid th.uki-col-stock, table.uki-order-grid td.uki-col-stock { width: 104px; text-align: center; }
table.uki-order-grid th.uki-col-sku, table.uki-order-grid td.uki-col-sku { width: 70px; white-space: nowrap; text-align: center; }
table.uki-order-grid th.uki-col-qty, table.uki-order-grid td.uki-col-qty { width: 74px; }
td.uki-col-stock .uki-badge { display: block; width: max-content; margin: 2px auto; }

/* The theme's .page-content table rule adds an 18px top margin, which made
   the rail sit visibly higher than the table. Flush both to the layout top. */
.uki-of-main table.uki-order-grid { margin-top: 0; }
