/*
 * Configurator : cir-product-options markup dressed as product-lab.html P8 (B5 buy box, the option tiles), and the option
 * panel as Cast Iron's own slide-out from the left in Column's colours (24 Sep 2026 : the P8D centred panel is retired).
 * Loaded on the product page and the basket (Edit Options opens the same panel).
 *
 * The plugin's markup and its cir-modal.css are shared with Cast Iron and are NOT changed : every rule here is theme CSS.
 * Specificity : the plugin's stylesheet can be injected into <head> AFTER this file (the basket loads it on the first
 * Edit Options click), so every selector starts `html body` to win on specificity rather than on source order, and uses
 * !important only where the plugin itself does (or where an inline style has to be beaten).
 * Values are the lab's (measured with Playwright, 16 Sep 2026) : tile 97.6px square at 1440, icon ring 26px, qty 130 x 50,
 * CTA 50px gold. A chosen tile shows the chosen option's image (Cast Iron's 28px thumb), and its name wraps rather than
 * being cut off. The panel keeps the plugin's geometry (650px from the left, full height), as Cast Iron.
 */

/* ---------- tokens the plugin already reads ---------- */
:root {
	--cir-po-accent: var(--gold);
	--cir-po-ink: var(--ink);
	--cir-po-header-bg: var(--ink);
	--cir-po-header-text: var(--ivory);
	--cir-po-font-display: var(--serif);
}

/* ======================================================================
   BUY BOX (P8 B5) : tiles, then price, then quantity + Choose Options
   The theme prints the price inside the plugin's form (buy-box.php), so one grid orders all three.
   ====================================================================== */
html body .pl .buy form.cir-po-mount { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 12px; row-gap: 14px; margin: 0; }
html body .pl .buy form.cir-po-mount > * { grid-column: 1 / -1; }
html body .pl form.cir-po-mount #cir-options-wrapper { display: contents; }
html body .pl form.cir-po-mount #cir-hidden-inputs { display: contents; }
html body .pl form.cir-po-mount #cir-summary-grid { grid-column: 1 / -1; order: 1; min-width: 0; margin: 0; }
html body .pl form.cir-po-mount #cir-summary-grid .cir-summary-b { margin: 0; }
html body .pl form.cir-po-mount > .wasline,
html body .pl form.cir-po-mount > .priceline { order: 2; }
html body .pl form.cir-po-mount > .cir-po-qtyrow { order: 3; grid-column: 1; display: block; }
html body .pl form.cir-po-mount #cir-choose-options { order: 3; grid-column: 2; }
/* cir-my-projects heart (Cast Iron CTA row : qty | Choose Options | heart). */
html body .pl .buy form.cir-po-mount:has(.cir-wishlist-btn) { grid-template-columns: auto minmax(0, 1fr) auto; }
html body .pl form.cir-po-mount .cir-wishlist-btn { order: 3; grid-column: 3; align-self: stretch; height: auto; min-height: 50px; }
/* lab : 12px from the quantity row to Ask A Specialist (.ctas.stack gap), the buy box gap is 14px */
html body .pl .buy form.cir-po-mount + .ctas { margin-top: -2px; }

/* quantity : the lab's 42 + 44 + 42 stepper, the real input in the middle */
html body .pl .cir-po-qtyrow .qty input[name="quantity"] { width: 44px; min-width: 0; height: auto; margin: 0; padding: 0; border: 0; border-left: 1px solid rgba(13, 27, 42, 0.12); border-right: 1px solid rgba(13, 27, 42, 0.12); border-radius: 0; background: transparent; box-shadow: none; color: var(--ink-deep); font-family: var(--sans); font-size: 14px; font-weight: 600; line-height: 1; text-align: center; outline: none; -moz-appearance: textfield; appearance: textfield; font-variant-numeric: tabular-nums; }
html body .pl .cir-po-qtyrow .qty input[name="quantity"]::-webkit-outer-spin-button,
html body .pl .cir-po-qtyrow .qty input[name="quantity"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
html body .pl .cir-po-qtyrow .qty input[name="quantity"]:focus-visible { box-shadow: inset 0 0 0 2px var(--gold); }
html body .pl .cir-po-qtyrow .qty button:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }

/* Choose Options / Add To Basket : the lab's .btn .btn-gold, no icon */
html body .pl #cir-choose-options { display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 50px; padding: 0 30px; background: var(--gold); color: var(--ink); border: 1px solid var(--gold); border-radius: 2px; font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: 0.16em; line-height: 1; text-transform: uppercase; white-space: nowrap; cursor: pointer; transition: background 0.2s, color 0.2s, border-color 0.2s; }
html body .pl #cir-choose-options:hover { background: #d6b982; border-color: #d6b982; }
html body .pl #cir-choose-options:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
html body .pl #cir-choose-options .cir-btn-icon { display: none; }

/* ---------- option tiles (P8 .opts / .tile) ---------- */
html body .pl #cir-summary-grid .cir-summary-header,
html body .pl #cir-summary-grid .cir-summary-a { display: none; }
html body .pl #cir-summary-grid .cir-summary-b.cir-summary-active { display: block; }
html body .pl #cir-summary-grid .cir-summary-compact-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
html body .pl #cir-summary-grid .cir-summary-compact-cell { position: relative; min-height: 97px; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 8px 4px; border: 1px solid rgba(13, 27, 42, 0.18); border-radius: 2px; background: var(--warm-white); text-align: center; cursor: pointer; transition: border-color 0.15s; }
html body .pl #cir-summary-grid .cir-summary-compact-cell:hover { border-color: var(--gold); }
/* chosen : a gold border, as Cast Iron's chosen tile */
html body .pl #cir-summary-grid .cir-selection-card--selected { border: 1px solid var(--gold); }
html body .pl #cir-summary-grid .cir-selection-card--selected:hover { border-color: var(--gold); }
html body .pl #cir-summary-grid .cir-selection-card--warning { border: 1px solid #a86a1e !important; background: #fdf6ec; }

/* icon ring : 26px, 1.5px grey ring with a minus while nothing is chosen. Once chosen, the tile shows the chosen option's
   image (below) ; a "No ..." choice shows a cross, as Cast Iron ; a chosen option with no image keeps the gold tick. */
html body .pl #cir-summary-grid .cir-summary-icon-thumb,
html body .pl #cir-summary-grid .cir-summary-compact-thumb { position: relative; width: 26px; height: 26px; flex-shrink: 0; border: 1.5px solid var(--grey-soft); border-radius: 50%; background: transparent; color: var(--grey-soft); overflow: visible; display: flex; align-items: center; justify-content: center; }
html body .pl #cir-summary-grid .cir-summary-icon-thumb svg,
html body .pl #cir-summary-grid .cir-summary-compact-thumb img { display: none; }
html body .pl #cir-summary-grid .cir-summary-icon-thumb::after,
html body .pl #cir-summary-grid .cir-summary-compact-thumb::after { content: ''; width: 13px; height: 13px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14'/%3E%3C/svg%3E") center / 13px 13px no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14'/%3E%3C/svg%3E") center / 13px 13px no-repeat; }
html body .pl #cir-summary-grid .cir-selection-card--selected .cir-summary-icon-thumb,
html body .pl #cir-summary-grid .cir-selection-card--selected .cir-summary-compact-thumb { border-color: var(--gold-muted); background: var(--gold-muted); color: var(--ivory); }
html body .pl #cir-summary-grid .cir-selection-card--selected .cir-summary-icon-thumb::after { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 6 6 18'/%3E%3Cpath d='m6 6 12 12'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 6 6 18'/%3E%3Cpath d='m6 6 12 12'/%3E%3C/svg%3E"); }
html body .pl #cir-summary-grid .cir-selection-card--selected .cir-summary-compact-thumb::after { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E"); }
html body .pl #cir-summary-grid .cir-selection-card--warning .cir-summary-icon-thumb { border-color: #a86a1e; color: #a86a1e; }
html body .pl #cir-summary-grid .cir-selection-card--warning .cir-summary-icon-thumb::after { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 7v6'/%3E%3Cpath d='M12 17h.01'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 7v6'/%3E%3Cpath d='M12 17h.01'/%3E%3C/svg%3E"); }

/* the chosen option's image (Cast Iron .cir-summary-compact-thumb : 28px square, cover) */
html body .pl #cir-summary-grid .cir-selection-card--selected .cir-summary-compact-thumb:has(img) { width: 28px; height: 28px; border: 1px solid var(--line-gold); border-radius: 2px; background: #fff; overflow: hidden; }
html body .pl #cir-summary-grid .cir-selection-card--selected .cir-summary-compact-thumb:has(img)::after { content: none; }
html body .pl #cir-summary-grid .cir-selection-card--selected .cir-summary-compact-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* tile name (lab .tn) : two short words stack, as the lab's <br> does */
html body .pl #cir-summary-grid .cir-summary-compact-cat { display: block; width: min-content; max-width: 100%; font-family: var(--sans); font-size: 9px; font-weight: 600; letter-spacing: 0.10em; line-height: 1.3; text-transform: uppercase; color: var(--ink); text-align: center; }
html body .pl #cir-summary-grid .cir-selection-card--not-selected .cir-summary-compact-cat { color: var(--ink); }
html body .pl #cir-summary-grid .cir-selection-card--warning .cir-summary-compact-cat { color: #a86a1e; }
/* tile value (lab .tv) : upright, never italic */
html body .pl #cir-summary-grid .cir-not-selected-text,
html body .pl #cir-summary-grid .cir-warning-text,
html body .pl #cir-summary-grid .cir-summary-compact-name { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--sans); font-size: 10.5px; font-style: normal; font-weight: 400; line-height: 1.2; text-align: center; word-break: normal; }
html body .pl #cir-summary-grid .cir-not-selected-text { color: var(--grey) !important; }
/* the chosen name wraps in full, as Cast Iron's ("Jet Black (RAL 9005)" was cut to "Jet Black (RAL ...") */
html body .pl #cir-summary-grid .cir-summary-compact-name { color: var(--gold-muted); font-weight: 600; overflow: visible; text-overflow: clip; white-space: normal; overflow-wrap: break-word; }
html body .pl #cir-summary-grid .cir-warning-text { color: #a86a1e !important; font-weight: 600; }
/* the option price is in the page price and the panel, the lab tile carries none */
html body .pl #cir-summary-grid .cir-summary-compact-price,
html body .pl #cir-summary-grid .cir-summary-sublabel { display: none; }

/* ======================================================================
   OPTION PANEL : Cast Iron's slide-out from the LEFT, in Column's colours
   Myles, 24 Sep 2026 : the panel was never meant to change shape when the valve images were done. So the
   plugin's own geometry stands (cir-modal.css : fixed left, 650px, full height, translateX(-100%) to 0, full
   width at 768px) and the rules below only change colour and type. Nothing here sets top, left, width, height
   or transform on #cir-modal-panel.
   ====================================================================== */
html body #cir-modal-overlay.cir-modal-active { background: rgba(13, 27, 42, 0.55); }
html body #cir-modal-panel { background: var(--warm-white); color: var(--ink-deep); font-family: var(--sans); box-shadow: 30px 0 60px -30px rgba(0, 0, 0, 0.55); }

/* header : Cast Iron's dark bar with a serif title and a plain close cross, navy instead of charcoal */
html body #cir-modal-panel .cir-modal-header { background-color: var(--ink) !important; border-bottom: 1px solid var(--line-gold-strong); }
html body #cir-modal-panel .cir-modal-header h3 { font-family: var(--serif) !important; font-size: 20px !important; font-weight: 400 !important; line-height: 1.2; color: var(--ivory) !important; }
html body #cir-modal-panel .cir-modal-close { color: var(--ivory) !important; }
html body #cir-modal-panel .cir-modal-close:hover { color: var(--gold) !important; }
html body #cir-modal-panel .cir-modal-close:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* accordion rows */
html body #cir-modal-panel .cir-accordion-section + .cir-accordion-section { border-top: 1px solid var(--line-gold); }
html body #cir-modal-panel .cir-accordion-thumb { border-radius: 2px; background: #ece5d8; }
html body #cir-modal-panel .cir-no-thumb { border-radius: 2px; background: #ece5d8; }
html body #cir-modal-panel .cir-accordion-category { font-family: var(--serif); font-size: 18px; font-weight: 400; line-height: 1.2; color: var(--ink); }
html body #cir-modal-panel .cir-accordion-selection { font-family: var(--sans); font-size: 12px; color: var(--grey); }
html body #cir-modal-panel .cir-accordion-price { color: var(--ink); font-weight: 600; }
html body #cir-modal-panel .cir-accordion-chevron svg { color: var(--gold-muted); }

/* option cards : Cast Iron's card (centred image, name, price), a gold 2px border when chosen instead of red */
html body #cir-modal-panel .cir-option-card { border-color: rgba(13, 27, 42, 0.12); border-radius: 2px; background: #fff; }
html body #cir-modal-panel .cir-option-card:hover { border-color: var(--gold); }
html body #cir-modal-panel .cir-option-card.cir-option-selected { border: 2px solid var(--gold); }
html body #cir-modal-panel .cir-option-image img { border-radius: 2px; }
html body #cir-modal-panel .cir-no-image { border-radius: 2px; background: #ece5d8; }
html body #cir-modal-panel .cir-option-name { font-family: var(--sans); color: var(--ink-deep); }
html body #cir-modal-panel .cir-option-price { font-family: var(--sans); font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
html body #cir-modal-panel .cir-finish-match { border-color: var(--gold); background: #fdf9f0; }
html body #cir-modal-panel .cir-option-badge { border-radius: 2px; font-family: var(--sans); font-weight: 600; letter-spacing: 0.02em; }
html body #cir-modal-panel .cir-option-badge--stock { background: #eef5ec; color: #2f6b3a; }
html body #cir-modal-panel .cir-option-badge--mto { background: rgba(201, 169, 110, 0.16); color: #7a6536; }

/* colour list furniture */
html body #cir-modal-panel .cir-colour-subgroup-name { font-family: var(--sans); font-size: 10.5px; font-weight: 600; letter-spacing: 0.22em; color: var(--gold-muted); }
html body #cir-modal-panel .cir-group-leadtime { border-radius: 2px; background: #eef5ec; color: #2f6b3a; font-family: var(--sans); }
html body #cir-modal-panel .cir-colour-scroll { scrollbar-color: var(--line-gold-strong) transparent; }
html body #cir-modal-panel .cir-colour-scroll::-webkit-scrollbar-thumb { background: var(--line-gold-strong); border-color: var(--warm-white); }
html body #cir-modal-panel .cir-scroll-fade { background: linear-gradient(to top, var(--warm-white) 28%, rgba(251, 248, 242, 0)); }
html body #cir-modal-panel .cir-hint-pill { border-color: var(--ink); border-radius: 13px; background: var(--ink); color: var(--ivory); font-family: var(--sans); letter-spacing: 0.16em; }
html body #cir-modal-panel .cir-hint-chev { color: var(--gold); }
html body #cir-modal-panel .cir-grid-arrow { color: var(--gold-muted); }
html body #cir-modal-panel .cir-grid-dot { background: var(--line-gold-strong); }
html body #cir-modal-panel .cir-grid-dot-active { background: var(--gold); }
html body #cir-modal-panel .cir-ccs-input { border: 1px solid rgba(13, 27, 42, 0.22); border-radius: 2px; background: #fff; color: var(--ink); font-family: var(--sans); }
html body #cir-modal-panel .cir-ccs-input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201, 169, 110, 0.18); }
html body #cir-modal-panel .cir-ccs-count,
html body #cir-modal-panel .cir-ccs-empty { color: var(--grey); }

/* footer : Cast Iron's layout (total row, then a full-width button), navy price and the gold button */
html body #cir-modal-panel .cir-modal-footer { background: var(--ivory); border-top: 1px solid var(--line-gold); }
html body #cir-modal-panel .cir-modal-total span:first-child { font-family: var(--sans); color: var(--grey); }
html body #cir-modal-panel #cir-modal-total-price { font-family: var(--sans); font-weight: 700; letter-spacing: -0.01em; color: var(--ink); font-variant-numeric: tabular-nums; }
html body #cir-modal-panel #cir-modal-complete { border: 1px solid var(--gold); border-radius: 2px; background: var(--gold); color: var(--ink); font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: 0.16em; line-height: 1; text-transform: uppercase; transition: background 0.2s, border-color 0.2s; }
html body #cir-modal-panel #cir-modal-complete:hover { background: #d6b982; border-color: #d6b982; }
html body #cir-modal-panel #cir-modal-complete:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
html body #cir-modal-panel #cir-modal-complete:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- Tablet : 1024px and below ---------- */
@media (max-width: 1024px) {
	html body .pl #cir-summary-grid .cir-summary-compact-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	html body .pl #cir-summary-grid .cir-summary-compact-cell { min-height: 96px; padding: 12px 8px; }
}

/* ---------- Phone : 640px and below ---------- */
@media (max-width: 640px) {
	html body .pl .buy form.cir-po-mount { column-gap: 10px; row-gap: 12px; }
	html body .pl .buy form.cir-po-mount + .ctas { margin-top: 0; }
	html body .pl #cir-choose-options { padding: 0 18px; }
	/* qty | CTA | heart has to fit 390 : the CTA text keeps nowrap, so it gives up padding and tracking instead */
	html body .pl .buy form.cir-po-mount:has(.cir-wishlist-btn) #cir-choose-options { padding: 0 10px; letter-spacing: 0.1em; }
	html body .pl #cir-summary-grid .cir-summary-compact-grid { gap: 6px; }
	html body .pl #cir-summary-grid .cir-summary-compact-cell { min-height: 92px; padding: 10px 4px; gap: 5px; }
	html body .pl #cir-summary-grid .cir-summary-compact-cat { font-size: 8.5px; letter-spacing: 0.08em; }
	html body .pl #cir-summary-grid .cir-not-selected-text,
	html body .pl #cir-summary-grid .cir-warning-text,
	html body .pl #cir-summary-grid .cir-summary-compact-name { font-size: 10px; }
	html body #cir-modal-panel .cir-modal-header h3 { font-size: 18px !important; }
}
