/* ==========================================================================
   Tienda, categorías y búsqueda — sistema visual de la home
   ========================================================================== */
.ecat-shop .ecat-wrap { max-width: 1280px; }

/* — cabecera navy con puntitos dorados — */
.ecat-shop-hero { position: relative; overflow: hidden; padding: 22px 0 34px; background: var(--navy); border-bottom: 4px solid var(--gold); color: #fff; }
.ecat-shop-hero::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(circle, rgba(245, 194, 64, .14) 2px, transparent 2px); background-size: 22px 22px; pointer-events: none; }
.ecat-shop-hero .ecat-wrap { position: relative; }
.ecat-shop-hero .ecat-crumbs { padding-bottom: 20px; font-size: 13px; }
.ecat-eyebrow.is-gold { color: var(--gold); margin-bottom: 10px; }
.ecat-eyebrow.is-gold::before { display: none; }
.ecat-shop-title { margin: 0 0 12px; max-width: 820px; font-size: clamp(40px, 5.2vw, 64px); line-height: .92; letter-spacing: 1px; color: #fff; text-wrap: balance; }
.ecat-shop-text { margin: 0 0 20px; max-width: 560px; font-size: 16px; font-weight: 600; line-height: 1.6; color: rgba(255, 255, 255, .85); }
.ecat-shop-badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.ecat-shop-badges li {
	display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px; border-radius: 2px;
	background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .25);
	font-family: var(--font-c); font-size: 13px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase;
}
.ecat-shop-badges strong { font-family: var(--font-h); font-size: 17px; font-weight: 400; letter-spacing: .5px; color: var(--gold); }
.ecat-shop-badges .woocommerce-Price-amount { color: var(--gold); }

/* — cuerpo — */
.ecat-shop-body { padding: 32px 0 48px; }
.ecat-shop-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 40px; align-items: start; }
.ecat-shop-layout.no-filters { grid-template-columns: minmax(0, 1fr); }

/* filtros */
.ecat-filters { position: sticky; top: 104px; max-height: calc(100vh - 120px); overflow-y: auto; scrollbar-width: thin; }
.ecat-filters-box { background: var(--card); border: 2px solid var(--edge); box-shadow: 4px 4px 0 rgba(0, 0, 0, .12); }
.ecat-filters-sum {
	display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px; cursor: pointer; list-style: none;
	background: var(--navy); color: #fff; font-family: var(--font-c); font-size: 15px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase;
}
.ecat-filters-sum::-webkit-details-marker { display: none; }
.ecat-filters-sum::after { content: "▾"; margin-left: auto; font-size: 14px; }
.ecat-filters-box[open] > .ecat-filters-sum::after { content: "▴"; }
.ecat-filters-on { display: inline-flex; min-width: 22px; height: 22px; padding: 0 6px; align-items: center; justify-content: center; border-radius: 11px; background: var(--gold); color: var(--ink); font-size: 12px; letter-spacing: 0; }
.ecat-filters-on[hidden] { display: none; }
.ecat-filters-body { padding: 14px 16px 16px; }
.ecat-fg { margin: 0 0 16px; padding: 0 0 14px; border: 0; border-bottom: 1.5px dashed var(--border); min-width: 0; }
.ecat-fg-t { margin-bottom: 6px; padding: 0; font-family: var(--font-c); font-size: 13px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; color: var(--navy); }
.ecat-fg label { display: flex; align-items: center; gap: 8px; min-height: 32px; font-size: 14px; font-weight: 600; line-height: 1.3; cursor: pointer; }
.ecat-fg input { width: 17px; height: 17px; flex-shrink: 0; margin: 0; accent-color: var(--teal); cursor: pointer; }
.ecat-fg-n { color: var(--gray); font-size: 12px; font-weight: 700; }
.ecat-fg-link { display: flex; align-items: center; min-height: 32px; font-size: 14px; font-weight: 700; color: var(--ink); text-decoration: none; }
.ecat-fg-link::before { content: "›"; width: 14px; color: var(--teal-text); font-weight: 900; }
.ecat-fg-link:hover { color: var(--teal-text); text-decoration: underline; }
.ecat-fg-link.is-current { color: var(--teal-text); }
.ecat-fg-link.is-current::before { content: "●"; font-size: 9px; }
.ecat-fg-reset { padding: 6px 0; border: 0; background: none; cursor: pointer; font-family: var(--font-c); font-size: 14px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; color: var(--teal-text); text-decoration: underline; }
.ecat-fg-reset:hover { color: var(--navy); }

/* barra de recuento y orden */
.ecat-shop-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.ecat-shop-count { margin: 0; font-family: var(--font-c); font-size: 15px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--gray-2); }
.ecat-shop-count strong { font-family: var(--font-h); font-size: 26px; font-weight: 400; color: var(--ink); vertical-align: -2px; }
.ecat-shop-sort { display: flex; align-items: center; gap: 8px; font-family: var(--font-c); font-size: 14px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--gray-2); }
.ecat-shop-sort select {
	min-height: 42px; padding: 0 34px 0 12px; border: 2px solid var(--edge); border-radius: 3px; cursor: pointer; appearance: none;
	background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23333' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 12px center;
	font-family: var(--font-b); font-size: 15px; font-weight: 700; color: var(--ink); text-transform: none; letter-spacing: 0;
}

/* — rejilla de tarjetas — */
.ecat-shop-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; margin: 0; padding: 0; list-style: none; }
.ecat-scard[hidden], .ecat-shop-banner[hidden] { display: none; }
.ecat-scard-frame {
	position: relative; aspect-ratio: 4 / 5; overflow: hidden; background: #2d2d2d;
	border: 8px solid var(--card); box-shadow: var(--shadow-pin); transition: transform .2s, box-shadow .2s;
}
.ecat-scard:nth-child(3n+1) .ecat-scard-frame { --tilt: -.6deg; }
.ecat-scard:nth-child(3n+2) .ecat-scard-frame { --tilt: .5deg; }
.ecat-scard:nth-child(3n) .ecat-scard-frame { --tilt: -.3deg; }
.ecat-scard:hover .ecat-scard-frame, .ecat-scard:focus-within .ecat-scard-frame { transform: translateY(-6px) rotate(var(--tilt, -.5deg)); box-shadow: 10px 14px 24px rgba(0, 0, 0, .35); }
.ecat-scard.is-sale .ecat-scard-frame { border-color: var(--card); outline: 3px solid var(--gold); outline-offset: -3px; }
.ecat-scard-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .45s; }
.ecat-scard-img.is-hover { opacity: 0; }
.ecat-scard-badge {
	position: absolute; top: 12px; left: 10px; z-index: 4; padding: 4px 11px; transform: rotate(-5deg);
	background: var(--gold); color: var(--ink); border: 2px solid var(--edge); box-shadow: 0 4px 12px var(--edge-shadow);
	font-family: var(--font-c); font-size: 12px; font-weight: 900; letter-spacing: 1px; text-transform: uppercase;
}
.ecat-scard-ov {
	position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; justify-content: flex-end; padding: 14px;
	background: linear-gradient(transparent 50%, rgba(0, 0, 0, .82)); transition: background .4s;
}
.ecat-scard-t { margin: 0; font-family: var(--font-c); font-size: 17px; font-weight: 900; line-height: 1.15; letter-spacing: 0; text-transform: uppercase; text-shadow: 1px 2px 6px rgba(0, 0, 0, .8); }
.ecat-scard-link { color: #fff; text-decoration: none; transition: color .3s; }
.ecat-scard-link::after { content: ""; position: absolute; inset: 0; z-index: 1; } /* toda la tarjeta lleva a la ficha */
.ecat-scard-link:focus-visible { outline: none; }
.ecat-scard:has(.ecat-scard-link:focus-visible) .ecat-scard-frame { outline: 3px solid var(--teal); outline-offset: 3px; }
.ecat-scard-info { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; max-height: 0; opacity: 0; overflow: hidden; transition: max-height .4s, opacity .35s, margin .3s; }
.ecat-scard-desc { display: none; margin: 0 0 4px; font-size: 13px; font-weight: 600; line-height: 1.4; color: rgba(255, 255, 255, .9); }
.ecat-scard-meta { font-family: var(--font-c); font-size: 12.5px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--promo); }
.ecat-scard-meta.is-stars span[aria-hidden] { color: var(--gold); letter-spacing: 1px; }
.ecat-scard-price { margin-top: 4px; font-family: var(--font-h); font-size: 26px; line-height: 1; color: var(--gold); }
.ecat-scard-price del { margin-right: 6px; font-size: 16px; color: rgba(255, 255, 255, .55); }
.ecat-scard-price ins { text-decoration: none; }
.ecat-scard-btn {
	position: relative; z-index: 2; display: inline-flex; align-items: center; white-space: nowrap; min-height: 40px; margin-top: 8px; padding: 0 14px; border-radius: 3px;
	background: var(--lime); color: var(--lime-ink); text-decoration: none; border: 2px solid rgba(43, 58, 30, .16);
	font-family: var(--font-c); font-size: 13px; font-weight: 900; letter-spacing: 1px; text-transform: uppercase; transition: background .15s, transform .15s;
}
.ecat-scard-btn:hover { background: var(--lime-hover); color: var(--lime-ink); transform: translateY(-1px); }
.ecat-scard-btn.loading { opacity: .7; cursor: progress; }
.ecat-scard-btn.added { background: var(--teal); border-color: var(--teal); color: #fff; }
.ecat-scard-btn.added::after { content: " ✓"; }
.ecat-scard .added_to_cart { display: none; } /* el enlace «Ver carrito» que añade WooCommerce: ya se abre el carrito */

@media (hover: hover) {
	.ecat-scard:hover .ecat-scard-img.is-hover, .ecat-scard:focus-within .ecat-scard-img.is-hover { opacity: .45; }
	.ecat-scard:hover .ecat-scard-img:not(.is-hover), .ecat-scard:focus-within .ecat-scard-img:not(.is-hover) { opacity: 0; }
	.ecat-scard:hover .ecat-scard-ov, .ecat-scard:focus-within .ecat-scard-ov { background: rgba(20, 20, 20, .8); }
	.ecat-scard:hover .ecat-scard-link, .ecat-scard:focus-within .ecat-scard-link { color: var(--gold); }
	.ecat-scard:hover .ecat-scard-info, .ecat-scard:focus-within .ecat-scard-info { max-height: 320px; opacity: 1; margin-top: 8px; }
}
/* táctil: sin «pasar el ratón», precio y botón siempre visibles */
@media (hover: none) {
	.ecat-scard-info { max-height: none; opacity: 1; margin-top: 6px; }
	.ecat-scard-meta.is-extra { display: none; }
	.ecat-scard-ov { background: linear-gradient(transparent 35%, rgba(0, 0, 0, .88)); }
}

/* banner de packs */
.ecat-shop-banner {
	grid-column: 1 / -1; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
	margin: 8px 0; padding: 32px 40px; background: var(--slate); border: 2px solid var(--edge); box-shadow: 6px 6px 0 rgba(0, 0, 0, .15); color: #fff;
}
.ecat-shop-banner::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(circle, rgba(245, 194, 64, .12) 2px, transparent 2px); background-size: 20px 20px; pointer-events: none; }
.ecat-shop-banner > * { position: relative; }
.ecat-shop-banner h2 { margin: 0 0 8px; font-size: clamp(30px, 3.6vw, 44px); line-height: .95; color: var(--gold); }
.ecat-shop-banner p { margin: 0; max-width: 460px; font-size: 15px; font-weight: 600; line-height: 1.6; color: rgba(255, 255, 255, .88); }

.ecat-shop-empty { margin: 24px 0; padding: 20px; background: var(--card); border: 2px dashed var(--border); font-weight: 700; text-align: center; }
.ecat-shop-empty[hidden] { display: none; }
.ecat-shop-none { padding: 32px 0 8px; text-align: center; font-size: 17px; font-weight: 700; }

.woocommerce-pagination ul { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin: 32px 0 0; padding: 0; list-style: none; }
.woocommerce-pagination .page-numbers { display: inline-flex; min-width: 44px; min-height: 44px; align-items: center; justify-content: center; border: 2px solid var(--edge); border-radius: 3px; background: var(--card); text-decoration: none; font-family: var(--font-c); font-weight: 800; color: var(--ink); }
.woocommerce-pagination .page-numbers.current { background: var(--navy); border-color: var(--navy); color: #fff; }

/* texto SEO de la categoría (lo que va tras el primer párrafo) */
.ecat-shop-desc { max-width: 860px; margin: 48px auto 0; padding: 28px 32px; background: var(--card); border: 2px solid var(--edge); box-shadow: 6px 6px 0 rgba(0, 0, 0, .08); font-size: 16px; }
.ecat-shop-desc > :first-child { margin-top: 0; }
.ecat-shop-desc > :last-child { margin-bottom: 0; }

/* ¿Cómo funciona? */
.ecat-shop-steps { padding: 44px 0 52px; border-top: 3px solid var(--border); }
.ecat-shop-steps .ecat-h-title { margin: 0; font-size: 52px; line-height: .95; }
.ecat-shop-steps-sub { margin: 8px 0 28px; font-size: 16px; font-weight: 600; color: var(--gray-2); }

/* ==========================================================================
   Tamaños intermedios y móvil
   ========================================================================== */
@media (max-width: 1180px) {
	.ecat-shop-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
	.ecat-shop-layout { grid-template-columns: minmax(0, 1fr); gap: 18px; }
	.ecat-filters { position: static; max-height: none; overflow: visible; }
	.ecat-filters-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
	.ecat-fg-reset { grid-column: 1 / -1; justify-self: start; }
}
@media (max-width: 768px) {
	.ecat-shop-hero { padding: 18px 0 24px; }
	.ecat-shop-hero .ecat-crumbs { display: none; }
	.ecat-shop-title { font-size: 40px; }
	.ecat-shop-text { font-size: 15px; margin-bottom: 16px; }
	.ecat-shop-badges { flex-wrap: nowrap; overflow-x: auto; margin: 0 calc(var(--gutter) * -1); padding: 0 var(--gutter); scrollbar-width: none; }
	.ecat-shop-badges::-webkit-scrollbar { display: none; }
	.ecat-shop-badges li { flex-shrink: 0; white-space: nowrap; }
	.ecat-shop-body { padding: 18px 0 36px; }
	.ecat-filters-body { grid-template-columns: minmax(0, 1fr); }
	.ecat-shop-bar { margin-bottom: 12px; }
	.ecat-shop-sort > span { display: none; }
	.ecat-shop-sort select { font-size: 14px; }
	.ecat-shop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
	.ecat-scard-frame { border-width: 5px; aspect-ratio: 3 / 4.4; }
	.ecat-scard-ov { padding: 10px; }
	.ecat-scard-t { font-size: 14.5px; }
	.ecat-scard-price { font-size: 21px; }
	.ecat-scard-price del { font-size: 13px; }
	.ecat-scard-btn { min-height: 36px; width: 100%; justify-content: center; padding: 0 6px; font-size: 11.5px; letter-spacing: .5px; }
	.ecat-scard-badge { top: 8px; left: 6px; font-size: 10.5px; padding: 3px 8px; }
	.ecat-shop-banner { padding: 24px 20px; }
	.ecat-shop-desc { margin-top: 32px; padding: 20px 18px; }
	.ecat-shop-steps { padding: 32px 0 36px; }
	.ecat-shop-steps .ecat-h-title { font-size: 36px; }
}
@media (prefers-reduced-motion: reduce) {
	.ecat-scard-frame, .ecat-scard-img, .ecat-scard-ov, .ecat-scard-info { transition: none; }
}

/* ==========================================================================
   0.9.38 — filtros sin barra de desplazamiento, ficha rápida, móvil más directo
   ========================================================================== */
.ecat-filters { scrollbar-width: none; }
.ecat-filters::-webkit-scrollbar { display: none; }

/* — ficha rápida — */
.ecat-qv { width: min(760px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0; border: 1px solid var(--edge); border-radius: 6px; background: var(--card); color: var(--ink); box-shadow: 0 20px 60px rgba(0, 0, 0, .35); overflow: auto; }
.ecat-qv::backdrop { background: rgba(20, 20, 20, .55); }
.ecat-qv-in { position: relative; display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 24px; padding: 24px; }
.ecat-qv-x { position: absolute; top: 8px; right: 8px; z-index: 2; width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .06); color: var(--ink); font-size: 26px; line-height: 1; cursor: pointer; }
.ecat-qv-x:hover { background: rgba(0, 0, 0, .12); }
.ecat-qv-img { position: relative; align-self: start; }
.ecat-qv-img img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border: 6px solid #fff; box-shadow: 0 4px 14px rgba(0, 0, 0, .18); }
.ecat-qv-t { margin: 0 40px 10px 0; font-family: var(--font-c); font-size: 24px; font-weight: 800; line-height: 1.1; text-transform: uppercase; }
.ecat-qv-desc { margin: 0 0 12px; font-size: 15px; line-height: 1.55; }
.ecat-qv-spec { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; padding: 0; list-style: none; }
.ecat-qv-spec li { padding: 4px 10px; border: 1px solid var(--edge); border-radius: 999px; background: #fff; font-size: 13px; }
.ecat-qv-price { margin: 0 0 16px; font-family: var(--font-h); font-size: 34px; line-height: 1; }
.ecat-qv-price del { margin-right: 8px; font-size: 20px; color: var(--gray); }
.ecat-qv-price ins { text-decoration: none; }
.ecat-qv-acts { display: flex; flex-wrap: wrap; gap: 10px; }
.ecat-qv-acts .ecat-btn { min-height: 50px; flex: 1 1 180px; justify-content: center; }
.ecat-qv-add.added::after { content: " ✓"; }
.ecat-qv .added_to_cart { display: none; }

@media (max-width: 768px) {
	/* cabecera más corta: los juegos asoman en la primera pantalla */
	.ecat-shop-hero { padding: 10px 0 14px; border-bottom-width: 3px; }
	.ecat-shop-hero .ecat-eyebrow { display: none; }
	.ecat-shop-title { margin-bottom: 6px; font-size: 30px; }
	.ecat-shop-text { margin-bottom: 10px; font-size: 13.5px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
	.ecat-shop-badges li { padding: 4px 10px; font-size: 12px; }
	.ecat-shop-body { padding: 12px 0 32px; }
	.ecat-shop-layout { gap: 0; }

	/* «Filtrar» y «Ordenar» en una línea (el script mueve los filtros dentro de la barra) */
	.ecat-shop-bar { flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
	.ecat-shop-bar .ecat-shop-count { display: none; }
	.ecat-shop-bar .ecat-filters { flex: 1 1 0; min-width: 0; position: static; max-height: none; overflow: visible; }
	.ecat-shop-bar .ecat-filters:has(details[open]) { order: 2; flex-basis: 100%; }
	.ecat-shop-bar .ecat-filters-box { box-shadow: none; border-width: 1px; }
	.ecat-shop-bar .ecat-filters-sum { min-height: 42px; padding: 0 12px; font-size: 14px; }
	.ecat-shop-bar .ecat-shop-sort { flex: 1 1 0; min-width: 0; }
	.ecat-shop-bar .ecat-shop-sort select { width: 100%; min-height: 44px; border-width: 1px; }

	.ecat-qv-in { grid-template-columns: 1fr; gap: 14px; padding: 16px; }
	.ecat-qv-img { max-width: 220px; margin: 0 auto; }
	.ecat-qv-t { font-size: 21px; }
	.ecat-qv-price { font-size: 30px; margin-bottom: 12px; }
}
@media (max-width: 768px) {
	.ecat-qv-in { padding-bottom: 0; }
	.ecat-qv-img { max-width: 140px; }
	.ecat-qv-desc { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; font-size: 14px; }
	.ecat-qv-acts { position: sticky; bottom: 0; margin: 0 -16px; padding: 10px 16px 16px; background: var(--card); border-top: 1px solid var(--edge); }
	.ecat-qv-acts .ecat-btn { min-height: 46px; }
}
