/* Darvoto Variation Swatches v1.8.2
 * Цветовете се сменят от променливите по-долу.
 */
.dvs-active {
	--dvs-accent: #8a6a4b;        /* кафяво като логото */
	--dvs-accent-soft: #f7f1ea;
	--dvs-border: #e4dbd0;
	--dvs-text: #2b2b2b;
	--dvs-muted: #8a8a8a;
	--dvs-radius: 12px;
}

/* ================================================================
 * 1) Таблицата на вариациите – блоково, подравнено вляво
 * ================================================================ */
.dvs-active table.variations,
.dvs-active table.variations tbody,
.dvs-active table.variations tr.dvs-row,
.dvs-active table.variations tr.dvs-row > th,
.dvs-active table.variations tr.dvs-row > td {
	display: block !important;
	width: 100% !important;
	border: 0 !important;
	padding: 0 !important;
	margin: 0;
	background: none !important;
	text-align: left !important;
}
.dvs-active table.variations tr.dvs-row { margin-bottom: 22px !important; }
.dvs-active table.variations tr.dvs-row > .label,
.dvs-active table.variations tr.dvs-row > .dvs-label {
	margin-bottom: 10px !important;
	line-height: 1.3;
}
.dvs-active .dvs-label .dvs-orig { display: none !important; }
.dvs-active .dvs-label .dvs-title {
	font-weight: 600;
	color: var(--dvs-text);
}
.dvs-active .dvs-chosen {
	margin-left: 6px;
	font-weight: 400;
	color: var(--dvs-muted);
}
.dvs-active .dvs-chosen:not(:empty)::before { content: "— "; }

/* ================================================================
 * 2) Скриваме чуждото: оригиналния select, обвивките и swatch-овете
 *    на Iconic, стрелките на Divi, избраната стойност, която Iconic
 *    добавя към заглавието. WooCommerce пак работи с скрития select.
 * ================================================================ */
.dvs-active td.dvs-cell > *:not(.dvs-swatches):not(.reset_variations),
.dvs-active .dvs-cell > *:not(.dvs-swatches):not(.reset_variations) {
	display: none !important;
}
.dvs-active .dvs-cell::before,
.dvs-active .dvs-cell::after,
.dvs-active .dvs-swatches span::before,
.dvs-active .dvs-swatches span::after {
	content: none !important;
	display: none !important;
}
.dvs-active select.dvs-hidden {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	opacity: 0 !important;
	pointer-events: none !important;
	overflow: hidden !important;
	clip: rect(0 0 0 0) !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
}

.dvs-active .dvs-cell .reset_variations {
	display: inline-block;
	margin-top: 10px;
	font-size: 13px;
	color: var(--dvs-muted);
	text-decoration: underline;
}

/* ================================================================
 * 3) Общо
 * ================================================================ */
.dvs-swatches {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: flex-start;
}
.dvs-item {
	-webkit-appearance: none;
	appearance: none;
	position: relative;
	margin: 0;
	font: inherit;
	line-height: 1.2;
	color: var(--dvs-text);
	background: #fff;
	border: 1.5px solid var(--dvs-border);
	border-radius: var(--dvs-radius);
	box-shadow: none;
	text-transform: none;
	letter-spacing: normal;
	cursor: pointer;
	transition: border-color .15s, box-shadow .15s, background-color .15s;
	-webkit-tap-highlight-color: transparent;
}
.dvs-item::before,
.dvs-item::after { content: none; }
.dvs-item:focus-visible { outline: 2px solid var(--dvs-accent); outline-offset: 2px; }

/* ================================================================
 * 4) Бутони – разфасовка
 * ================================================================ */
.dvs-type-button .dvs-item {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: center;
	gap: 3px;
	flex: 0 1 140px;
	min-width: 110px;
	min-height: 62px;
	padding: 10px 14px;
	text-align: left;
}
.dvs-type-button .dvs-item:hover { border-color: var(--dvs-accent); }
.dvs-type-button .dvs-name {
	font-size: 17px;
	font-weight: 700;
}
.dvs-type-button .dvs-price {
	font-size: 14px;
	color: var(--dvs-muted);
}
.dvs-type-button .dvs-price:empty,
.dvs-type-button .dvs-save:empty { display: none; }
.dvs-type-button .dvs-save {
	margin-top: 2px;
	padding: 2px 7px;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.3;
	color: #2e7d32;
	background: #e9f5ea;
	border-radius: 20px;
}
.dvs-type-button .dvs-item.is-oos .dvs-save { display: none; }

/* „Най-купуван“ – лента върху горния ръб */
.dvs-type-button { padding-top: 10px; }
.dvs-type-button .dvs-badge {
	position: absolute;
	top: -10px;
	left: 12px;
	padding: 2px 8px;
	font-size: 11px;
	font-weight: 700;
	line-height: 1.5;
	letter-spacing: .02em;
	white-space: nowrap;
	color: #fff;
	background: var(--dvs-accent);
	border-radius: 20px;
}
.dvs-type-button .dvs-item.is-oos .dvs-badge { background: #b0a79c; }

/* Обща цена при количество > 1 */
.dvs-active .dvs-total {
	margin: 6px 0 12px;
	font-size: 15px;
	color: var(--dvs-muted);
	text-align: right;
}
.dvs-active .dvs-total[hidden] { display: none !important; }
.dvs-active .dvs-total-sum {
	font-size: 18px;
	color: var(--dvs-text);
}
.dvs-type-button .dvs-price del {
	margin-right: 2px;
	font-size: 12px;
	opacity: .8;
}

.dvs-type-button .dvs-item.is-selected {
	border-color: var(--dvs-accent);
	background: var(--dvs-accent-soft);
	box-shadow: inset 0 0 0 1px var(--dvs-accent);
}
.dvs-type-button .dvs-item.is-selected .dvs-price { color: var(--dvs-text); }

/* отметка в ъгъла на избрания */
.dvs-type-button .dvs-item.is-selected::after {
	content: "";
	position: absolute;
	top: 8px;
	right: 8px;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: var(--dvs-accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 8.2l2.3 2.3 4.7-4.9' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 16px no-repeat;
}

.dvs-type-button .dvs-item.is-oos {
	background: #faf9f7;
	border-style: dashed;
	cursor: not-allowed;
}
.dvs-type-button .dvs-item.is-oos .dvs-name { color: var(--dvs-muted); }
.dvs-type-button .dvs-item.is-oos .dvs-price { font-size: 12px; }
.dvs-type-button .dvs-item.is-unavailable:not(.is-oos) { opacity: .5; }

/* ================================================================
 * 5) Цветни кръгчета – пигмент (снимката на вариацията)
 * ================================================================ */
.dvs-type-color { gap: 12px; }
.dvs-type-color .dvs-item {
	padding: 3px;
	border: 2px solid transparent;
	border-radius: 50%;
	background: transparent;
}
.dvs-type-color .dvs-item:hover { border-color: var(--dvs-border); }
.dvs-type-color .dvs-item.is-selected { border-color: var(--dvs-accent); }

.dvs-dot {
	display: block;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background-color: #ddd;
	background-size: cover;
	background-position: center;
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .1);
}
.dvs-dot--empty {
	background: repeating-linear-gradient(45deg, #eee 0 6px, #ddd 6px 12px);
}

/* изчерпан цвят – диагонална черта */
.dvs-type-color .dvs-item.is-oos .dvs-dot,
.dvs-type-color .dvs-item.is-unavailable .dvs-dot { opacity: .4; }
.dvs-type-color .dvs-item.is-oos::after {
	content: "";
	position: absolute;
	left: 50%;
	top: 6px;
	bottom: 6px;
	width: 2px;
	background: #b0a79c;
	transform: translateX(-50%) rotate(45deg);
}

/* ================================================================
 * 6) Мобилни
 * ================================================================ */
@media (max-width: 600px) {
	.dvs-type-button .dvs-item { flex: 1 1 calc(50% - 5px); }
	.dvs-dot { width: 42px; height: 42px; }
}

/* ================================================================
 * 7) „Избери N“
 * ================================================================ */
.dvs-pick {
	margin: 4px 0 18px;
	text-align: left;
}
.dvs-pick-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 10px;
}
.dvs-pick-head .dvs-title { font-weight: 600; color: var(--dvs-text); }
.dvs-pick-counter {
	flex: none;
	padding: 2px 10px;
	font-size: 13px;
	font-weight: 700;
	color: var(--dvs-accent);
	background: var(--dvs-accent-soft);
	border-radius: 20px;
}
.dvs-pick-counter.is-done { color: #fff; background: #2e7d32; }

.dvs-pick-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
	gap: 12px 8px;
}
.dvs-pick-item {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	text-align: center;
}
.dvs-pick-add {
	-webkit-appearance: none;
	appearance: none;
	position: relative;
	margin: 0;
	padding: 3px;
	background: transparent;
	border: 2px solid transparent;
	border-radius: 50%;
	cursor: pointer;
	transition: border-color .15s, opacity .15s;
	-webkit-tap-highlight-color: transparent;
}
.dvs-pick-add:hover { border-color: var(--dvs-border); }
.dvs-pick-add:focus-visible { outline: 2px solid var(--dvs-accent); outline-offset: 2px; }
.dvs-pick-item.is-on .dvs-pick-add { border-color: var(--dvs-accent); }
.dvs-pick-item.is-locked .dvs-pick-add { opacity: .35; cursor: not-allowed; }
.dvs-pick-add .dvs-dot { width: 48px; height: 48px; }

.dvs-pick-n {
	position: absolute;
	right: -4px;
	bottom: -2px;
	min-width: 22px;
	padding: 1px 5px;
	font-size: 11px;
	font-weight: 700;
	line-height: 18px;
	color: #fff;
	background: var(--dvs-accent);
	border: 2px solid #fff;
	border-radius: 20px;
}
.dvs-pick-n:empty { display: none; }

.dvs-pick-name {
	font-size: 12px;
	line-height: 1.25;
	color: var(--dvs-text);
	word-break: break-word;
}
.dvs-pick-minus {
	-webkit-appearance: none;
	appearance: none;
	position: absolute;
	top: -4px;
	left: calc(50% - 34px);
	display: none;
	width: 22px;
	height: 22px;
	margin: 0;
	padding: 0;
	font-size: 15px;
	line-height: 18px;
	color: var(--dvs-text);
	background: #fff;
	border: 1.5px solid var(--dvs-border);
	border-radius: 50%;
	cursor: pointer;
}
.dvs-pick-item.is-on .dvs-pick-minus { display: block; }

.dvs-pick-chosen {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	min-height: 28px;
	margin-top: 12px;
}
.dvs-chip {
	-webkit-appearance: none;
	appearance: none;
	margin: 0;
	padding: 3px 10px;
	font: inherit;
	font-size: 13px;
	color: var(--dvs-text);
	background: var(--dvs-accent-soft);
	border: 1px solid var(--dvs-border);
	border-radius: 20px;
	cursor: pointer;
}
.dvs-chip:hover { border-color: var(--dvs-accent); }
.dvs-pick-left { font-size: 13px; color: var(--dvs-muted); }

.dvs-pick-msg {
	margin-top: 8px;
	font-size: 14px;
	font-weight: 600;
	color: #c62828;
}
.dvs-pick-msg[hidden] { display: none !important; }
.dvs-pick.is-shake { animation: dvs-shake .35s; }
@keyframes dvs-shake {
	0%, 100% { transform: none; }
	25% { transform: translateX(-6px); }
	75% { transform: translateX(6px); }
}

.dvs-active.dvs-pick-incomplete .single_add_to_cart_button { opacity: .55; }

/* Цена на пигмента, сума на комплекта, изчерпан пигмент */
.dvs-pick-price { font-size: 11.5px; color: var(--dvs-muted); }
.dvs-pick-item.is-oos .dvs-pick-add { opacity: .35; cursor: not-allowed; }
.dvs-pick-item.is-oos .dvs-pick-name { color: var(--dvs-muted); text-decoration: line-through; }
.dvs-pick-name {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

@media (max-width: 600px) {
	.dvs-pick-grid { grid-template-columns: repeat(4, 1fr); }
	.dvs-pick-add .dvs-dot { width: 44px; height: 44px; }
}
