/* DT Grid WooCommerce · Digital Think
 * Los colores vienen de DT Identidad Visual Plataforma 360 (variables globales --dt-*).
 * Los valores después de la coma son el respaldo si ese plugin no está activo. */
.dtgw {
	--dtgw-primario: var(--dt-primary, #7c3aed);
	--dtgw-primario-suave: var(--dt-primary-soft, #f1ebfd);
	--dtgw-oscuro: var(--dt-dark, #1b0d34);
	--dtgw-texto: var(--dt-text, #0f172a);
	--dtgw-texto-2: var(--dt-muted, #64748b);
	--dtgw-linea: var(--dt-border, #e5e7eb);
	--dtgw-suave: var(--dt-primary-soft-2, #f8f5fe);
	--dtgw-fondo: #ffffff;
	--dtgw-radio: 14px;
	--dtgw-cols: 3;
	color: var(--dtgw-texto);
	font-family: inherit;
	box-sizing: border-box;
	width: 100%;
	container-type: inline-size;
	container-name: dtgw;
}
.dtgw *,
.dtgw *::before,
.dtgw *::after { box-sizing: border-box; }

/* Buscador */
.dtgw .dtgw-busqueda { position: relative; margin: 0 0 18px; }
.dtgw .dtgw-busqueda svg {
	position: absolute;
	left: 20px;
	top: 50%;
	width: 20px;
	height: 20px;
	transform: translateY(-50%);
	color: var(--dtgw-texto-2);
	pointer-events: none;
}
.dtgw .dtgw-input {
	width: 100%;
	height: 60px;
	margin: 0;
	padding: 0 56px 0 54px;
	border: 2px solid var(--dtgw-linea);
	border-radius: 999px;
	background: var(--dtgw-fondo);
	color: var(--dtgw-texto);
	font: inherit;
	font-size: 17px;
	line-height: 1;
	box-shadow: none;
	transition: border-color .15s ease, box-shadow .15s ease;
	-webkit-appearance: none;
	appearance: none;
}
.dtgw .dtgw-input::placeholder { color: var(--dtgw-texto-2); opacity: .8; }
.dtgw .dtgw-input:focus {
	outline: none;
	border-color: var(--dtgw-primario);
	box-shadow: 0 0 0 4px rgba(var(--dt-primary-rgb, 124, 58, 237), .16);
}
.dtgw .dtgw-input::-webkit-search-cancel-button { display: none; }
.dtgw .dtgw-limpiar {
	position: absolute;
	right: 10px;
	top: 50%;
	transform: translateY(-50%);
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--dtgw-texto-2);
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
}
.dtgw .dtgw-limpiar:hover { background: var(--dtgw-suave); color: var(--dtgw-texto); }
.dtgw .dtgw-limpiar[hidden] { display: none; }

/* Filtros: una pestaña por categoría de WooCommerce */
.dtgw .dtgw-filtros {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
	gap: 10px;
	margin: 0 0 22px;
	padding: 0;
	list-style: none;
}
.dtgw .dtgw-filtros li { margin: 0; padding: 0; min-width: 0; }
.dtgw .dtgw-filtros li::before { content: none; }
.dtgw .dtgw-filtro {
	--dtgw-area: var(--dtgw-oscuro);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	width: 100%;
	min-height: 56px;
	margin: 0;
	padding: 10px 14px 10px 16px;
	border: 2px solid var(--dtgw-linea);
	border-left: 6px solid var(--dtgw-area);
	border-radius: 12px;
	background: var(--dtgw-fondo);
	color: var(--dtgw-texto);
	font: inherit;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.25;
	text-align: left;
	text-transform: none;
	letter-spacing: normal;
	box-shadow: none;
	cursor: pointer;
	transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.dtgw .dtgw-filtro:hover,
.dtgw .dtgw-filtro:focus { border-color: var(--dtgw-area); background: var(--dtgw-fondo); color: var(--dtgw-texto); }
.dtgw .dtgw-filtro[aria-pressed="true"],
.dtgw .dtgw-filtro[aria-pressed="true"]:hover {
	background: var(--dtgw-area);
	border-color: var(--dtgw-area);
	color: var(--dtgw-sobre-area, #fff);
}
.dtgw .dtgw-cuenta {
	flex: none;
	min-width: 30px;
	padding: 3px 8px;
	border-radius: 999px;
	background: var(--dtgw-suave);
	color: var(--dtgw-texto-2);
	font-size: 13px;
	font-weight: 600;
	text-align: center;
	font-variant-numeric: tabular-nums;
}
.dtgw .dtgw-filtro[aria-pressed="true"] .dtgw-cuenta { background: rgba(255, 255, 255, .22); color: inherit; }

/* Estado */
.dtgw .dtgw-estado {
	margin: 0 0 16px;
	min-height: 1.4em;
	color: var(--dtgw-texto-2);
	font-size: 15px;
}
.dtgw .dtgw-estado strong { color: var(--dtgw-texto); }

/* Grilla: 3 columnas por defecto */
.dtgw .dtgw-grilla {
	display: grid;
	grid-template-columns: repeat(var(--dtgw-cols), minmax(0, 1fr));
	gap: 24px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.dtgw .dtgw-card {
	--dtgw-area: var(--dtgw-primario);
	display: flex;
	flex-direction: column;
	height: 100%;
	margin: 0;
	padding: 0;
	border: 1px solid var(--dtgw-linea);
	border-radius: var(--dtgw-radio);
	background: var(--dtgw-fondo);
	overflow: hidden;
	transition: border-color .15s ease, transform .15s ease;
}
.dtgw .dtgw-card::before { content: none; }
.dtgw .dtgw-card:hover { border-color: var(--dtgw-area); transform: translateY(-2px); }
.dtgw .dtgw-img {
	position: relative;
	display: block;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: var(--dtgw-suave);
	border-bottom: 5px solid var(--dtgw-area);
}
.dtgw .dtgw-img img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	border-radius: 0;
	object-fit: cover;
}
.dtgw .dtgw-cuerpo {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 8px;
	padding: 16px 18px 18px;
}
.dtgw .dtgw-area {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	margin: 0;
	color: var(--dtgw-texto-2);
	font-size: 13px;
	font-weight: 600;
	line-height: 1.3;
}
.dtgw .dtgw-area::before {
	content: "";
	flex: none;
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: var(--dtgw-area);
}
.dtgw .dtgw-titulo {
	margin: 0;
	padding: 0;
	color: var(--dtgw-texto);
	font-family: inherit;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.3;
	text-transform: none;
	letter-spacing: normal;
}
.dtgw .dtgw-titulo a { color: inherit; text-decoration: none; box-shadow: none; }
.dtgw .dtgw-titulo a:hover { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.dtgw .dtgw-desc {
	margin: 0;
	color: var(--dtgw-texto-2);
	font-size: 15px;
	font-weight: 400;
	line-height: 1.5;
}
.dtgw .dtgw-pie {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-top: auto;
	padding-top: 10px;
}
.dtgw .dtgw-precio {
	margin: 0;
	color: var(--dtgw-texto);
	font-size: 17px;
	font-weight: 700;
	line-height: 1.25;
	font-variant-numeric: tabular-nums;
}
.dtgw .dtgw-precio del { display: block; color: var(--dtgw-texto-2); font-size: 13px; font-weight: 500; }
.dtgw .dtgw-precio ins { background: none; text-decoration: none; }
.dtgw .dtgw-ver {
	flex: none;
	display: inline-flex;
	align-items: center;
	min-height: 42px;
	padding: 0 18px;
	border-radius: 999px;
	background: var(--dtgw-oscuro);
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
	transition: background-color .15s ease;
}
.dtgw .dtgw-ver:hover,
.dtgw .dtgw-ver:focus { background: var(--dtgw-primario); color: #fff; text-decoration: none; }

/* Vacío, error, cargar más */
.dtgw .dtgw-vacio {
	padding: 40px 24px;
	border: 2px dashed var(--dtgw-linea);
	border-radius: var(--dtgw-radio);
	text-align: center;
}
.dtgw .dtgw-vacio p { margin: 0 0 14px; font-size: 16px; }
.dtgw .dtgw-vacio[hidden],
.dtgw .dtgw-mas[hidden] { display: none; }
.dtgw .dtgw-boton {
	min-height: 46px;
	margin: 0;
	padding: 0 24px;
	border: 2px solid var(--dtgw-oscuro);
	border-radius: 999px;
	background: transparent;
	color: var(--dtgw-oscuro);
	font: inherit;
	font-size: 15px;
	font-weight: 600;
	text-transform: none;
	cursor: pointer;
}
.dtgw .dtgw-boton:hover,
.dtgw .dtgw-boton:focus { background: var(--dtgw-oscuro); border-color: var(--dtgw-oscuro); color: #fff; }
.dtgw .dtgw-mas { margin: 28px 0 0; text-align: center; }

/* Carga */
.dtgw .dtgw-grilla[aria-busy="true"] { opacity: .6; transition: opacity .2s ease; }
.dtgw .dtgw-esqueleto {
	height: 360px;
	border-radius: var(--dtgw-radio);
	background: linear-gradient(100deg, var(--dtgw-suave) 40%, var(--dtgw-primario-suave) 50%, var(--dtgw-suave) 60%) 0 0 / 300% 100%;
	animation: dtgw-brillo 1.3s linear infinite;
}
@keyframes dtgw-brillo { to { background-position: -150% 0; } }

/* Foco: solo visible al navegar con teclado (evita el contorno de foco del tema al hacer clic). */
.dtgw .dtgw-filtro:focus:not(:focus-visible),
.dtgw .dtgw-boton:focus:not(:focus-visible),
.dtgw .dtgw-ver:focus:not(:focus-visible) { outline: none; }

.dtgw .dtgw-filtro:focus-visible,
.dtgw .dtgw-ver:focus-visible,
.dtgw .dtgw-boton:focus-visible,
.dtgw .dtgw-limpiar:focus-visible,
.dtgw .dtgw-titulo a:focus-visible {
	outline: 3px solid var(--dtgw-primario);
	outline-offset: 3px;
}

.dtgw .dtgw-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

/* Las columnas se adaptan al espacio real del Grid (también dentro de columnas de Elementor):
   3 columnas cuando caben cómodas, luego 2 y luego 1. */
@container dtgw (max-width: 780px) {
	.dtgw .dtgw-grilla { grid-template-columns: repeat(min(var(--dtgw-cols), 2), minmax(0, 1fr)); gap: 20px; }
	.dtgw .dtgw-filtros { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container dtgw (max-width: 520px) {
	.dtgw .dtgw-input { height: 54px; font-size: 16px; }
	.dtgw .dtgw-filtro { min-height: 52px; padding-left: 12px; font-size: 14px; }
	.dtgw .dtgw-grilla { grid-template-columns: 1fr; gap: 16px; }
}
/* Respaldo para navegadores antiguos sin container queries. */
@supports not (container-type: inline-size) {
	@media (max-width: 900px) {
		.dtgw .dtgw-grilla { grid-template-columns: repeat(min(var(--dtgw-cols), 2), minmax(0, 1fr)); gap: 20px; }
		.dtgw .dtgw-filtros { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	}
	@media (max-width: 560px) {
		.dtgw .dtgw-grilla { grid-template-columns: 1fr; gap: 16px; }
	}
}
@media (prefers-reduced-motion: reduce) {
	.dtgw *,
	.dtgw *::before { transition: none !important; animation: none !important; }
	.dtgw .dtgw-card:hover { transform: none; }
}
