/**
 * Single product page — mobile fixes (loads after Elementor Pro's tabs widget CSS).
 *
 * 1. WooCommerce tabs: one scrollable row on ≤767px instead of wrapping.
 * 2. Advanced Woo Discount Rules bulk table (child-theme template override).
 */

/* ------------------------------------------------------------------ tabs */

@media (max-width: 767px) {
	/* The template's custom CSS (.elementor-<doc> .elementor-element-<id> …) out-specifies
	 * any theme selector, hence the !important on the four layout-critical properties. */
	.single-product .woocommerce-tabs ul.wc-tabs {
		display: flex !important;
		flex-wrap: nowrap !important;
		width: 100% !important;
		overflow-x: auto !important;
		overflow-y: hidden;
		gap: 4px;
		margin: 0;
		padding: 0 !important;
		scrollbar-width: none;
		-ms-overflow-style: none;
		-webkit-overflow-scrolling: touch;
		scroll-snap-type: x proximity;
		scroll-padding-inline: 12px;
		-webkit-mask-image: linear-gradient(to left, transparent 0, #000 22px, #000 calc(100% - 22px), transparent 100%);
		mask-image: linear-gradient(to left, transparent 0, #000 22px, #000 calc(100% - 22px), transparent 100%);
	}
	.single-product .woocommerce-tabs ul.wc-tabs::-webkit-scrollbar {
		display: none;
	}
	/* WooCommerce's absolute bottom line and clearfix pseudo-elements. */
	.single-product .woocommerce-tabs ul.wc-tabs::before,
	.single-product .woocommerce-tabs ul.wc-tabs::after {
		content: none !important;
		display: none !important;
	}
	.single-product .woocommerce-tabs ul.wc-tabs > li {
		flex: 0 0 auto;
		float: none !important;
		margin: 0 !important;
		white-space: nowrap;
		scroll-snap-align: start;
	}
	/* WooCommerce's rounded-corner pseudo-elements (5px boxes with box-shadows). */
	.single-product .woocommerce-tabs ul.wc-tabs > li::before,
	.single-product .woocommerce-tabs ul.wc-tabs > li::after {
		content: none !important;
		display: none !important;
	}
	.single-product .woocommerce-tabs ul.wc-tabs > li > a {
		display: block;
		white-space: nowrap;
	}
	/* Some first/last padding so the fade never covers a label. */
	.single-product .woocommerce-tabs ul.wc-tabs > li:first-child {
		margin-inline-start: 8px !important;
	}
	.single-product .woocommerce-tabs ul.wc-tabs > li:last-child {
		margin-inline-end: 8px !important;
	}
}

/* --------------------------------------------------- discount (bulk) table */

/* No direct-child selectors off .awdr-bulk-customizable-table: after a variation
 * change the plugin nests a second wrapper inside the first. */
.awdr-bulk-customizable-table {
	max-width: 100%;
	margin: 0 0 14px;
}
.awdr-bulk-customizable-table table.buldog-wdr-table {
	width: 100%;
	max-width: 100%;
	table-layout: fixed;
	border-collapse: collapse;
	margin: 0;
	background: #fff;
	border: 1px solid #e3e6ea;
	border-radius: 10px;
	overflow: hidden;
	font-size: 14px;
	line-height: 1.3;
	direction: rtl;
}
.awdr-bulk-customizable-table table.buldog-wdr-table th,
.awdr-bulk-customizable-table table.buldog-wdr-table td {
	padding: 9px 6px;
	border: 0;
	border-bottom: 1px solid #edf0f3;
	text-align: center;
	vertical-align: middle;
	min-width: 0;
	overflow-wrap: anywhere;
}
.awdr-bulk-customizable-table table.buldog-wdr-table th {
	background: #f6f7f9;
	color: #333;
	font-weight: 700;
	font-size: 13px;
	line-height: 1.25;
}
.awdr-bulk-customizable-table table.buldog-wdr-table tbody tr:last-child td {
	border-bottom: 0;
}
.awdr-bulk-customizable-table table.buldog-wdr-table tbody tr:nth-child(even) td {
	background: #fafbfc;
}
.awdr-bulk-customizable-table table.buldog-wdr-table td.wdr_bulk_title {
	text-align: start;
	font-weight: 600;
	color: #222;
}
.awdr-bulk-customizable-table table.buldog-wdr-table td.wdr_bulk_range {
	font-weight: 700;
	white-space: nowrap;
}
.awdr-bulk-customizable-table table.buldog-wdr-table td.wdr_bulk_table_discount,
.awdr-bulk-customizable-table table.buldog-wdr-table td.buldog-wdr-table__total {
	white-space: nowrap;
}
.awdr-bulk-customizable-table table.buldog-wdr-table .wdr_table_discounted_price,
.awdr-bulk-customizable-table table.buldog-wdr-table .wdr_table_discounted_value,
.awdr-bulk-customizable-table table.buldog-wdr-table .buldog-wdr-total {
	display: block;
	font-weight: 700;
	color: #1f2937;
}
.awdr-bulk-customizable-table table.buldog-wdr-table .buldog-wdr-total {
	color: #477a2b;
}
.awdr-bulk-customizable-table table.buldog-wdr-table .buldog-wdr-unit,
.awdr-bulk-customizable-table table.buldog-wdr-table .buldog-wdr-total-note {
	display: block;
	font-size: 11px;
	font-weight: 400;
	line-height: 1.2;
	color: #6b7280;
	white-space: nowrap;
}
.awdr-bulk-customizable-table table.buldog-wdr-table .woocommerce-Price-amount,
.awdr-bulk-customizable-table table.buldog-wdr-table .amount {
	font-size: inherit;
	color: inherit;
}

@media (max-width: 420px) {
	.awdr-bulk-customizable-table table.buldog-wdr-table {
		font-size: 13px;
	}
	.awdr-bulk-customizable-table table.buldog-wdr-table th,
	.awdr-bulk-customizable-table table.buldog-wdr-table td {
		padding: 8px 4px;
	}
	.awdr-bulk-customizable-table table.buldog-wdr-table th {
		font-size: 12px;
	}
}
@media (max-width: 360px) {
	/* The header already says "per unit": drop the per-cell suffix to save height/width. */
	.awdr-bulk-customizable-table table.buldog-wdr-table .buldog-wdr-unit {
		display: none;
	}
	.awdr-bulk-customizable-table table.buldog-wdr-table .buldog-wdr-total-note {
		font-size: 10px;
	}
}
