/*
 * RRS product options: variation chips, quantity and "Add to quote" button
 * on single product pages, in the Red River Steel style.
 */
form.wc-block-add-to-cart-with-options.rrs-opts {
	--rrs-ink: var(--wp--preset--color--theme-2, #201f1a);
	--rrs-red: var(--wp--preset--color--theme-3, #c9132a);
	--rrs-orange: var(--wp--preset--color--theme-4, #faa11b);
	--rrs-stone: #f4f3ef;
	--rrs-line: #deddd7;
	--rrs-muted: #6b6a64;
	margin-top: 8px;
	padding: 22px 24px 20px;
	background: var(--rrs-stone);
	border-radius: 14px;
	color: var(--rrs-ink);
}

/* ---- Attribute rows ---- */
.rrs-opts .wp-block-woocommerce-add-to-cart-with-options-variation-selector {
	display: grid;
	gap: 18px;
	margin: 0 0 20px;
	padding-bottom: 20px;
	border-bottom: 1px solid var(--rrs-line);
}
.rrs-opts .wp-block-woocommerce-add-to-cart-with-options-variation-selector-attribute > .wp-block-group {
	gap: 10px !important;
	margin: 0 !important;
}
.rrs-opts .wp-block-woocommerce-add-to-cart-with-options-variation-selector-attribute-name {
	display: flex;
	align-items: baseline;
	gap: 8px;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--rrs-ink);
}
.rrs-opts .rrs-opt-val {
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0;
	text-transform: none;
	color: var(--rrs-red);
}
.rrs-opts .rrs-opt-val:empty { display: none; }
.rrs-opts .rrs-opt-val::before { content: "\2014\00a0"; color: var(--rrs-muted); font-weight: 400; }

/* ---- Option chips ---- */
.rrs-opts .wc-block-product-filter-chips__fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.rrs-opts .wc-block-product-filter-chips__items {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}
.rrs-opts .wc-block-product-filter-chips__item {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	min-width: 64px;
	margin: 0;
	padding: 10px 18px;
	background: #fff !important;
	color: var(--rrs-ink) !important;
	border: 2px solid var(--rrs-line) !important;
	border-radius: 999px !important;
	font: inherit;
	font-size: 15px;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
	transition: border-color .15s, background-color .15s, color .15s, box-shadow .15s;
}
.rrs-opts .wc-block-product-filter-chips__item:hover:not(:disabled) {
	border-color: var(--rrs-ink) !important;
}
.rrs-opts .wc-block-product-filter-chips__item[aria-checked="true"] {
	background: var(--rrs-orange) !important;
	border-color: var(--rrs-orange) !important;
	color: var(--rrs-ink) !important;
	box-shadow: 0 2px 0 rgba(32, 31, 26, .12);
}
.rrs-opts .wc-block-product-filter-chips__item[aria-checked="true"] .wc-block-product-filter-chips__label::before {
	content: "";
	display: inline-block;
	width: 10px;
	height: 6px;
	margin: 0 8px 3px 0;
	border-left: 2.5px solid currentColor;
	border-bottom: 2.5px solid currentColor;
	transform: rotate(-45deg);
}
.rrs-opts .wc-block-product-filter-chips__item:disabled {
	opacity: .45;
	text-decoration: line-through;
	/* Let the click reach the option row so the script can switch to this option. */
	pointer-events: none;
	transition: opacity .15s, border-color .15s;
}
.rrs-opts .wc-block-product-filter-chips__item:disabled.rrs-chip-hover {
	opacity: .8;
	border-color: var(--rrs-ink) !important;
	text-decoration: none;
}
.rrs-opts .rrs-over-disabled { cursor: pointer; }
.rrs-opts .wc-block-product-filter-chips__item:focus-visible {
	outline: 2px solid var(--rrs-red);
	outline-offset: 2px;
}
.rrs-opts .rrs-opt-locked .wc-block-product-filter-chips__item[aria-checked="true"] { cursor: default; }
.rrs-opts .wc-block-product-filter-chips__label { display: inline-flex; align-items: center; }

/* ---- Quantity + button row ---- */
.rrs-opts > .wp-block-group.is-nowrap {
	display: flex;
	flex-wrap: nowrap;
	align-items: stretch;
	gap: 12px !important;
}
.rrs-opts .wc-block-add-to-cart-with-options__quantity-selector,
.rrs-opts .wp-block-woocommerce-add-to-cart-with-options-quantity-selector {
	flex: none;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: transparent !important;
}
.rrs-opts .wc-block-components-quantity-selector {
	display: flex;
	align-items: center;
	height: 54px;
	margin: 0;
	background: #fff;
	border: 2px solid var(--rrs-line) !important;
	border-radius: 999px !important;
	overflow: hidden;
}
.rrs-opts .wc-block-components-quantity-selector::after { display: none !important; }
.rrs-opts .wc-block-components-quantity-selector__input {
	width: 48px !important;
	min-width: 0;
	height: 100%;
	border: 0 !important;
	background: transparent !important;
	text-align: center;
	font-size: 16px !important;
	font-weight: 700;
	color: var(--rrs-ink);
	box-shadow: none !important;
	-moz-appearance: textfield;
}
.rrs-opts .wc-block-components-quantity-selector__input::-webkit-outer-spin-button,
.rrs-opts .wc-block-components-quantity-selector__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.rrs-opts .wc-block-components-quantity-selector__button {
	width: 44px;
	height: 100%;
	border: 0 !important;
	background: transparent !important;
	color: var(--rrs-ink) !important;
	font-size: 20px !important;
	cursor: pointer;
	opacity: 1;
}
.rrs-opts .wc-block-components-quantity-selector__button:hover:not(:disabled) { color: var(--rrs-red) !important; }
.rrs-opts .wc-block-components-quantity-selector__button:disabled { opacity: .3; cursor: default; }

.rrs-opts .wp-block-woocommerce-product-button { display: flex; flex: 1 1 auto; margin: 0; }
.rrs-opts .wc-block-components-product-button__button {
	display: inline-flex !important;
	flex: 1 1 auto !important;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100% !important;
	height: 54px;
	margin: 0 !important;
	padding: 0 28px !important;
	background: var(--rrs-red) !important;
	color: #fff !important;
	border: 0 !important;
	border-radius: 999px !important;
	font-size: 16px !important;
	font-weight: 700 !important;
	letter-spacing: .01em;
	text-align: center !important;
	cursor: pointer;
	transition: background-color .15s, transform .1s;
}
.rrs-opts .wc-block-components-product-button__button::before {
	content: "";
	width: 18px;
	height: 18px;
	flex: none;
	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.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='4' width='14' height='17' rx='2'/%3E%3Cpath d='M9 4V3h6v1M9 11h6M12 8v6'/%3E%3C/svg%3E") center / contain 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.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='4' width='14' height='17' rx='2'/%3E%3Cpath d='M9 4V3h6v1M9 11h6M12 8v6'/%3E%3C/svg%3E") center / contain no-repeat;
}
.rrs-opts .wc-block-components-product-button__button:hover:not(:disabled) { background: var(--rrs-ink) !important; }
.rrs-opts .wc-block-components-product-button__button:active:not(:disabled) { transform: translateY(1px); }
.rrs-opts .wc-block-components-product-button__button:disabled,
.rrs-opts .wc-block-components-product-button__button[aria-disabled="true"] {
	background: #d6d4cd !important;
	color: #77766f !important;
	cursor: not-allowed;
	transform: none;
}

/* ---- Hint under the button ---- */
.rrs-opts .rrs-opt-hint {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 12px 2px 0;
	font-size: 14px;
	line-height: 1.4;
	color: var(--rrs-muted);
}
.rrs-opts .rrs-opt-hint[hidden] { display: none; }
.rrs-opts .rrs-opt-hint::before {
	content: "i";
	flex: none;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: var(--rrs-ink);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	font-style: italic;
	line-height: 18px;
	text-align: center;
}
.rrs-opts .rrs-opt-hint.is-error { color: var(--rrs-red); }
.rrs-opts .rrs-opt-hint.is-error::before { background: var(--rrs-red); content: "!"; font-style: normal; }

/* WooCommerce's own "missing attributes" notice is no longer needed. */
.rrs-opts .wc-block-components-notice-banner.is-error:has(+ *),
.rrs-opts.rrs-gated .wc-block-store-notices { display: none; }

@media (max-width: 600px) {
	form.wc-block-add-to-cart-with-options.rrs-opts { padding: 18px 16px; }
	.rrs-opts .wc-block-product-filter-chips__item { padding: 10px 14px; font-size: 14px; }
	.rrs-opts .wc-block-components-product-button__button { padding: 0 18px !important; }
}
