/* ─── WC Attribute Filter — Estilos ──────────────────────────── */

/* ─── Panel principal ─────────────────────────────────────────── */
.wcaf-filter-panel {
	font-family: inherit;
	font-size: 15px;
	line-height: 1.4;
	color: #222;
}

/* ─── Título del panel ("Filtrar por") ───────────────────────── */
.wcaf-filter-title {
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .07em;
	text-transform: uppercase;
	color: #2c5f8a;
	margin: 0 0 20px;
	padding-bottom: 0;
	border: none;
}

.wcaf-panel-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 20px;
}
.wcaf-panel-header .wcaf-filter-title { margin: 0; }

.wcaf-panel-close {
	background: none;
	border: none;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	color: #999;
	padding: 0 4px;
}
.wcaf-panel-close:hover { color: #333; }

/* ─── Filtros activos ─────────────────────────────────────────── */
.wcaf-active-filters {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	margin-bottom: 20px;
	padding: 10px 12px;
	background: #f4f7fb;
	border-radius: 8px;
}

.wcaf-active-label {
	font-size: 11px;
	font-weight: 700;
	color: #999;
	text-transform: uppercase;
	letter-spacing: .06em;
}

.wcaf-active-tag {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 4px 10px;
	background: #2c5f8a;
	color: #fff;
	border-radius: 20px;
	font-size: 12px;
	text-decoration: none;
	transition: background .15s;
}
.wcaf-active-tag:hover { background: #1a3f60; color: #fff; }

.wcaf-clear-all {
	margin-left: auto;
	font-size: 12px;
	color: #aaa;
	text-decoration: underline;
	white-space: nowrap;
	cursor: pointer;
}
.wcaf-clear-all:hover { color: #333; }

/* ─── Grupos de atributos ─────────────────────────────────────── */
.wcaf-attribute-group {
	margin-bottom: 0;
	border-bottom: 1px solid #eee;
}
.wcaf-attribute-group:last-child { border-bottom: none; }

/* Título del grupo — texto azul uppercase, sin fondo */
.wcaf-group-toggle {
	display: flex !important;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	padding: 18px 0 10px;
	background: none !important;
	background-color: transparent !important;
	border: none !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	cursor: pointer;
	font-size: 12px !important;
	font-weight: 700 !important;
	letter-spacing: .07em;
	text-transform: uppercase;
	color: #2c5f8a !important;
	text-align: left;
	gap: 8px;
	box-sizing: border-box;
}
.wcaf-group-toggle:hover { color: #1a3f60 !important; }

/* Badge de activos en el header del grupo */
.wcaf-group-active-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	background: #2c5f8a;
	color: #fff;
	border-radius: 10px;
	font-size: 10px;
	font-weight: 700;
}

/* Flecha discreta */
.wcaf-toggle-icon {
	display: inline-block;
	width: 7px;
	height: 7px;
	border-right: 1.5px solid #aaa;
	border-bottom: 1.5px solid #aaa;
	transform: rotate(45deg) translate(-2px, 0);
	transition: transform .2s;
	flex-shrink: 0;
	margin-left: auto;
}
.wcaf-group-toggle[aria-expanded="false"] .wcaf-toggle-icon {
	transform: rotate(-45deg) translate(0, -2px);
}

/* ─── Cuerpo del grupo ────────────────────────────────────────── */
.wcaf-group-body {
	padding: 0 0 14px;
}

/* ─── Footer del grupo: buscador + ver más en la misma fila ───── */
.wcaf-group-footer {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-top: 8px;
	padding-top: 6px;
}

/* Buscador compacto inline */
.wcaf-search-terms {
	flex: 1;
	min-width: 0;
	padding: 5px 8px 5px 26px;
	font-size: 12px;
	border: 1px solid #e8e8e8;
	border-radius: 6px;
	outline: none;
	box-sizing: border-box;
	color: #555;
	background: #f8f8f8 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='13' viewBox='0 0 24 24' fill='none' stroke='%23bbb' stroke-width='2.5'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") no-repeat 7px center;
	transition: border-color .15s;
}
.wcaf-search-terms::placeholder { color: #ccc; font-size: 12px; }
.wcaf-search-terms:focus {
	border-color: #aac4dc;
	background-color: #fff;
	outline: none;
	box-shadow: none;
}

/* ─── Lista CHECKBOX / RADIO ──────────────────────────────────── */
.wcaf-terms-list {
	list-style: none;
	margin: 0;
	padding: 0;
}
.wcaf-term-item { margin: 0; }
.wcaf-term-item.wcaf-term-hidden { display: none; }

.wcaf-term-link {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 6px 8px;
	border-radius: 6px;
	text-decoration: none;
	color: #686868;
	transition: background .12s;
	cursor: pointer;
}
.wcaf-term-link:hover { background: #f4f7fb; color: #444; }
.wcaf-term-item.wcaf-active .wcaf-term-link { color: #2c5f8a; }

/* Checkbox visual */
.wcaf-checkbox-indicator {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	min-width: 20px;
	border: 2px solid #ccc;
	border-radius: 5px;
	transition: background .15s, border-color .15s;
	background: #fff;
}
.wcaf-checkbox-indicator.wcaf-checked {
	background: #2c5f8a;
	border-color: #2c5f8a;
}
.wcaf-checkbox-indicator.wcaf-checked::after {
	content: '';
	display: block;
	width: 5px;
	height: 9px;
	border-right: 2px solid #fff;
	border-bottom: 2px solid #fff;
	transform: rotate(45deg) translate(-1px, -1px);
}

/* Radio visual */
.wcaf-radio-indicator {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	min-width: 20px;
	border: 2px solid #ccc;
	border-radius: 50%;
	background: #fff;
	transition: border-color .15s;
}
.wcaf-radio-indicator.wcaf-checked { border-color: #2c5f8a; }
.wcaf-radio-indicator.wcaf-checked::after {
	content: '';
	display: block;
	width: 10px;
	height: 10px;
	background: #2c5f8a;
	border-radius: 50%;
}

/* Nombre del término */
.wcaf-term-name {
	flex: 1;
	font-size: 14px;
	font-weight: 400;
}

/* Conteo — píldora gris redondeada */
.wcaf-terms-list .wcaf-term-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 28px;
	height: 24px;
	padding: 0 7px;
	background: #f0f0f0;
	color: #888;
	border-radius: 12px;
	font-size: 12px;
	font-weight: 500;
	flex-shrink: 0;
}

/* ─── DROPDOWN ────────────────────────────────────────────────── */
.wcaf-dropdown {
	width: 100%;
	padding: 9px 12px;
	font-size: 14px;
	border: 1px solid #e0e0e0;
	border-radius: 6px;
	background: #fff;
	cursor: pointer;
	outline: none;
	transition: border-color .15s;
}
.wcaf-dropdown:focus {
	border-color: #2c5f8a;
	box-shadow: 0 0 0 2px rgba(44,95,138,.1);
}

/* ─── BOTONES / PILLS ─────────────────────────────────────────── */
.wcaf-buttons-wrap {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}
.wcaf-btn-term {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 6px 14px;
	border: 1.5px solid #e0e0e0;
	border-radius: 20px;
	font-size: 13px;
	color: #444;
	text-decoration: none;
	background: #fff;
	cursor: pointer;
	transition: border-color .15s, background .15s, color .15s;
	white-space: nowrap;
}
.wcaf-btn-term:hover { border-color: #2c5f8a; color: #2c5f8a; }
.wcaf-btn-term.wcaf-active {
	background: #2c5f8a;
	border-color: #2c5f8a;
	color: #fff;
}
.wcaf-btn-term.wcaf-term-hidden { display: none; }
.wcaf-btn-term .wcaf-term-count { font-size: 11px; opacity: .7; }

/* ─── COLOR SWATCHES ──────────────────────────────────────────── */
.wcaf-swatches-wrap { display: flex; flex-wrap: wrap; gap: 8px; }

.wcaf-color-swatch {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	border: 2px solid transparent;
	text-decoration: none;
	cursor: pointer;
	transition: transform .15s, box-shadow .15s;
	box-shadow: 0 0 0 1px rgba(0,0,0,.12);
	position: relative;
}
.wcaf-color-swatch:hover { transform: scale(1.12); box-shadow: 0 0 0 2px rgba(0,0,0,.2); }
.wcaf-color-swatch.wcaf-active { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #2c5f8a; }
.wcaf-color-swatch.wcaf-term-hidden { display: none; }
.wcaf-swatch-check { font-size: 11px; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.5); }
.wcaf-swatch-label { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.wcaf-swatch-label span { font-size: 12px; color: #555; background: #f0f0f0; padding: 2px 8px; border-radius: 4px; }

/* ─── SHOW MORE — texto ligero alineado a la derecha ──────────── */
.wcaf-show-more {
	display: inline-flex !important;
	visibility: visible !important;
	align-items: center;
	gap: 3px;
	flex-shrink: 0;
	margin-top: 0;
	padding: 0;
	background: none !important;
	border: none !important;
	box-shadow: none !important;
	color: #bbb !important;
	font-size: 11px !important;
	font-weight: 400 !important;
	text-transform: none !important;
	letter-spacing: 0 !important;
	cursor: pointer;
	text-decoration: none;
	white-space: nowrap;
	transition: color .15s;
}
.wcaf-show-more:hover { color: #2c5f8a !important; }
.wcaf-more-icon {
	font-size: 10px;
	line-height: 1;
	display: inline-block;
	transition: transform .2s;
}
.wcaf-show-more.wcaf-expanded .wcaf-more-icon { transform: rotate(180deg); }

/* ─── MOBILE DRAWER ───────────────────────────────────────────── */
.wcaf-mobile-trigger {
	display: none;
	align-items: center;
	gap: 8px;
	padding: 10px 16px;
	background: #2c5f8a;
	color: #fff;
	border: none;
	border-radius: 6px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	margin-bottom: 12px;
}
.wcaf-mobile-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 18px;
	height: 18px;
	padding: 0 4px;
	background: #fff;
	color: #2c5f8a;
	border-radius: 10px;
	font-size: 11px;
	font-weight: 700;
}
.wcaf-mobile-overlay {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(0,0,0,.45);
	z-index: 9998;
	opacity: 0;
	transition: opacity .25s;
}
.wcaf-mobile-overlay.wcaf-overlay-visible { opacity: 1; }

.wcaf-panel-footer {
	position: sticky;
	bottom: 0;
	padding: 12px 16px;
	background: #fff;
	border-top: 1px solid #eee;
	box-shadow: 0 -2px 8px rgba(0,0,0,.06);
}
.wcaf-apply-btn {
	display: block;
	width: 100%;
	padding: 12px;
	background: #2c5f8a;
	color: #fff;
	border: none;
	border-radius: 6px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	transition: background .15s;
}
.wcaf-apply-btn:hover { background: #1a3f60; }

@media ( max-width: 768px ) {
	.wcaf-mobile-trigger { display: inline-flex; }
	.wcaf-mobile-overlay { display: block; }

	.wcaf-filter-panel {
		position: fixed;
		top: 0; left: 0;
		width: min(320px, 85vw);
		height: 100%;
		background: #fff;
		z-index: 9999;
		overflow-y: auto;
		padding: 20px 16px;
		box-sizing: border-box;
		transform: translateX(-110%);
		transition: transform .3s cubic-bezier(.4,0,.2,1);
		box-shadow: 4px 0 24px rgba(0,0,0,.15);
	}
	.wcaf-filter-panel.wcaf-panel-open { transform: translateX(0); }
	.wcaf-panel-footer { display: block !important; }
}

@media ( min-width: 769px ) {
	.wcaf-mobile-trigger,
	.wcaf-mobile-overlay,
	.wcaf-panel-close,
	.wcaf-panel-footer { display: none !important; }
}

/* ─── Loader overlay con favicon ──────────────────────────────── */
#wcaf-loader-overlay {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(255,255,255,.55);
	backdrop-filter: blur(2px);
	z-index: 99999;
	align-items: center;
	justify-content: center;
	flex-direction: column;
	gap: 12px;
}
#wcaf-loader-overlay.wcaf-visible { display: flex; }

#wcaf-loader-overlay img {
	width: 52px;
	height: 52px;
	border-radius: 50%;
	animation: wcaf-pulse 1s ease-in-out infinite;
	filter: drop-shadow(0 4px 12px rgba(44,95,138,.35));
}
#wcaf-loader-overlay span {
	font-size: 13px;
	color: #2c5f8a;
	font-weight: 600;
	letter-spacing: .03em;
	animation: wcaf-fade .8s ease-in-out infinite alternate;
}
@keyframes wcaf-pulse {
	0%, 100% { transform: scale(1);    opacity: 1; }
	50%       { transform: scale(1.15); opacity: .75; }
}
@keyframes wcaf-fade {
	from { opacity: .5; } to { opacity: 1; }
}

/* ─── Loading grid ────────────────────────────────────────────── */
.wcaf-products-loading {
	opacity: .4;
	transition: opacity .2s;
	pointer-events: none;
}

/* ─── Sin resultados ──────────────────────────────────────────── */
.wcaf-no-results {
	padding: 40px 20px;
	text-align: center;
	color: #aaa;
	font-size: 15px;
}
