/**
 * WooCommerce Gia Customizations — Filtros bar styles (v2.1.0)
 *
 * Matched to the single-product page design language (card.css): quiet
 * #e6e6e6 borders, Jost 300, charcoal text, faint rgba(35,33,30,0.05) hover,
 * no fills, no accent color, radius 0, the same SVG chevron. The outer bar is
 * plain white with no border, per spec.
 *
 * Mobile: identity row on top, triggers stacked full width, mega panel
 * height-capped with internal scroll.
 */

/* ---- Safety net: hide any WooCommerce ordering / result count rendered as a
   sibling of our bar (theme duplicates). Ours are scoped inside the bar. ---- */
.wc-gia-filterbar ~ .woocommerce-ordering,
.wc-gia-filterbar ~ .woocommerce-result-count,
.wc-gia-filterbar + form.woocommerce-ordering {
	display: none !important;
}

/* Hide the theme's own shop page title — we render our own header */
.woocommerce-products-header__title,
.woocommerce-products-header {
	display: none !important;
}

/* ---- Shop header: centered eyebrow + title + description ---- */
.wc-gia-shop-header {
	text-align: center;
	margin: 0 0 38px;
	font-family: 'Jost', sans-serif;
}

.wc-gia-shop-header__eyebrow {
	display: inline-block;
	font-family: 'Jost', sans-serif;
	font-size: 15px;
	font-weight: 500;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--gia-charcoal);
	margin-bottom: 16px;
}

.wc-gia-shop-header__title {
	font-family: 'EB Garamond', serif;
	font-weight: 300;
	font-size: clamp(30px, 4vw, 44px);
	line-height: 1.05;
	letter-spacing: 0.005em;
	color: var(--gia-charcoal);
	margin: 0;
}

.wc-gia-shop-header__desc {
	font-size: 16px;
	color: var(--gia-muted);
	max-width: 540px;
	margin: 16px auto 0;
	line-height: 1.6;
}

/* ---- Filtros bar: plain white, no border, no bottom hairline ---- */
.wc-gia-filterbar {
	--gia-charcoal: #23211e;
	--gia-muted: #8c8475;
	--gia-line: rgba(35, 33, 30, 0.14);
	--gia-border: #e6e6e6;
	--gia-tint: rgba(35, 33, 30, 0.05);

	position: relative;
	display: flex;
	align-items: center;
	gap: 18px;
	margin: 0 0 32px;
	padding: 14px 20px;
	background: #fff;
	border: none;
	border-radius: 0;
	font-family: 'Jost', sans-serif;
	flex-wrap: wrap;
}

.wc-gia-filterbar *,
.wc-gia-filterbar *::before,
.wc-gia-filterbar *::after {
	box-sizing: border-box;
}

/* ---- Identity block: icon + Filtros title + Limpiar ---- */
.wc-gia-fb__id {
	flex: 0 0 auto;
	padding-right: 20px;
	border-right: 1px solid var(--gia-border);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
}

.wc-gia-fb__title {
	display: flex;
	align-items: center;
	gap: 8px;
	color: var(--gia-charcoal);
}

.wc-gia-fb__title svg {
	display: block;
	flex-shrink: 0;
}

.wc-gia-fb__title span {
	font-family: 'EB Garamond', serif;
	font-weight: 400;
	font-size: 19px;
	line-height: 1;
	color: var(--gia-charcoal);
}

.wc-gia-fb__clear,
.wc-gia-filterbar .wc-gia-fb__clear {
	font-family: 'Jost', sans-serif;
	font-size: 11px;
	font-weight: 400;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	background: none !important;
	background-color: transparent !important;
	color: var(--gia-muted);
	border: none !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	padding: 0 !important;
	margin: 6px 0 0 !important;
	min-height: 0 !important;
	width: auto !important;
	cursor: pointer;
	transition: color 0.2s ease;
	-webkit-appearance: none;
	appearance: none;
}

.wc-gia-fb__clear:hover {
	color: var(--gia-charcoal);
}

/* ---- Dropdown triggers row ---- */
.wc-gia-fb__controls {
	flex: 1 1 auto;
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 10px;
	min-width: 0;
}

.wc-gia-dd {
	position: relative;
	min-width: 0;
}

/* Trigger mirrors the product-page variation dropdown (.wc-gia-vselect) exactly:
   40px height, no vertical padding (height centers the text), 13px Jost. */
.wc-gia-dd__trigger,
.wc-gia-filterbar .wc-gia-dd__trigger {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	width: 100% !important;
	height: 40px !important;
	min-height: 0 !important;
	padding: 0 16px !important;
	margin: 0 !important;
	background: #fff !important;
	background-color: #fff !important;
	border: 1px solid #e6e6e6 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	cursor: pointer;
	font-family: 'Jost', sans-serif;
	font-weight: 400;
	font-size: 13px;
	letter-spacing: 0.04em;
	text-transform: none;
	line-height: 1.2;
	color: #1F1F1F;
	text-align: left;
	transition: border-color 0.2s ease;
	-webkit-appearance: none;
	appearance: none;
}

.wc-gia-dd__trigger:hover,
.wc-gia-dd.is-open .wc-gia-dd__trigger {
	border-color: #1F1F1F !important;
}

/* Value: uppercase 12px like the product dropdown; placeholder muted grey. */
.wc-gia-dd__value {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	min-width: 0;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	font-size: 12px;
	color: #1F1F1F;
}

.wc-gia-dd__value.is-placeholder {
	color: #23211e;
}

/* Chevron: same SVG the product selects use, via border triangle for rotation. */
.wc-gia-dd__chev {
	width: 8px;
	height: 8px;
	border-right: 1.4px solid var(--gia-charcoal);
	border-bottom: 1.4px solid var(--gia-charcoal);
	transform: rotate(45deg) translateY(-2px);
	flex-shrink: 0;
	transition: transform 0.2s ease;
}

.wc-gia-dd.is-open .wc-gia-dd__chev {
	transform: rotate(-135deg) translateY(-1px);
}

.wc-gia-dd.is-disabled {
	opacity: 0.5;
	pointer-events: none;
}

/* ---- Panels: match the product dropdown list exactly ---- */
.wc-gia-dd__panel {
	position: absolute;
	top: calc(100% + 4px);
	left: 0;
	min-width: 100%;
	padding: 0;
	background: #fff;
	border: 1px solid #e6e6e6;
	border-radius: 0;
	box-shadow: 0 18px 40px rgba(35, 33, 30, 0.12);
	z-index: 50;
	opacity: 0;
	visibility: hidden;
	transform: translateY(-6px);
	transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.wc-gia-dd.is-open .wc-gia-dd__panel {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.wc-gia-dd__opt,
.wc-gia-filterbar .wc-gia-dd__opt {
	display: block;
	width: 100% !important;
	padding: 9px 16px !important;
	margin: 0 !important;
	background: #fff !important;
	background-color: #fff !important;
	border: none !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	cursor: pointer;
	font-family: 'Jost', sans-serif;
	font-weight: 400;
	font-size: 13px;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: #1F1F1F;
	text-align: left;
	white-space: nowrap;
	min-height: 0 !important;
	transition: background 0.15s ease, color 0.15s ease;
	-webkit-appearance: none;
	appearance: none;
}

.wc-gia-dd__opt:hover {
	background: #f3f3f3 !important;
	color: #1F1F1F;
}

/* Selected = #f0f0f0 + weight 600, exactly like the product dropdown. */
.wc-gia-dd__opt.is-selected {
	background: #f0f0f0 !important;
	color: #1F1F1F;
	font-weight: 600;
}

/* ---- Fragancia mega panel: anchored to the bar, full bar width ---- */
.wc-gia-dd--frag {
	position: static;
}

.wc-gia-dd__panel--mega {
	left: 0;
	right: 0;
	top: calc(100% + 4px);
	min-width: 0;
	padding: 18px 20px;
}

/* Short groups (Día de las Madres, Día de los Enamorados, Difusor para Auto)
   share ONE row, each sized by its item count so the boxes line up with the
   6-column grid above (1 + 2 + 3 = 6 slots). Panel becomes a wrapping flex row:
   normal groups take the full width, inline groups take --gcols/6 of it. */
.wc-gia-dd__panel--mega {
	display: flex;
	flex-wrap: wrap;
	column-gap: 12px;
	align-items: flex-start;
}
.wc-gia-frag-group {
	flex: 0 0 100%;
	margin-bottom: 16px;
}

.wc-gia-frag-group:last-child {
	margin-bottom: 0;
}

.wc-gia-frag-group--inline {
	flex: 0 0 calc(var(--gcols, 1) / 6 * 100% - 8px);
}
.wc-gia-frag-group--inline .wc-gia-frag-group__grid {
	grid-template-columns: repeat(var(--gcols, 1), minmax(0, 1fr));
}

/* Group caption matches the product-page attribute label. */
.wc-gia-frag-group__label {
	font-family: 'Jost', sans-serif;
	font-size: 10px;
	font-weight: 400;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--gia-muted);
	margin: 0 0 8px;
}

.wc-gia-frag-group__grid {
	display: grid;
	grid-template-columns: repeat(6, minmax(0, 1fr));
	gap: 6px;
}

.wc-gia-frag,
.wc-gia-filterbar .wc-gia-frag {
	display: block;
	width: 100% !important;
	padding: 10px 10px !important;
	margin: 0 !important;
	background: #fff !important;
	background-color: #fff !important;
	border: 1px solid var(--gia-border) !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	cursor: pointer;
	font-family: 'Jost', sans-serif;
	font-weight: 400;
	font-size: 11.5px;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: #1F1F1F;
	text-align: left;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	min-height: 0 !important;
	transition: opacity 0.2s ease, border-color 0.2s ease, background 0.16s ease;
	-webkit-appearance: none;
	appearance: none;
}

.wc-gia-frag:hover {
	border-color: var(--gia-charcoal) !important;
}

/* Selected fragancia = #f0f0f0 fill only, no border. */
.wc-gia-frag.is-selected {
	background: #f0f0f0 !important;
	border-color: transparent !important;
	color: #1F1F1F;
	font-weight: 600;
}

/* ---- Right: result count ---- */
.wc-gia-meta {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 16px;
	flex: 0 0 auto;
	margin-left: 16px;
	white-space: nowrap;
}

/* Below ~1180px, four dropdowns + count on one row gets cramped. Let the count
   drop to its own full-width line (right-aligned) rather than squeezing the
   dropdowns thin. The four dropdowns stay inline. */
@media (max-width: 1180px) {
	.wc-gia-filterbar {
		flex-wrap: wrap;
	}
	.wc-gia-fb__controls {
		flex: 1 1 100%;
		order: 2;
	}
	.wc-gia-fb__id {
		order: 1;
	}
	.wc-gia-meta {
		order: 3;
		flex: 1 1 100%;
		margin-left: 0;
		justify-content: flex-end;
	}
}

.wc-gia-count {
	font-size: 13px;
	letter-spacing: 0.03em;
	color: var(--gia-muted);
	font-weight: 400;
	white-space: nowrap;
	line-height: 1;
}

.wc-gia-count:empty {
	display: none;
}

/* Native WooCommerce sort — flat text link (no box), inline. Hidden on mobile. */
.wc-gia-sort {
	display: none;
	line-height: 1;
}

.wc-gia-sort .woocommerce-ordering,
.wc-gia-sort form.woocommerce-ordering {
	margin: 0 !important;
	padding: 0 !important;
	display: inline-block;
}

.wc-gia-sort select,
.wc-gia-sort select.orderby,
.wc-gia-filterbar .wc-gia-sort select.orderby {
	font-family: 'Jost', sans-serif !important;
	font-size: 14px !important;
	font-weight: 400 !important;
	color: var(--gia-charcoal) !important;
	padding: 0 22px 0 0 !important;
	margin: 0 !important;
	background: none !important;
	background-color: transparent !important;
	border: none !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	cursor: pointer;
	letter-spacing: 0.01em;
	line-height: 1.2 !important;
	min-height: 0 !important;
	height: auto !important;
	width: auto !important;
	text-transform: none !important;
	-webkit-appearance: none !important;
	-moz-appearance: none !important;
	appearance: none !important;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7'%3E%3Cpath fill='none' stroke='%2323211e' stroke-width='1.4' d='M1 1l5 5 5-5'/%3E%3C/svg%3E") !important;
	background-repeat: no-repeat !important;
	background-position: right center !important;
}

/* Blanket: remove the browser blue focus ring; focus mirrors product page (charcoal border). */
.wc-gia-filterbar :focus,
.wc-gia-dd__opt:focus,
.wc-gia-frag:focus,
.wc-gia-fb__clear:focus,
.wc-gia-sort select:focus {
	outline: none !important;
}

.wc-gia-dd__trigger:focus-visible {
	outline: none !important;
	border-color: var(--gia-charcoal) !important;
}

/* ---- Loading / fade states ---- */
.wc-gia-filterbar.is-loading .wc-gia-dd__trigger {
	opacity: 0.45;
	pointer-events: none;
}

ul.products.wc-gia-fade {
	opacity: 0.35;
	transition: opacity 0.2s ease;
	pointer-events: none;
}

.wc-gia-empty {
	font-family: 'EB Garamond', serif;
	font-size: 20px;
	color: var(--gia-muted, #8c8475);
	padding: 48px 0;
	text-align: center;
	list-style: none;
	grid-column: 1 / -1;
	width: 100%;
}

/* ---- Pagination ---- */
.wc-gia-pagination ul {
	display: flex;
	gap: 8px;
	list-style: none;
	padding: 0;
	margin: 40px 0 0;
	justify-content: center;
}

.wc-gia-pagination li {
	list-style: none !important;
	margin: 0;
	padding: 0;
}
.wc-gia-pagination li::marker {
	content: none;
}

.wc-gia-pagination a,
.wc-gia-pagination span {
	display: grid;
	place-items: center;
	min-width: 40px;
	height: 40px;
	padding: 0 10px;
	border: 1px solid var(--gia-border, #e6e6e6);
	border-radius: 0;
	font-family: 'Jost', sans-serif;
	font-size: 13px;
	color: #23211e;
	text-decoration: none;
	transition: background 0.2s ease, color 0.2s ease;
}

.wc-gia-pagination span.current {
	background: var(--gia-tint, rgba(35, 33, 30, 0.05));
	color: #23211e;
	border-color: #23211e;
}

.wc-gia-pagination a:hover {
	background: rgba(35, 33, 30, 0.05);
}

/* ---- Desktop / mobile ---- */
@media (min-width: 768px) {
	.wc-gia-sort {
		display: block;
	}
}

@media (max-width: 767px) {
	.wc-gia-filterbar {
		gap: 12px;
	}

	.wc-gia-fb__id {
		flex: 1 1 100%;
		border-right: none;
		padding-right: 0;
		display: flex;
		justify-content: space-between;
		align-items: baseline;
		order: 1;
	}

	.wc-gia-fb__clear,
	.wc-gia-filterbar .wc-gia-fb__clear {
		margin: 0 !important;
	}

	.wc-gia-fb__controls {
		grid-template-columns: 1fr;
		flex: 1 1 100%;
		min-width: 0;
		order: 2;
	}

	.wc-gia-meta {
		width: 100%;
		justify-content: flex-end;
		margin-left: 0;
		order: 3;
	}

	/* On mobile the fragancia mega panel must open under its OWN trigger like
	   the other dropdowns — not span the full bar (which, with position:static,
	   dumped it at the page bottom). Restore relative positioning + normal drop. */
	.wc-gia-dd--frag {
		position: relative;
	}

	.wc-gia-dd__panel--mega {
		left: 0;
		right: 0;
		top: calc(100% + 4px);
		max-height: 320px;
		overflow-y: auto;
		padding: 14px 16px 4px;
		position: absolute;
	}

	/* Scroll cue: a fade + down chevron pinned to the visible bottom of the
	   scrolling panel via position:sticky. JS toggles .is-scroll-end to hide it
	   once the user reaches the bottom, so it never lies about more content. */
	.wc-gia-dd__panel--mega .wc-gia-frag-scrollcue {
		display: block;
		position: sticky;
		bottom: 0;
		left: 0;
		right: 0;
		height: 40px;
		margin: 0 -16px;
		pointer-events: none;
		background: linear-gradient(to bottom, rgba(255,255,255,0), #fff 70%);
		text-align: center;
		transition: opacity 0.2s ease;
	}
	.wc-gia-dd__panel--mega .wc-gia-frag-scrollcue::after {
		content: "";
		position: absolute;
		left: 50%;
		bottom: 8px;
		width: 9px;
		height: 9px;
		margin-left: -5px;
		border-right: 1.5px solid #8c8475;
		border-bottom: 1.5px solid #8c8475;
		transform: rotate(45deg);
		animation: wc-gia-cue-bounce 1.4s ease-in-out infinite;
	}
	.wc-gia-dd__panel--mega.is-scroll-end .wc-gia-frag-scrollcue {
		opacity: 0;
	}
	@keyframes wc-gia-cue-bounce {
		0%, 100% { transform: rotate(45deg) translate(0, 0); }
		50% { transform: rotate(45deg) translate(3px, 3px); }
	}

	.wc-gia-frag-group__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	/* One-row seasonal groups don't fit on phones — stack them full width. */
	.wc-gia-frag-group--inline {
		flex: 0 0 100%;
	}
	.wc-gia-frag-group--inline .wc-gia-frag-group__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	/* Placeholder labels ("FRAGANCIA", "TIPO", "ELIGE COLOR") are too faint at
	   phone size — darken to near-black so they read clearly. */
	.wc-gia-dd__value.is-placeholder {
		color: #23211e !important;
	}
}

/* ---- [gia_shop] shortcode wrapper (for Elementor pages) ---- */
.wc-gia-shop {
	width: 100%;
}

.wc-gia-shop__grid {
	margin-top: 0;
}

.wc-gia-shop ul.products {
	margin: 0;
}

/* ---- Layout hardening (mobile footer-overlap defense) ----
   Overlap into the footer = something gives the grid area a stale/short height
   or takes the pagination out of normal flow. Neutralize both mechanisms
   regardless of which stylesheet introduces them. */
.wc-gia-shop,
.wc-gia-shop__grid,
ul.products.wc-gia-products,
.wc-gia-shop__grid ul.products {
	height: auto !important;
	min-height: 0 !important;
	max-height: none !important;
	overflow: visible !important;
	contain: none !important;
}

.wc-gia-pagination {
	position: static !important;
	float: none !important;
	clear: both !important;
	display: block !important;
	width: 100% !important;
}

.wc-gia-pagination li {
	float: none !important;
}
