/*
 * Woodmart resets table cells to display:block on narrow screens and applies
 * fixed widths to attribute headings. Keep the plugin's own four table layouts
 * intact; all rules are scoped to WGA's plugin-owned layout classes.
 */
.single-product .wd-wga-compat-wrapper {
	width: 100%;
	max-width: 100%;
	min-width: 0;
	text-align: start;
}

html[dir="rtl"] .single-product .wd-wga-compat-wrapper {
	direction: rtl;
	text-align: right;
}

html[dir="ltr"] .single-product .wd-wga-compat-wrapper {
	direction: ltr;
	text-align: left;
}

html[dir="rtl"] .single-product .wd-wga-compat-wrapper :is(th, td, p, span, b, ul, ol, li) {
	direction: rtl;
	text-align: right;
}

html[dir="ltr"] .single-product .wd-wga-compat-wrapper :is(th, td, p, span, b, ul, ol, li) {
	direction: ltr;
	text-align: left;
}

.single-product .wd-wga-compat-wrapper :is(th, td, p, span, b, ul, ol, li) {
	direction: inherit;
	text-align: inherit;
	white-space: normal;
	word-break: normal;
	overflow-wrap: break-word;
}

.single-product .wd-wga-compat-wrapper .wd-hint {
	margin-inline-start: 0.35em;
}

.single-product .wd-wga-compat-wrapper .wd-hint::before {
	content: "\f100";
	font-family: "woodmart-font";
	font-weight: 400 !important;
}

.single-product .wd-wga-compat-wrapper table[class*="woocommerce-group-attributes-layout-"] {
	width: 100%;
	max-width: 100%;
	min-width: 0;
	table-layout: auto;
	overflow: visible;
}

.single-product .wd-wga-compat-wrapper table[class*="woocommerce-group-attributes-layout-"] > tbody,
.single-product .wd-wga-compat-wrapper table[class*="woocommerce-group-attributes-layout-"] .attribute_name_values > tbody {
	display: table-row-group;
	margin: 0;
}

.single-product .wd-wga-compat-wrapper table[class*="woocommerce-group-attributes-layout-"] tr {
	display: table-row;
	margin: 0;
	padding: 0;
	border-bottom: 0;
}

.single-product .wd-wga-compat-wrapper table[class*="woocommerce-group-attributes-layout-"] th,
.single-product .wd-wga-compat-wrapper table[class*="woocommerce-group-attributes-layout-"] td {
	box-sizing: border-box;
	float: none;
	display: table-cell;
	height: auto;
	min-height: 0;
	padding-block: 0.625rem;
	padding-inline: 0.75rem;
	line-height: 1.5;
	white-space: normal;
	word-break: normal;
	overflow-wrap: break-word;
	vertical-align: middle;
}

.single-product .wd-wga-compat-wrapper table[class*="woocommerce-group-attributes-layout-"] :is(th, td) > :is(p, ul, ol) {
	margin-block: 0;
}

.single-product .wd-wga-compat-wrapper table[class*="woocommerce-group-attributes-layout-"] :is(.attribute_group_name, .attribute_name) {
	padding-inline-start: 1rem;
	padding-inline-end: 0.75rem;
}

.single-product .wd-wga-compat-wrapper table[class*="woocommerce-group-attributes-layout-"] .attribute_name_values {
	width: 100%;
	min-width: 0;
}

.single-product .wd-wga-compat-wrapper table.woocommerce-group-attributes-layout-4 > tbody > .attribute_group_row > .attribute_group_column {
	min-width: 0;
}

.single-product .wd-wga-compat-wrapper table.woocommerce-group-attributes-layout-3 .attribute_row > :is(th, td),
.single-product .wd-wga-compat-wrapper table.woocommerce-group-attributes-layout-3 .attribute_name_values {
	min-width: 0;
	max-width: 100%;
}

.single-product .wd-wga-compat-wrapper table.woocommerce-group-attributes-layout-3 > tbody > .attribute_row {
	display: flex;
	align-items: stretch;
	width: 100%;
	min-width: 0;
}

.single-product .wd-wga-compat-wrapper table.woocommerce-group-attributes-layout-3 > tbody > .attribute_row > .attribute_group_name {
	display: flex;
	align-items: center;
	flex: 0 0 180px;
}

.single-product .wd-wga-compat-wrapper table.woocommerce-group-attributes-layout-3 > tbody > .attribute_row > .attribute_name_values {
	flex: 1 1 0;
	width: auto;
}

.single-product .wd-wga-compat-wrapper table.woocommerce-group-attributes-layout-3 .woocommerce-group-attributes-accordion-values-open {
	display: block !important;
}

.single-product .wd-wga-compat-wrapper .attribute_group_name.woocommerce-group-attributes-accordion-name {
	position: relative;
	width: 180px;
	min-width: 180px;
	max-width: 180px;
	height: auto;
	white-space: normal;
	word-break: normal;
	overflow: visible;
	overflow-wrap: break-word;
	line-height: 1.5;
	padding-block: 0.625rem;
	padding-inline-start: 1rem;
	padding-inline-end: 2.25em;
}

.single-product .wd-wga-compat-wrapper .attribute_group_name.woocommerce-group-attributes-accordion-name .woocommerce-group-attributes-icon {
	position: absolute;
	inset-inline-end: 0.5em;
	top: 50%;
	float: none;
	margin: 0;
	transform: translateY(-50%);
	direction: ltr;
	line-height: 1;
}

@media (max-width: 750px) {
	.single-product .wd-wga-compat-wrapper table.woocommerce-group-attributes-layout-2 td,
	.single-product .wd-wga-compat-wrapper table.woocommerce-group-attributes-layout-2 th,
	.single-product .wd-wga-compat-wrapper table.woocommerce-group-attributes-layout-3 td,
	.single-product .wd-wga-compat-wrapper table.woocommerce-group-attributes-layout-3 th,
	.single-product .wd-wga-compat-wrapper table.woocommerce-group-attributes-layout-4 td,
	.single-product .wd-wga-compat-wrapper table.woocommerce-group-attributes-layout-4 th {
		display: block;
		width: 100%;
		min-width: 0;
		max-width: 100%;
	}

	.single-product .wd-wga-compat-wrapper table[class*="woocommerce-group-attributes-layout-"] :is(th, td) {
		padding-block: 0.625rem;
		padding-inline: 0.75rem;
	}

	.single-product .wd-wga-compat-wrapper table.woocommerce-group-attributes-layout-2 td.attribute_name,
	.single-product .wd-wga-compat-wrapper table.woocommerce-group-attributes-layout-2 td.attribute_value,
	.single-product .wd-wga-compat-wrapper table.woocommerce-group-attributes-layout-3 td.attribute_name,
	.single-product .wd-wga-compat-wrapper table.woocommerce-group-attributes-layout-3 td.attribute_value {
		float: inline-start;
		width: 50%;
	}

	.single-product .wd-wga-compat-wrapper table.woocommerce-group-attributes-layout-3 .woocommerce-group-attributes-accordion-values-open {
		display: block !important;
	}

	.single-product .wd-wga-compat-wrapper table.woocommerce-group-attributes-layout-3 > tbody > .attribute_row {
		flex-direction: column;
	}

	.single-product .wd-wga-compat-wrapper table.woocommerce-group-attributes-layout-3 > tbody > .attribute_row > .attribute_group_name,
	.single-product .wd-wga-compat-wrapper table.woocommerce-group-attributes-layout-3 > tbody > .attribute_row > .attribute_name_values {
		flex: 0 0 auto;
		width: 100%;
	}

	.single-product .wd-wga-compat-wrapper table.woocommerce-group-attributes-layout-3 .attribute_group_name.woocommerce-group-attributes-accordion-name {
		width: 100%;
		min-width: 0;
		max-width: 100%;
	}

}

/*
 * Digikala layout: retain the plugin-owned Style 1 semantic table markup and
 * present each specification as a flat, responsive key/value table. Surfaces
 * stay transparent and Woodmart border/text tokens provide subtle separation.
 * The plugin's generated custom stylesheet applies row colors with !important,
 * so the scoped color resets below must also use !important to win that cascade.
 */
.single-product.wd-wga-layout-digikala table.woocommerce-group-attributes-layout-1 {
	width: 100%;
	margin: 0;
	border: 0;
	border-collapse: collapse;
	border-spacing: 0;
	background-color: transparent !important;
}

.single-product.wd-wga-layout-digikala table.woocommerce-group-attributes-layout-1 > tbody > .attribute_group_row {
	display: table-row;
	background-color: transparent !important;
	color: inherit !important;
}

.single-product.wd-wga-layout-digikala table.woocommerce-group-attributes-layout-1 > tbody > .attribute_group_row > .attribute_group_name {
	position: relative;
	width: 100%;
	min-width: 0;
	max-width: none;
	padding-block: 1.5rem 0.75rem;
	padding-inline: 0;
	border: 0;
	border-bottom: 1px solid var(--brdcolor-gray-300);
	background-color: transparent !important;
	color: var(--wd-title-color) !important;
	font-size: clamp(1rem, 1.4vw, 1.125rem);
	font-weight: var(--wd-title-font-weight, 600);
	line-height: 1.7;
}

.single-product.wd-wga-layout-digikala table.woocommerce-group-attributes-layout-1 > tbody > .attribute_group_row > .attribute_group_name::after {
	position: absolute;
	inset-inline-start: 0;
	bottom: -1px;
	inline-size: 2.5rem;
	block-size: 0.125rem;
	margin: 0;
	border-radius: 0;
	background: var(--wd-primary-color);
	content: "";
}

.single-product.wd-wga-layout-digikala table.woocommerce-group-attributes-layout-1 > tbody > .attribute_row {
	display: table-row;
	background-color: transparent !important;
	color: inherit !important;
}

.single-product.wd-wga-layout-digikala table.woocommerce-group-attributes-layout-1 > tbody > .attribute_row.woocommerce-group-attributes-accordion-values:not(.woocommerce-group-attributes-accordion-values-open) {
	display: none;
}

.single-product.wd-wga-layout-digikala table.woocommerce-group-attributes-layout-1 > tbody > .attribute_row > td {
	display: table-cell;
	width: 100%;
	padding: 0;
	border: 0;
	background-color: transparent !important;
	color: inherit !important;
}

.single-product.wd-wga-layout-digikala table.woocommerce-group-attributes-layout-1 .attribute_name_values {
	width: 100%;
	margin: 0 0 0.25rem;
	border: 0;
	border-collapse: collapse;
	border-spacing: 0;
	background-color: transparent !important;
}

.single-product.wd-wga-layout-digikala table.woocommerce-group-attributes-layout-1 .attribute_name_values > tbody > tr {
	display: grid;
	grid-template-columns: minmax(9.5rem, 0.26fr) minmax(0, 1fr);
	gap: clamp(1rem, 2.5vw, 2.5rem);
	width: 100%;
	margin: 0;
	border: 0;
	border-bottom: 1px solid var(--brdcolor-gray-200);
	background-color: transparent !important;
	color: inherit !important;
}

.single-product.wd-wga-layout-digikala table.woocommerce-group-attributes-layout-1 .attribute_name_values :is(.attribute_name, .attribute_value) {
	display: block;
	width: auto;
	min-width: 0;
	min-height: 0;
	padding-block: 0.75rem;
	padding-inline: 0;
	border: 0;
	border-radius: 0;
	text-transform: none;
	font-size: 0.875rem;
	line-height: 1.75;
	vertical-align: top;
}

.single-product.wd-wga-layout-digikala table.woocommerce-group-attributes-layout-1 .attribute_name_values .attribute_name {
	background-color: transparent !important;
	color: var(--color-gray-700) !important;
	font-weight: 600;
}

.single-product.wd-wga-layout-digikala table.woocommerce-group-attributes-layout-1 .attribute_name_values .attribute_value {
	background-color: transparent !important;
	color: var(--wd-text-color) !important;
	font-weight: inherit;
}

.single-product.wd-wga-layout-digikala table.woocommerce-group-attributes-layout-1 .attribute_name_values .attribute_value :is(p, ul, ol) {
	width: 100%;
	margin: 0;
}

.single-product.wd-wga-layout-digikala table.woocommerce-group-attributes-layout-1 .attribute_group_name .attribute-group-image {
	width: 1.5rem;
	height: 1.5rem;
	margin-inline-end: 0.5rem;
	object-fit: contain;
}

.single-product.wd-wga-layout-digikala table.woocommerce-group-attributes-layout-1 .attribute_group_name.woocommerce-group-attributes-accordion-name {
	width: 100%;
	min-width: 0;
	max-width: none;
	padding-inline-end: 2.25rem;
	cursor: pointer;
}

@media (max-width: 768.98px) {
	.single-product.wd-wga-layout-digikala table.woocommerce-group-attributes-layout-1 .attribute_name_values > tbody > tr {
		grid-template-columns: minmax(7.5rem, 0.34fr) minmax(0, 1fr);
		gap: 1rem;
	}

	.single-product.wd-wga-layout-digikala table.woocommerce-group-attributes-layout-1 .attribute_name_values :is(.attribute_name, .attribute_value) {
		display: block;
		width: auto;
		padding-block: 0.625rem;
		padding-inline: 0;
	}
}

@media (max-width: 480px) {
	.single-product.wd-wga-layout-digikala table.woocommerce-group-attributes-layout-1 .attribute_name_values > tbody > tr {
		grid-template-columns: minmax(0, 1fr);
		gap: 0;
		padding-block: 0.625rem;
	}

	.single-product.wd-wga-layout-digikala table.woocommerce-group-attributes-layout-1 .attribute_name_values .attribute_name {
		padding-block: 0 0.125rem;
	}

	.single-product.wd-wga-layout-digikala table.woocommerce-group-attributes-layout-1 .attribute_name_values .attribute_value {
		padding-block: 0.125rem 0;
	}
}
