/* =========================================================
   ماژول: سواچ رنگ/تصویر محصولات متغیر
   ========================================================= */

.mytheme-swatch-list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.mytheme-swatch {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: #fff;
	border: 2px solid var(--color-border);
	border-radius: var(--radius);
	cursor: pointer;
	padding: 0;
	transition: border-color var(--transition), opacity var(--transition);
}

.mytheme-swatch:hover { border-color: #bbb; }

.mytheme-swatch.is-selected {
	border-color: var(--color-primary);
}

.mytheme-swatch.is-disabled {
	opacity: 0.35;
	cursor: not-allowed;
	position: relative;
}
.mytheme-swatch.is-disabled::after {
	content: "";
	position: absolute;
	inset: 0;
	background: repeating-linear-gradient(
		135deg,
		transparent,
		transparent 3px,
		rgba(0, 0, 0, 0.25) 3px,
		rgba(0, 0, 0, 0.25) 4px
	);
	border-radius: inherit;
}

/* رنگ */
.mytheme-swatch--color {
	width: 52px;
	height: 52px;
	border-radius: 12px;
	padding: 2px;
	box-sizing: border-box;
}
.mytheme-swatch--color.is-selected { padding: 2px; border-width: 3px; }
.mytheme-swatch__color {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: 9px;
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

/* تصویر */
.mytheme-swatch--image {
	width: 52px;
	height: 52px;
	padding: 2px;
	overflow: hidden;
	box-sizing: border-box;
}
.mytheme-swatch--image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: calc(var(--radius) - 2px);
}

/* متن (وقتی رنگ/تصویری تعریف نشده - مثلاً سایز) */
.mytheme-swatch--text {
	width: 52px;
	height: 52px;
	min-width: 52px;
	padding: 4px;
	box-sizing: border-box;
}
.mytheme-swatch__text { font-size: 13px; font-weight: 600; }
.mytheme-swatch--text.is-selected .mytheme-swatch__text { color: var(--color-primary); }

/* Label swatches v2 — all variable attributes */
.single-product .variations .label label{font-weight:800;color:#263027;font-size:14px;}
.single-product .mytheme-swatches{width:100%;}
.single-product .mytheme-swatch-list{gap:9px;align-items:center;}
.single-product .mytheme-swatch{min-height:42px;border-color:#dfe6dc;border-radius:50px;box-shadow:0 2px 7px rgba(26,45,29,.025);}
.single-product .mytheme-swatch--text{width:auto;min-width:0;height:auto;padding:8px 14px;background:#fff;white-space:nowrap;}
.single-product .mytheme-swatch--text:hover{border-color:var(--color-primary);background:#f8fbf5;}
.single-product .mytheme-swatches--has-visual .mytheme-swatch--text{width:52px;min-width:52px;height:52px;padding:4px;white-space:normal;}\n.single-product .mytheme-swatch--text.is-selected{background:#f1f7eb;border-color:var(--color-primary);box-shadow:0 0 0 3px rgba(142,213,87,.14);}
.single-product .mytheme-swatch--text.is-selected .mytheme-swatch__text{color:#344d28;}
.single-product .mytheme-swatch__text{font-size:12px;font-weight:700;white-space:normal;line-height:1.25;text-align:center;overflow:hidden;}
.single-product .mytheme-swatch--color{width:52px;min-width:52px;height:52px;background:#fff;border-radius:12px;}
.single-product .mytheme-swatch--image{width:52px;min-width:52px;height:52px;border-radius:12px;}
.single-product .mytheme-swatch.is-selected:after{content:'✓';position:absolute;inset:-7px -7px auto auto;width:19px;height:19px;display:grid;place-items:center;border-radius:50%;background:var(--color-primary);color:#fff;font-size:11px;font-weight:900;z-index:2;box-shadow:0 2px 7px rgba(0,0,0,.12);}
@media(max-width:600px){.single-product .mytheme-swatches{padding:0px}.single-product .mytheme-swatch-list{gap:7px}.single-product .mytheme-swatch--color{width:46px;min-width:46px;height:46px}.single-product .mytheme-swatch--text{width:auto;min-width:0;height:auto;padding:7px 12px;white-space:nowrap;}\n@media(max-width:600px){.single-product .mytheme-swatches--has-visual .mytheme-swatch--text{width:46px;min-width:46px;height:46px;padding:3px;white-space:normal;}}.single-product .mytheme-swatch--image{width:46px;min-width:46px;height:46px}}


/* Visual indication for variation options that cannot currently be selected. */
.mytheme-swatch.mytheme-swatch--disabled {
    opacity: .45;
    cursor: not-allowed;
    filter: grayscale(.25);
    position: relative;
}

.mytheme-swatch.mytheme-swatch--disabled::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 72%;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    transform: translate(-50%, -50%) rotate(-45deg);
    pointer-events: none;
}

.mytheme-swatch.mytheme-swatch--disabled::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 72%;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    transform: translate(-50%, -50%) rotate(45deg);
    pointer-events: none;
}

.mytheme-swatch.mytheme-swatch--disabled img,
.mytheme-swatch.mytheme-swatch--disabled .mytheme-swatch-inner {
    opacity: .7;
}

.mytheme-swatch.is-disabled::before,
.mytheme-swatch.is-disabled::after {
content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 51%;
    height: 2px;
    background: #ff0000;
    border-radius: 2px;
    pointer-events: none;
    z-index: 5;
}
.mytheme-swatch.is-disabled::before { transform: translate(-50%,-50%) rotate(45deg); }
.mytheme-swatch.is-disabled::after { transform: translate(-50%,-50%) rotate(-45deg); }





/* نام ویژگی انتخاب‌شده، مانند رنگ و سایز */
.single-product .km-selected-attribute-value {
    display: inline !important;
    margin-inline-start: 6px !important;
    color: #00857e !important;
    font-size: 13px !important;
    font-weight: 700 !important;
}

/* چیدمان سواچ‌های تصویری */
.single-product .mytheme-swatches .mytheme-swatch-list {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 5px !important;
    padding: 2px 0 !important;
    margin: 6px 0 12px !important;
}

.single-product .mytheme-swatches .mytheme-swatch.mytheme-swatch--image {
    position: relative !important;
    display: inline-flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: 95px !important;
    min-width: 95px !important;
    height: auto !important;
    padding: 3px !important;
    border-radius: 10px !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
    transition: background .2s ease, transform .2s ease, box-shadow .2s ease !important;
}

.single-product .mytheme-swatches .mytheme-swatch--image:hover {
    background: #f8fafc !important;
    transform: translateY(-2px) !important;
}

.single-product .mytheme-swatches .mytheme-swatch--image img {
    display: block !important;
         width: 100% !important;
        height: 100% !important;
    object-fit: cover !important;
    border: 0 !important;
    border-radius: 9px !important;
    background: #f8fafc !important;
    pointer-events: none !important;
}

.single-product .mytheme-swatches .mytheme-swatch--image.is-selected,
.single-product .mytheme-swatches .mytheme-swatch--image.km-swatch-active {
    border-color: #7ca1a9 !important;
    background: #f4f7f8 !important;
    box-shadow: 0 0 0 2px rgba(0, 133, 126, .20) !important;    font-family: inherit;
}

.single-product .mytheme-swatches .mytheme-swatch--image.is-selected::after,
.single-product .mytheme-swatches .mytheme-swatch--image.km-swatch-active::after {
    content: "✓" !important;
    position: absolute !important;
    top: 4px !important;
    right: 4px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 18px !important;
    height: 18px !important;
    border-radius: 50% !important;
    background: #799fa7 !important;
    color: #fff !important;
    font-size: 11px !important;
    font-weight: 900 !important;
    line-height: 1 !important;
}

.single-product .km-swatch-label {
    display: block !important;
    width: 100% !important;
    margin-top: 5px !important;
    overflow: hidden !important;
    color: #334155 !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    text-align: center !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    pointer-events: none !important;
	    font-family: 'PeydaFaNum';
}

.single-product .mytheme-swatches .mytheme-swatch--image.is-selected .km-swatch-label,
.single-product .mytheme-swatches .mytheme-swatch--image.km-swatch-active .km-swatch-label {
    color: #00857e !important;
    font-weight: 700 !important;
	    font-family: 'PeydaFaNum';
}

@media (max-width: 600px) {
    .single-product .mytheme-swatches .mytheme-swatch.mytheme-swatch--image {
width: 98px !important;
        min-width: 98px !important;
    }

    .single-product .mytheme-swatches .mytheme-swatch--image img {
         width: 100% !important;
        height: 100% !important;
    }
}
