/**
 * Rokh Product Elements — scoped default styles.
 *
 * Every rule is scoped to .rokh-pe. Visual values are exposed as CSS custom
 * properties so themes can override them without fighting plugin specificity.
 */

.rokh-pe {
	--rokh-pe-text: inherit;
	--rokh-pe-muted: #6b7280;
	--rokh-pe-border: #d1d5db;
	--rokh-pe-surface: transparent;
	--rokh-pe-accent: #111827;
	--rokh-pe-accent-contrast: #ffffff;
	--rokh-pe-sale: #b91c1c;
	--rokh-pe-danger: #b91c1c;
	--rokh-pe-success: #15803d;
	--rokh-pe-radius: 6px;
	--rokh-pe-control-radius: 6px;
	--rokh-pe-gap: 8px;
	--rokh-pe-font-size: 1rem;
	--rokh-pe-line-height: 1.4;
	--rokh-pe-focus-ring: 2px solid currentColor;
	--rokh-pe-icon-size: 24px;
	--rokh-pe-icon-gap: 8px;
	--rokh-pe-transition: 150ms ease;
	box-sizing: border-box;
	color: var(--rokh-pe-text);
	font-size: var(--rokh-pe-font-size);
	line-height: var(--rokh-pe-line-height);
}

.rokh-pe *,
.rokh-pe *::before,
.rokh-pe *::after {
	box-sizing: border-box;
}

.rokh-pe [hidden] {
	display: none !important;
}

.rokh-pe :focus-visible {
	outline: var(--rokh-pe-focus-ring);
	outline-offset: 2px;
}

/* -------------------------------------------------------------------------
 * Variations
 * ---------------------------------------------------------------------- */
.rokh-pe-variations {
	display: grid;
	gap: calc(var(--rokh-pe-gap) * 1.5);
	width: 100%;
}

.rokh-pe-variations__group {
	display: grid;
	gap: var(--rokh-pe-gap);
	min-width: 0;
}

.rokh-pe-variations__label {
	color: var(--rokh-pe-text);
	font-size: 0.875em;
	font-weight: 600;
}

.rokh-pe-variations__options {
	display: flex;
	flex-wrap: wrap;
	gap: var(--rokh-pe-gap);
}

.rokh-pe-variations__option {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.4em;
	min-width: 2.5em;
	padding: 0.5em 0.85em;
	border: 1px solid var(--rokh-pe-border);
	border-radius: var(--rokh-pe-control-radius);
	background: var(--rokh-pe-surface);
	color: var(--rokh-pe-text);
	font: inherit;
	line-height: 1.2;
	text-align: center;
	cursor: pointer;
	transition: border-color var(--rokh-pe-transition), background-color var(--rokh-pe-transition), color var(--rokh-pe-transition), opacity var(--rokh-pe-transition);
}

.rokh-pe-variations__option:hover:not(:disabled):not(.is-disabled),
.rokh-pe-variations__option:focus-visible:not(:disabled):not(.is-disabled) {
	border-color: var(--rokh-pe-accent);
}

.rokh-pe-variations__option--active,
.rokh-pe-variations__option.is-active {
	border-color: var(--rokh-pe-accent);
	background: var(--rokh-pe-accent);
	color: var(--rokh-pe-accent-contrast);
}

.rokh-pe-variations__option--inactive,
.rokh-pe-variations__option.is-inactive {
	background: var(--rokh-pe-surface);
	color: var(--rokh-pe-text);
}

.rokh-pe-variations__option:disabled,
.rokh-pe-variations__option.is-disabled,
.rokh-pe-variations__option[aria-disabled="true"] {
	opacity: 0.42;
	cursor: not-allowed;
	text-decoration: line-through;
}

.rokh-pe-variations__option.is-unavailable {
	opacity: 0.6;
	border-style: dashed;
}

.rokh-pe-variations__option.is-out-of-stock {
	opacity: 0.6;
	border-style: dashed;
}

.rokh-pe-variations__option.is-conflicting {
	opacity: 0.8;
	border-style: dashed;
}

.rokh-pe-variations__option.is-conflicting:hover:not(:disabled) {
	opacity: 1;
}

.rokh-pe-variations__option-label {
	pointer-events: none;
}

.rokh-pe-variations--labels-hide .rokh-pe-variations__label {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Dropdown */
.rokh-pe-variations__select-wrap {
	position: relative;
	width: 100%;
}

.rokh-pe-variations__select {
	width: 100%;
	min-height: 2.75em;
	padding-block: 0.5em;
	padding-inline: 0.75em 2.25em;
	border: 1px solid var(--rokh-pe-border);
	border-radius: var(--rokh-pe-control-radius);
	background: var(--rokh-pe-surface);
	color: var(--rokh-pe-text);
	font: inherit;
	line-height: 1.3;
	appearance: none;
	cursor: pointer;
}

.rokh-pe-variations__select:hover {
	border-color: var(--rokh-pe-accent);
}

.rokh-pe-variations__select:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

.rokh-pe-variations__select-arrow {
	position: absolute;
	top: 50%;
	inset-inline-end: 0.9em;
	width: 0;
	height: 0;
	border-inline-start: 0.35em solid transparent;
	border-inline-end: 0.35em solid transparent;
	border-top: 0.4em solid currentColor;
	transform: translateY(-50%);
	pointer-events: none;
	opacity: 0.7;
}

.rokh-pe-variations__option--select.is-disabled {
	color: var(--rokh-pe-muted);
}

/* Checkbox-style radio */
.rokh-pe-variations__option--checkbox {
	justify-content: flex-start;
	padding: 0.45em 0.75em;
	border-color: transparent;
	background: transparent;
}

.rokh-pe-variations__option--checkbox:hover:not(.is-disabled) {
	border-color: var(--rokh-pe-border);
}

.rokh-pe-variations__option--checkbox.is-active {
	background: transparent;
	color: var(--rokh-pe-text);
	border-color: transparent;
}

.rokh-pe-variations__input {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.rokh-pe-variations__checkbox {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 1.15em;
	height: 1.15em;
	border: 1px solid var(--rokh-pe-border);
	border-radius: 3px;
	background: var(--rokh-pe-surface);
	transition: border-color var(--rokh-pe-transition), background-color var(--rokh-pe-transition);
}

.rokh-pe-variations__input:checked + .rokh-pe-variations__checkbox,
.rokh-pe-variations__option--checkbox.is-active .rokh-pe-variations__checkbox {
	border-color: var(--rokh-pe-accent);
	background: var(--rokh-pe-accent);
}

.rokh-pe-variations__input:focus-visible + .rokh-pe-variations__checkbox {
	outline: var(--rokh-pe-focus-ring);
	outline-offset: 2px;
}

.rokh-pe-variations__checkmark {
	display: none;
	width: 0.35em;
	height: 0.6em;
	border: solid var(--rokh-pe-accent-contrast);
	border-width: 0 2px 2px 0;
	transform: rotate(45deg) translate(-0.03em, -0.08em);
}

.rokh-pe-variations__input:checked + .rokh-pe-variations__checkbox .rokh-pe-variations__checkmark,
.rokh-pe-variations__option--checkbox.is-active .rokh-pe-variations__checkmark {
	display: block;
}

.rokh-pe-variations__option--checkbox.is-disabled {
	opacity: 0.42;
	text-decoration: line-through;
	cursor: not-allowed;
}

/* -------------------------------------------------------------------------
 * Price
 * ---------------------------------------------------------------------- */
.rokh-pe-price {
	display: inline-flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 0.35em;
}

.rokh-pe-price__value {
	display: inline-flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 0.35em;
}

.rokh-pe-price__normal,
.rokh-pe-price__sale {
	color: var(--rokh-pe-text);
	font-weight: 600;
}

.rokh-pe-price__regular {
	color: var(--rokh-pe-muted);
	font-weight: 400;
	text-decoration: line-through;
}

.rokh-pe-price__sale {
	color: var(--rokh-pe-sale);
}

.rokh-pe-price__currency {
	white-space: nowrap;
}

.rokh-pe-price.is-loading {
	opacity: 0.65;
}

.rokh-pe-price__loading {
	display: none;
	width: 0.9em;
	height: 0.9em;
	border: 2px solid currentColor;
	border-inline-end-color: transparent;
	border-radius: 50%;
	animation: rokh-pe-spin 700ms linear infinite;
}

.rokh-pe-price.is-loading .rokh-pe-price__loading {
	display: inline-block;
}

.rokh-pe-price.is-invalid {
	opacity: 0.7;
}

.rokh-pe-price--variable:not(.is-valid) .rokh-pe-price__value {
	min-height: 0;
}

/* -------------------------------------------------------------------------
 * Discount
 * ---------------------------------------------------------------------- */
.rokh-pe-discount {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.15em;
	padding: 0.2em 0.55em;
	border-radius: 999px;
	background: var(--rokh-pe-sale);
	color: var(--rokh-pe-accent-contrast);
	font-size: 0.875em;
	font-weight: 700;
	line-height: 1.4;
}

.rokh-pe-discount__value {
	display: inline-flex;
	align-items: baseline;
	gap: 0.05em;
}

.rokh-pe-discount__number {
	font-weight: 700;
}

.rokh-pe-discount__symbol {
	font-size: 0.85em;
}

.rokh-pe-discount.is-hidden {
	display: none;
}

.rokh-pe-discount__loading {
	display: none;
	width: 0.8em;
	height: 0.8em;
	border: 2px solid currentColor;
	border-inline-end-color: transparent;
	border-radius: 50%;
	animation: rokh-pe-spin 700ms linear infinite;
}

.rokh-pe-discount.is-loading .rokh-pe-discount__loading {
	display: inline-block;
}

/* -------------------------------------------------------------------------
 * Quantity
 * ---------------------------------------------------------------------- */
.rokh-pe-quantity {
	display: inline-flex;
	align-items: stretch;
	max-width: 100%;
	border: 1px solid var(--rokh-pe-border);
	border-radius: var(--rokh-pe-control-radius);
	background: var(--rokh-pe-surface);
	overflow: hidden;
}

.rokh-pe-quantity__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.6em;
	min-height: 2.75em;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--rokh-pe-text);
	font: inherit;
	font-size: 1.1em;
	line-height: 1;
	cursor: pointer;
	transition: background-color var(--rokh-pe-transition), opacity var(--rokh-pe-transition);
}

.rokh-pe-quantity__button:hover:not(:disabled) {
	background: rgba(0, 0, 0, 0.05);
	background: color-mix(in srgb, var(--rokh-pe-accent) 8%, transparent);
}

.rokh-pe-quantity__button:focus-visible {
	outline-offset: -3px;
}

.rokh-pe-quantity__button:disabled,
.rokh-pe-quantity__button.is-disabled {
	opacity: 0.35;
	cursor: not-allowed;
}

.rokh-pe-quantity__input {
	width: 4.5em;
	min-width: 0;
	min-height: 2.75em;
	padding: 0.25em;
	border: 0;
	border-inline-start: 1px solid var(--rokh-pe-border);
	border-inline-end: 1px solid var(--rokh-pe-border);
	border-radius: 0;
	background: transparent;
	color: var(--rokh-pe-text);
	font: inherit;
	line-height: 1.2;
	text-align: center;
	appearance: textfield;
}

.rokh-pe-quantity__input::-webkit-outer-spin-button,
.rokh-pe-quantity__input::-webkit-inner-spin-button {
	margin: 0;
	appearance: none;
}

.rokh-pe-quantity__input:focus {
	outline: none;
	box-shadow: inset 0 0 0 2px var(--rokh-pe-accent);
}

.rokh-pe-quantity.is-disabled {
	opacity: 0.55;
}

.rokh-pe-quantity.is-min .rokh-pe-quantity__button--minus,
.rokh-pe-quantity.is-max .rokh-pe-quantity__button--plus {
	opacity: 0.35;
}

/* -------------------------------------------------------------------------
 * Add to cart
 * ---------------------------------------------------------------------- */
.rokh-pe-add-to-cart {
	display: block;
}

.rokh-pe-add-to-cart__form {
	display: inline-flex;
	max-width: 100%;
	margin: 0;
}

.rokh-pe-add-to-cart__button {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--rokh-pe-icon-gap);
	max-width: 100%;
	padding: 0.75em 1.25em;
	border: 1px solid var(--rokh-pe-accent);
	border-radius: var(--rokh-pe-control-radius);
	background: var(--rokh-pe-accent);
	color: var(--rokh-pe-accent-contrast);
	font: inherit;
	font-weight: 600;
	line-height: 1.3;
	text-align: center;
	cursor: pointer;
	transition: opacity var(--rokh-pe-transition), background-color var(--rokh-pe-transition), color var(--rokh-pe-transition), border-color var(--rokh-pe-transition);
}

.rokh-pe-add-to-cart__button:hover:not(:disabled) {
	opacity: 0.9;
}

.rokh-pe-add-to-cart__button:active:not(:disabled) {
	transform: translateY(1px);
}

.rokh-pe-add-to-cart__button:disabled,
.rokh-pe-add-to-cart__button.is-disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

.rokh-pe-add-to-cart__button.is-loading {
	cursor: wait;
}

.rokh-pe-add-to-cart__button.is-success {
	border-color: var(--rokh-pe-success);
	background: var(--rokh-pe-success);
}

.rokh-pe-add-to-cart__button.is-error {
	border-color: var(--rokh-pe-danger);
	background: var(--rokh-pe-danger);
}

.rokh-pe-add-to-cart__icon {
	display: block;
	flex: 0 0 auto;
	width: var(--rokh-pe-icon-size);
	height: var(--rokh-pe-icon-size);
	max-width: var(--rokh-pe-icon-size);
	max-height: var(--rokh-pe-icon-size);
	object-fit: contain;
}

.rokh-pe-add-to-cart__text {
	display: inline-block;
}

.rokh-pe-add-to-cart--icon-only .rokh-pe-add-to-cart__button {
	padding: 0.75em;
}

/* Physical icon placement in RTL layouts. */
html[dir="rtl"] .rokh-pe-add-to-cart--icon-right .rokh-pe-add-to-cart__icon {
	order: -1;
}

html[dir="rtl"] .rokh-pe-add-to-cart--icon-left .rokh-pe-add-to-cart__icon {
	order: 1;
}


.rokh-pe-add-to-cart__spinner {
	display: inline-block;
	width: 1em;
	height: 1em;
	border: 2px solid currentColor;
	border-inline-end-color: transparent;
	border-radius: 50%;
	animation: rokh-pe-spin 700ms linear infinite;
}

.rokh-pe-add-to-cart__notice {
	margin-block-start: 0.65em;
	padding: 0.6em 0.75em;
	border-inline-start: 3px solid var(--rokh-pe-border);
	background: rgba(0, 0, 0, 0.04);
	background: color-mix(in srgb, currentColor 5%, transparent);
	color: var(--rokh-pe-text);
	font-size: 0.875em;
	line-height: 1.5;
}

.rokh-pe-add-to-cart__notice.is-error {
	border-inline-start-color: var(--rokh-pe-danger);
	color: var(--rokh-pe-danger);
}

.rokh-pe-add-to-cart__notice.is-success {
	border-inline-start-color: var(--rokh-pe-success);
	color: var(--rokh-pe-success);
}

.rokh-pe-add-to-cart.is-loading .rokh-pe-add-to-cart__spinner {
	display: inline-block;
}

.rokh-pe-add-to-cart.is-loading-variation .rokh-pe-add-to-cart__button {
	opacity: 0.65;
	cursor: progress;
}

.rokh-pe-add-to-cart.is-out-of-stock .rokh-pe-add-to-cart__button {
	opacity: 0.45;
}

/* -------------------------------------------------------------------------
 * Animation and motion preferences
 * ---------------------------------------------------------------------- */
@keyframes rokh-pe-spin {
	to {
		transform: rotate(360deg);
	}
}

@media (prefers-reduced-motion: reduce) {
	.rokh-pe *,
	.rokh-pe *::before,
	.rokh-pe *::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}
