/* =============================================================================
 * The 12th Frontend Tweaks — premium dark overrides
 * Loaded only on WooCommerce pages (see main plugin file).
 * ========================================================================== */

/* -----------------------------------------------------------------------------
 * Image stretch fix — keep theme's 1:1 ratio, only enforce object-fit
 * -------------------------------------------------------------------------- */
.elementor-widget-woocommerce-products img,
ul.products li.product img,
.the12th-shop-grid li.product img {
	object-fit: cover !important;
}

/* -----------------------------------------------------------------------------
 * Hide raw count badges on WC default widgets + theme filter panel
 * -------------------------------------------------------------------------- */
.widget_layered_nav .count,
.woocommerce-widget-layered-nav .count,
.widget_product_categories .count,
.the12th-filter-option__count {
	display: none !important;
}

/* -----------------------------------------------------------------------------
 * Strict dark mode — applies ONLY to native WooCommerce filter widgets.
 * The theme's .the12th-filter-panel is intentionally left untouched
 * so its gold accent design stays consistent.
 * -------------------------------------------------------------------------- */
.widget_layered_nav,
.woocommerce-widget-layered-nav,
.widget_product_categories,
.widget_price_filter {
	background: #000000 !important;
	color: #ffffff !important;
	padding: 16px;
	border-radius: 0;
}

.widget_layered_nav *,
.woocommerce-widget-layered-nav *,
.widget_product_categories *,
.widget_price_filter * {
	color: #ffffff !important;
	border-color: #2a2a2a !important;
}

.widget_layered_nav a:hover,
.woocommerce-widget-layered-nav a:hover,
.widget_product_categories a:hover {
	color: #d4af37 !important;
}

/* -----------------------------------------------------------------------------
 * Minimalist square checkboxes for WC default filter lists
 * -------------------------------------------------------------------------- */
.widget_layered_nav input[type="checkbox"],
.woocommerce-widget-layered-nav input[type="checkbox"] {
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	width: 16px;
	height: 16px;
	border: 1px solid #ffffff;
	background: transparent;
	border-radius: 0;
	vertical-align: middle;
	margin-right: 10px;
	cursor: pointer;
	position: relative;
	transition: background 120ms ease;
}

.widget_layered_nav input[type="checkbox"]:hover,
.woocommerce-widget-layered-nav input[type="checkbox"]:hover {
	border-color: #d4af37;
}

.widget_layered_nav input[type="checkbox"]:checked,
.woocommerce-widget-layered-nav input[type="checkbox"]:checked {
	background: #ffffff;
	border-color: #ffffff;
}

.widget_layered_nav input[type="checkbox"]:checked::after,
.woocommerce-widget-layered-nav input[type="checkbox"]:checked::after {
	content: '';
	position: absolute;
	inset: 3px;
	background: #000000;
}

/* -----------------------------------------------------------------------------
 * Native WC price filter slider — premium dark
 * -------------------------------------------------------------------------- */
.widget_price_filter .price_slider_wrapper .ui-widget-content {
	background: #1a1a1a !important;
}

.widget_price_filter .ui-slider .ui-slider-range {
	background: #ffffff !important;
}

.widget_price_filter .ui-slider .ui-slider-handle {
	background: #d4af37 !important;
	border: none !important;
	border-radius: 0 !important;
}

/* -----------------------------------------------------------------------------
 * SIZE GUIDE — premium button + modal
 * Hides Printful's default unstyled anchor and uses our own button.
 * -------------------------------------------------------------------------- */

/* Hide the default Printful Size Guide anchor — we render our own */
.single-product a[onclick*="Printful_Product_Size_Guide"] {
	display: none !important;
}

/* The custom button — hardened against theme button rules */
button.the12th-size-guide-btn,
.the12th-size-guide-btn {
	display: inline-block !important;
	background: transparent !important;
	color: #d4af37 !important;
	border: none !important;
	border-bottom: 1px solid rgba(212, 175, 55, 0.4) !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	padding: 6px 2px !important;
	margin: 14px 0 18px !important;
	font-family: inherit !important;
	font-size: 12px !important;
	font-weight: 500 !important;
	letter-spacing: 0.14em !important;
	text-transform: uppercase !important;
	cursor: pointer;
	text-decoration: none !important;
	line-height: 1 !important;
	height: auto !important;
	min-height: 0 !important;
	width: auto !important;
	transition: color 200ms ease, border-color 200ms ease;
}

button.the12th-size-guide-btn:hover,
button.the12th-size-guide-btn:focus,
.the12th-size-guide-btn:hover,
.the12th-size-guide-btn:focus {
	color: #ffffff !important;
	border-bottom-color: #d4af37 !important;
	outline: none !important;
	background: transparent !important;
}

/* Generic-fallback modal — only used when product has no Printful chart data */
.the12th-sg-modal {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.82);
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	animation: the12th-sg-fade 200ms ease;
}

@keyframes the12th-sg-fade {
	from { opacity: 0; }
	to { opacity: 1; }
}

.the12th-sg-modal__panel {
	background: #0a0a0a;
	color: #f5f5f5;
	border: 1px solid rgba(212, 175, 55, 0.35);
	max-width: 720px;
	width: 100%;
	max-height: 88vh;
	overflow-y: auto;
	padding: 32px 36px;
	position: relative;
	box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
}

.the12th-sg-modal__close {
	position: absolute;
	top: 14px;
	right: 16px;
	background: transparent;
	border: none;
	color: #d4af37;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	padding: 4px 8px;
	transition: color 200ms ease;
}

.the12th-sg-modal__close:hover {
	color: #ffffff;
}

.the12th-sg-modal__title {
	font-size: 22px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	margin: 0 0 6px;
	color: #ffffff;
}

.the12th-sg-modal__subtitle {
	font-size: 12px;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: #d4af37;
	margin: 0 0 22px;
}

.the12th-sg-modal__units {
	display: inline-flex;
	gap: 0;
	margin: 0 0 18px;
	border: 1px solid rgba(212, 175, 55, 0.4);
}

.the12th-sg-modal__unit-btn {
	background: transparent;
	color: #cccccc;
	border: none;
	padding: 8px 18px;
	font-size: 11px;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	cursor: pointer;
	transition: background 180ms ease, color 180ms ease;
}

.the12th-sg-modal__unit-btn + .the12th-sg-modal__unit-btn {
	border-left: 1px solid rgba(212, 175, 55, 0.4);
}

.the12th-sg-modal__unit-btn:hover {
	color: #ffffff;
}

.the12th-sg-modal__unit-btn.is-active {
	background: #d4af37;
	color: #0a0a0a;
}

.the12th-sg-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
}

.the12th-sg-table th,
.the12th-sg-table td {
	padding: 12px 14px;
	text-align: left;
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.the12th-sg-table th {
	font-size: 11px;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: #d4af37;
	font-weight: 500;
}

.the12th-sg-table tbody tr:hover {
	background: rgba(212, 175, 55, 0.05);
}

.the12th-sg-modal__note {
	margin-top: 18px;
	font-size: 12px;
	color: #888;
	line-height: 1.55;
}

/* -----------------------------------------------------------------------------
 * SIZE GUIDE — premium re-skin of Printful's native modal.
 * Printful's JS sets inline style.backgroundColor / style.color on the panel
 * and on td/h1-h6/p elements, so most rules need !important to win.
 * -------------------------------------------------------------------------- */

.pf-size-guide-modal-wrapper {
	background: rgba(0, 0, 0, 0.82) !important;
	padding: 24px !important;
}

.pf-size-guide-modal-wrapper .pf-size-guide-modal {
	background-color: #0a0a0a !important;
	color: #f5f5f5 !important;
	border: 1px solid rgba(212, 175, 55, 0.35);
	max-width: 760px !important;
	height: auto !important;
	max-height: 88vh !important;
	box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
}

.pf-size-guide-modal-wrapper .pf-size-guide-modal__header {
	padding: 24px 32px 6px !important;
	border-bottom: 1px solid rgba(212, 175, 55, 0.18);
}

.pf-size-guide-modal-wrapper .pf-size-guide-modal__title {
	background-color: transparent !important;
	color: #ffffff !important;
	font-size: 20px !important;
	font-weight: 600 !important;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.pf-size-guide-modal-wrapper .pf-size-guide-modal__close {
	margin-top: -4px;
}

/* Printful uses a dark X icon — invert it so it shows on our dark bg */
.pf-size-guide-modal-wrapper .pf-size-guide-modal__close img {
	filter: invert(1) sepia(1) hue-rotate(15deg) saturate(3) brightness(0.95);
	opacity: 0.85;
	transition: opacity 200ms ease;
}

.pf-size-guide-modal-wrapper .pf-size-guide-modal__close:hover img {
	opacity: 1;
}

.pf-size-guide-modal-wrapper .pf-size-guide-modal__content {
	padding: 18px 32px 28px !important;
}

.pf-size-guide-modal-wrapper .pf-size-guide-modal__content h4,
.pf-size-guide-modal-wrapper .pf-size-guide-modal__content p,
.pf-size-guide-modal-wrapper .pf-size-guide-modal__content div {
	background-color: transparent !important;
	color: #f5f5f5 !important;
}

.pf-size-guide-modal-wrapper .pf-size-guide-modal__content h4 {
	font-size: 14px !important;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: #d4af37 !important;
	margin: 22px 0 14px !important;
	font-weight: 500 !important;
}

/* Outer tabs (Measure yourself / Product measurements) */
.pf-size-guide-modal-wrapper .pf-product-size-guide__tabs {
	box-shadow: inset 0 -1px 0 0 rgba(212, 175, 55, 0.25) !important;
	margin-bottom: 4px !important;
}

.pf-size-guide-modal-wrapper .pf-product-size-guide__tab {
	background-color: transparent !important;
	color: #999 !important;
	border: none !important;
	border-bottom: 2px solid transparent !important;
	padding: 14px 4px !important;
	margin-right: 28px !important;
	font-size: 12px !important;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	transition: color 200ms ease, border-color 200ms ease;
}

.pf-size-guide-modal-wrapper .pf-product-size-guide__tab:hover {
	color: #ffffff !important;
}

.pf-size-guide-modal-wrapper .pf-product-size-guide__tab.pf-product-size-guide__tab--active {
	background-color: transparent !important;
	color: #d4af37 !important;
	border: none !important;
	border-bottom: 2px solid #d4af37 !important;
}

/* Measurements block (image + description) */
.pf-size-guide-modal-wrapper .pf-size-guide-modal-measurements,
.pf-size-guide-modal-wrapper .pf-size-guide-modal-measurements__image,
.pf-size-guide-modal-wrapper .pf-size-guide-modal-measurements__description {
	background-color: transparent !important;
	color: #cccccc !important;
}

.pf-size-guide-modal-wrapper .pf-size-guide-modal-measurements__image img {
	filter: invert(0.92) hue-rotate(180deg);
	max-width: 100%;
	height: auto;
}

/* Unit tabs (Inches / Centimeters) */
.pf-size-guide-modal-wrapper .pf-size-guide-modal-size-chart__tabs {
	box-shadow: inset 0 -1px 0 0 rgba(255, 255, 255, 0.08) !important;
	margin-bottom: 8px !important;
}

.pf-size-guide-modal-wrapper .pf-size-guide-modal-size-chart__tab {
	background-color: transparent !important;
	color: #888 !important;
	font-size: 12px !important;
	font-weight: 500 !important;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	padding: 10px 4px !important;
	margin-right: 24px !important;
	box-shadow: none !important;
	transition: color 200ms ease, box-shadow 200ms ease;
}

.pf-size-guide-modal-wrapper .pf-size-guide-modal-size-chart__tab:hover {
	color: #ffffff !important;
}

.pf-size-guide-modal-wrapper .pf-size-guide-modal-size-chart__tab.pf-size-guide-modal-size-chart__tab--active {
	color: #d4af37 !important;
	box-shadow: inset 0 -2px 0 #d4af37 !important;
}

/* Size chart table */
.pf-size-guide-modal-wrapper .pf-size-guide-modal-size-chart__table {
	color: #f5f5f5 !important;
}

.pf-size-guide-modal-wrapper .pf-size-guide-modal-size-chart__table thead td {
	background-color: transparent !important;
	color: #d4af37 !important;
	font-size: 11px !important;
	letter-spacing: 0.16em;
	font-weight: 500 !important;
	padding: 14px 10px !important;
	border-bottom: 1px solid rgba(212, 175, 55, 0.3) !important;
}

.pf-size-guide-modal-wrapper .pf-size-guide-modal-size-chart__table tbody td {
	background-color: transparent !important;
	color: #f5f5f5 !important;
	font-size: 14px !important;
	text-transform: none !important;
	border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
	padding: 13px 10px !important;
}

.pf-size-guide-modal-wrapper .pf-size-guide-modal-size-chart__table tbody td:first-child {
	color: #d4af37 !important;
	font-weight: 500 !important;
}

.pf-size-guide-modal-wrapper .pf-size-guide-modal-size-chart__table tbody tr:hover td {
	background-color: rgba(212, 175, 55, 0.05) !important;
}