/* Plain CSS (not Tailwind-dependent) for the radio "pill/checkmark" control
 * used by radio-type fields, so this keeps working regardless of whether
 * the theme's Tailwind build scans this plugin's PHP for class names.
 *
 * The radio input is hidden by covering it exactly over its own label's
 * clickable area (opacity:0 + inset:0), rather than shrinking it to 1px
 * and clipping it away from its natural position - that older "sr-only"
 * technique can trigger some browsers to auto-scroll the page toward the
 * (invisible but still focusable) 1px element whenever it's checked. Since
 * this version never leaves the area the customer is already looking at,
 * there's nothing off-screen for the browser to try to reveal. */

.llco-options label {
	position: relative;
	display: inline-flex;
	align-items: center;
}

.llco-options input[type="radio"] {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	opacity: 0;
	cursor: pointer;
	border: 0;
}

.llco-options input[type="radio"] + span {
	transition: border-color 0.15s ease, color 0.15s ease;
}

.llco-options input[type="radio"]:checked + span {
	border-color: #fbbf24; /* amber-400, matching the site's existing accent colour */
	color: #fbbf24;
}

/* ==========================================================================
   Number field prefix/suffix adornments (e.g. "£" before, "cm" after) -
   the ADORNMENT itself is just a positioned <span>, not a literal CSS
   ::before/::after pseudo-element (that distinction matters for maintaining
   this file - "before/after" here refers to prefix/suffix placement, not
   the CSS feature of the same name).
   ========================================================================== */

/* .llco-number-field {
	position: relative;
}

.llco-number-field input {
	margin-top: 0.5rem;
	min-height: 2.5rem;
	min-width: 0;
	padding: 10px 15px;
	font-size: 11px;
	line-height: 14px;
	letter-spacing: 1.32px;
} */
 .llco-number-field {
	position: relative;
	margin-top: 0.5rem; /* moved here from the input below */
}

.llco-number-field input {
	min-height: 2.5rem;
	min-width: 0;
	padding: 10px 15px;
	font-size: 11px;
	line-height: 14px;
	letter-spacing: 1.32px;
}

.llco-number-field--has-prefix input {
	padding-left: 40px;
}

.llco-number-field--has-suffix input {
	padding-right: 40px;
}

.llco-number-field__adornment {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	color: #1f2937;
	font-size: 11px;
	font-weight: 500;
	line-height: 14px;
	letter-spacing: 0;
	white-space: nowrap;
	pointer-events: none;
}

.llco-number-field__adornment--prefix {
	left: 15px;
}

.llco-number-field__adornment--suffix {
	right: 15px;
}

/* ==========================================================================
   Validation: highlighted fields + inline tooltip messages
   ========================================================================== */

.llco-options .llco-input-error {
	border-color: #dc2626 !important;
	outline: 1px solid #dc2626;
}

.llco-error-tooltip {
	display: block;
	position: absolute;
	left: 0;
	top: 100%;
	margin-top: 4px;
	background: #dc2626;
	color: #fff;
	font-size: 12px;
	font-weight: 600;
	padding: 4px 8px;
	border-radius: 4px;
	white-space: nowrap;
	z-index: 5;
}

.llco-error-tooltip::before {
	content: '';
	position: absolute;
	bottom: 100%;
	left: 12px;
	border: 5px solid transparent;
	border-bottom-color: #dc2626;
}

/* "Please choose ..." on a no-default radio panel (e.g. Eyelet Colour) -
   sits in the flow under the options rather than floating over the next panel. */
.llco-options details[data-require-choice] .values > .llco-error-tooltip {
	position: relative;
	top: auto;
	display: inline-block;
	margin-top: 10px;
}

/* ==========================================================================
   Add to basket disabled state + inline form message
   ========================================================================== */

.single_add_to_cart_button.llco-btn-disabled {
	opacity: 0.5;
	cursor: not-allowed;
	pointer-events: none;
}

.llco-form-message {
	color: #dc2626;
	font-weight: 600;
	font-size: 14px;
	margin-top: 8px;
}

/* ==========================================================================
   Reveal the native WooCommerce quantity input - now that price scales
   with quantity, customers need to be able to change it. Overrides the
   theme's own [&_.quantity]:hidden utility with !important, so no theme
   template edit is required.
   ========================================================================== */

form.cart .quantity {
	display: inline-flex !important;
	align-items: center;
	gap: 8px;
	margin-bottom: 12px;
}

/* Fabrics pages: hidden on the sample page (always 1 sample), shown as
   the length input on the default by-the-metre page - see
   Llco_Fabric_Samples::open_metre_length(). */
[data-product-type="fabrics-customise"] form.cart .quantity {
	display: none !important;
}

[data-product-type="fabrics-customise"] form.cart .llco-metre-length .quantity {
	display: block !important;
	margin-bottom: 0;
}

/* order: 1 puts it above the price/button row, like .llco-options - the
   theme lays form.cart out as column-reverse. */
.llco-metre-length {
	order: 1;
	width: 12.5rem; /* Same as the fabric calculator's .input-field */
}

/* Wallpaper roll page "Quantity" label - see
   Llco_Fabric_Samples::open_wallpaper_quantity(). Matches the fabric
   calculator's labels (theme's elements.css .input-field label). */
.llco-quantity-field label {
	display: block;
	text-transform: uppercase;
	font-size: 11px;
	letter-spacing: 0.15px;
	line-height: 14px;
}

/* Match the fabric calculator's borderless pill inputs (the product page
   otherwise gives every input a dark border), without number spinners. */
.nuwoo-product .llco-metre-length input.qty {
	border-color: transparent;
	-moz-appearance: textfield;
	appearance: textfield;
}

.llco-metre-length input.qty::-webkit-outer-spin-button,
.llco-metre-length input.qty::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}
/* ==========================================================================
   Product specs under the title (e.g. tieback Cord Diameter / Embrace /
   Drop from the Knot) - see class-llco-tieback-specs.php.
   ========================================================================== */

.llco-product-specs {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 24px;
	margin: 0 0 16px;
	font-size: 14px;
	letter-spacing: 0.05em;
}

.llco-product-specs > div {
	display: flex;
	gap: 6px;
}

.llco-product-specs dt {
	font-weight: 700;
}

.llco-product-specs dd {
	margin: 0;
}

/* ==========================================================================
   Image tiles - radio fields where options have images (e.g. Headings,
   Eyelet Colour). Selectors include .product-details .values so they
   outrank the theme's own `.values label` flex-row styling.
   ========================================================================== */

.llco-image-options {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
	gap: 1rem;
	width: 100%;
}

.llco-options .product-details .values label.llco-image-option {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 0.5rem;
}

.llco-options .llco-image-option__image {
	display: block;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	border: 2px solid #cbd5e1; /* slate-300, matching the unchecked radio-span */
	border-radius: 0.5rem;
	background: #f1f5f9;
}

.llco-options .llco-image-option__image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Small source images (e.g. 46px eyelet finishes): narrower tiles, more per
 * row, and the image kept at its own size, centred, instead of upscaled. */
.llco-image-options--small {
	grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
	gap: 0.75rem;
}

.llco-options .llco-image-options--small .llco-image-option__image {
	display: flex;
	align-items: center;
	justify-content: center;
	background: #fff;
}

.llco-options .llco-image-options--small .llco-image-option__image img {
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
}

.llco-options .llco-image-options--small .llco-image-option__text {
	flex-direction: column;
	text-align: center;
	gap: 0.25rem;
	font-size: 10px;
}

.llco-options .llco-image-options--small .llco-image-option__text .radio-span {
	width: 1.25rem;
	height: 1.25rem;
	font-size: 12px;
}

.llco-options .llco-image-option__text {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	line-height: 1.2;
}

.llco-options .llco-image-option__text .radio-span {
	flex-shrink: 0;
	transition: border-color 0.15s ease, color 0.15s ease;
}

.llco-options .llco-image-option input[type="radio"]:checked ~ .llco-image-option__text .radio-span {
	border-color: #fbbf24;
	color: #fbbf24;
}

.llco-options .llco-image-option input[type="radio"]:focus-visible + .llco-image-option__image {
	outline: 2px solid #fbbf24;
	outline-offset: 2px;
}

/* ==========================================================================
   Options that clash with another choice (e.g. Eyelet heading vs a track) -
   greyed out and unclickable, with a short note under the panel.
   ========================================================================== */

.llco-options .product-details .values label:has(> input[type="radio"]:disabled) {
	opacity: 0.4;
	cursor: not-allowed;
}

.llco-options .llco-image-option:has(> input[type="radio"]:disabled) .llco-image-option__image img {
	filter: grayscale(1);
}

.llco-options .llco-option-note {
	width: 100%;
	margin-top: 8px;
	font-size: 13px;
	font-style: italic;
	color: #64748b;
}
