/* =====================================================
   SALOMA PRODUCT-SPECIFIC DESIGN IMAGE SWATCHES
   ===================================================== */

.saloma-colorway-swatches {
	margin: 0 0 22px 0;
}

.saloma-colorway-heading {
	margin: 0 0 10px 0;
	color: #111111;
	font-size: 13px;
	line-height: 1.4;
}

.saloma-colorway-heading-label {
	font-weight: 600;
}

.saloma-colorway-current {
	font-weight: 400;
}

.saloma-colorway-options {
	display: flex;
	flex-wrap: wrap;
	gap: 9px;
}

button.saloma-colorway-swatch {
	position: relative;

	width: 62px !important;
	height: 76px !important;
	min-width: 62px !important;

	margin: 0 !important;
	padding: 3px !important;

	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;

	background: #ffffff !important;
	color: #111111 !important;

	border: 1px solid #d5d5d5 !important;
	border-radius: 0 !important;

	box-shadow: none !important;
	overflow: hidden !important;

	cursor: pointer !important;
	opacity: 1 !important;

	transition:
		border-color .18s ease,
		box-shadow .18s ease,
		opacity .18s ease !important;
}

button.saloma-colorway-swatch img {
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	max-height: none !important;

	margin: 0 !important;
	padding: 0 !important;

	display: block !important;
	object-fit: cover !important;

	border: 0 !important;
	border-radius: 0 !important;

	transform: none !important;
}

/* Available */
button.saloma-colorway-swatch:not(.is-disabled):hover {
	border-color: #777777 !important;
}

/* Selected = premium black double outline */
button.saloma-colorway-swatch.is-selected {
	border-color: #111111 !important;
	box-shadow:
		0 0 0 1px #111111,
		inset 0 0 0 2px #ffffff !important;
}

/* Unavailable for current Size / all relevant combinations out of stock */
button.saloma-colorway-swatch.is-disabled,
button.saloma-colorway-swatch:disabled {
	opacity: .28 !important;
	cursor: not-allowed !important;
	pointer-events: none !important;
	filter: grayscale(.35) !important;
}

.saloma-colorway-unavailable-mark {
	display: none;
	position: absolute;
	left: 6px;
	right: 6px;
	top: 50%;
	height: 1px;
	background: #111111;
	transform: rotate(-45deg);
	transform-origin: center;
}

button.saloma-colorway-swatch.is-disabled .saloma-colorway-unavailable-mark {
	display: block;
}

/*
 * Hide the original Colorway row generated by WooCommerce OR by
 * Variation Swatches for WooCommerce. We add this class only after
 * JS confirms the native Colorway select exists.
 */
.saloma-colorway-native-row-hidden {
	display: none !important;
}

@media (max-width: 768px) {
	.saloma-colorway-swatches {
		margin-bottom: 18px;
	}

	.saloma-colorway-options {
		gap: 7px;
	}

	button.saloma-colorway-swatch {
		width: 56px !important;
		height: 68px !important;
		min-width: 56px !important;
	}
}


/* Variation Swatches for WooCommerce still controls global Size and global Color.
   Only the local Colorway variation row is hidden/replaced by these image swatches. */


/* =====================================================
   SIZE AVAILABILITY AFTER COLORWAY SELECTION
   Works with GetWooPlugins Variation Swatches for WooCommerce.
   ===================================================== */
.single-product form.variations_form .variable-item.saloma-size-unavailable,
.single-product form.variations_form [role="radio"].saloma-size-unavailable {
	opacity: .28 !important;
	filter: grayscale(.35) !important;
	cursor: not-allowed !important;
	pointer-events: none !important;
	position: relative !important;
}

.single-product form.variations_form .variable-item.saloma-size-unavailable::after,
.single-product form.variations_form [role="radio"].saloma-size-unavailable::after {
	content: "" !important;
	position: absolute !important;
	left: 18% !important;
	right: 18% !important;
	top: 50% !important;
	height: 1px !important;
	background: #111111 !important;
	transform: rotate(-45deg) !important;
	transform-origin: center !important;
	z-index: 4 !important;
}


/* v2.4: Blocksy Flexy main-gallery preview. Anchored to the MAIN slider only;
   it cannot cover thumbnails or intercept zoom/touch navigation. */
.single-product .ct-product-gallery .flexy-container {
    position: relative;
}
.single-product .ct-product-gallery .flexy-container > .saloma-colorway-gallery-preview {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    display: block !important;
    overflow: hidden !important;
    z-index: 5 !important;
    pointer-events: none !important;
    background: #fff !important;
}
.single-product .ct-product-gallery .flexy-container > .saloma-colorway-gallery-preview img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: contain !important;
    object-position: center center !important;
    opacity: 1 !important;
}


/* v2.6 — Under-Size Clear link (keeps original reset behavior). */
.saloma-colorway-heading {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px;
}
.single-product .saloma-colorway-clear-row {
    display: block;
    text-align: left;
    margin: 6px 0 18px;
    padding: 0;
    line-height: 1.4;
}
.single-product .saloma-colorway-clear-row[hidden] {
    display: none !important;
}
.single-product .saloma-colorway-clear-row button.saloma-colorway-clear {
    display: inline-block;
    margin: 0 !important;
    padding: 0 !important;
    min-height: auto !important;
    width: auto !important;
    height: auto !important;
    line-height: 1.4 !important;
    background: none !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    color: #555 !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    text-decoration: underline !important;
    text-underline-offset: 3px;
    cursor: pointer !important;
}
.single-product .saloma-colorway-clear-row button.saloma-colorway-clear:hover {
    color: #111 !important;
}
.single-product .saloma-colorway-clear-row button.saloma-colorway-clear[hidden] {
    display: none !important;
}

/* v2.7 - Keep Clear close to Size swatches, without altering other controls. */
.single-product form.variations_form td.value > .saloma-colorway-clear-row {
    display: block !important;
    clear: both;
    width: 100%;
    flex: 0 0 100%;
    margin: 7px 0 0 !important;
    padding: 0 !important;
    line-height: 1.4;
}
.single-product form.variations_form td.value > .saloma-colorway-clear-row[hidden] {
    display: none !important;
}
/* Fallback when the Size cell isn't present: remove table's bottom gap. */
.single-product form.variations_form .saloma-colorway-swatches + table.variations {
    margin-bottom: 0 !important;
}
