/* eledeve · Listado de tools (PLP)
   Usa las variables del tema (--color-panel, --color-line, --color-ink...) para
   que funcione igual en modo claro y oscuro. Todo va dentro de .edt para no
   pisar nada del sitio. */

.edt {
	--edt-free: #16a36b;
	--edt-free-bg: rgba(22, 163, 107, .14);
	--edt-prem-1: #7b3cff;
	--edt-prem-2: #ff2e9a;
	--edt-radius: 14px;
	max-width: var(--content-width, 1200px);
	margin: 0 auto;
	padding: 28px 20px 72px;
	color: var(--color-ink, #11223f);
	font-family: var(--font-body, "Barlow", Arial, sans-serif);
	box-sizing: border-box;
}
.edt *, .edt *::before, .edt *::after { box-sizing: border-box; }

/* ---------- Encabezado ---------- */
.edt-crumbs { font-size: 13px; color: var(--color-muted, #5a678a); margin-bottom: 14px; }
.edt-crumbs a { color: inherit; text-decoration: none; }
.edt-crumbs a:hover { color: var(--color-ink); }
.edt-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 26px; }
.edt-eyebrow { font: 700 12px/1 var(--font-display, sans-serif); letter-spacing: .14em; text-transform: uppercase; color: var(--color-accent, #ff2e9a); margin: 0 0 10px; }
.edt-title { font: 700 clamp(32px, 4vw, 44px)/1.05 var(--font-display, sans-serif); margin: 0 0 10px; color: var(--color-ink); }
.edt-sub { margin: 0; max-width: 620px; color: var(--color-muted); font-size: 16px; line-height: 1.5; }

/* ---------- Estructura: filtros + grilla ---------- */
.edt-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 28px; align-items: start; }

/* ---------- Filtros ---------- */
.edt-filters { position: sticky; top: 130px; background: var(--color-panel, #fff); border: 1px solid var(--color-line, #dbe3f0); border-radius: var(--edt-radius); padding: 18px; }
.edt-filters-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.edt-filters-top h2 { font: 700 18px/1 var(--font-display, sans-serif); margin: 0; color: var(--color-ink); }
.edt-clear { background: none; border: 0; padding: 0; font: 600 13px var(--font-body); color: var(--color-blue, #1e5bff); cursor: pointer; }
.edt-clear[hidden] { display: none; }
.edt-close { display: none; }
.edt-group { border-top: 1px solid var(--color-line); padding-top: 14px; margin-top: 14px; }
.edt-group h3 { font: 700 12px/1 var(--font-display, sans-serif); letter-spacing: .12em; text-transform: uppercase; color: var(--color-muted); margin: 0 0 10px; }
.edt-search { width: 100%; height: 40px; border-radius: 10px; border: 1px solid var(--color-line); background: var(--color-panel-alt, #eef2fa); color: var(--color-ink); padding: 0 12px; font: 15px var(--font-body); }
.edt-search::placeholder { color: var(--color-muted); }
.edt-search:focus { outline: 2px solid var(--color-blue, #1e5bff); outline-offset: 1px; }
.edt-opt { display: flex; align-items: center; gap: 10px; padding: 7px 0; cursor: pointer; font-size: 15px; color: var(--color-ink); }
.edt-opt input { width: 17px; height: 17px; margin: 0; accent-color: var(--color-blue, #1e5bff); cursor: pointer; flex: none; }
.edt-opt span { flex: 1; }
.edt-opt small { font-size: 12px; color: var(--color-muted); background: var(--color-panel-alt); border-radius: 99px; padding: 2px 8px; }
.edt-opt.is-empty { opacity: .45; }

/* ---------- Barra de resultados ---------- */
.edt-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.edt-count { font-size: 15px; color: var(--color-muted); }
.edt-count b { color: var(--color-ink); }
.edt-bar-right { display: flex; align-items: center; gap: 10px; }
.edt-sort { height: 38px; border-radius: 10px; border: 1px solid var(--color-line); background: var(--color-panel); color: var(--color-ink); padding: 0 10px; font: 14px var(--font-body); cursor: pointer; }
.edt-open { display: none; }
.edt-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: -4px 0 16px; }
.edt-chips:empty { display: none; }
.edt-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--color-line); background: var(--color-panel); color: var(--color-ink); border-radius: 99px; padding: 5px 12px; font: 600 13px var(--font-body); cursor: pointer; }
.edt-chip::after { content: "×"; font-size: 15px; line-height: 1; color: var(--color-muted); }

/* ---------- Grilla: las columnas las pone tools-plp.js para que las filas
   queden siempre parejas (hasta 4 en escritorio, 3 en tablet, 2 en celular) ---------- */
.edt-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
/* Cuando la cantidad no se puede repartir parejo: una por renglón, en formato lista */
.edt-grid.is-list .edt-card { flex-direction: row; }
.edt-grid.is-list .edt-cover { flex: 0 0 clamp(120px, 30%, 240px); aspect-ratio: auto; min-height: 150px; }
.edt-grid.is-list .edt-desc { -webkit-line-clamp: 2; }

/* ---------- Tarjeta ---------- */
.edt-card { position: relative; display: flex; flex-direction: column; background: var(--color-panel); border: 1px solid var(--color-line); border-radius: var(--edt-radius); overflow: hidden; text-decoration: none; color: inherit; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.edt-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-raised, 0 22px 60px rgba(17, 34, 63, .16)); border-color: var(--color-blue, #1e5bff); }
.edt-card:focus-visible { outline: 3px solid var(--color-blue); outline-offset: 2px; }
.edt-card.is-prem { border-color: rgba(123, 60, 255, .55); }
.edt-card.is-prem:hover { border-color: var(--edt-prem-2); }

.edt-cover { position: relative; aspect-ratio: 16 / 10; display: grid; place-items: center; overflow: hidden;
	background:
		linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px) 0 0 / 22px 22px,
		linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px) 0 0 / 22px 22px,
		linear-gradient(135deg, #1e5bff, #1440b8); }
.edt-card.is-prem .edt-cover {
	background:
		linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px) 0 0 / 22px 22px,
		linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px) 0 0 / 22px 22px,
		linear-gradient(135deg, #4b1fb8 0%, #7b3cff 45%, #ff2e9a 100%); }
.edt-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.edt-cover svg { width: 46px; height: 46px; color: #fff; opacity: .95; }

.edt-badge { position: absolute; top: 10px; left: 10px; display: inline-flex; align-items: center; gap: 5px; border-radius: 99px; padding: 5px 10px; font: 700 11px/1 var(--font-display, sans-serif); letter-spacing: .1em; text-transform: uppercase; }
.edt-badge.free { background: #fff; color: #0f7a50; }
.edt-badge.prem { background: linear-gradient(90deg, #ffd36b, #ffb020); color: #3a2400; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.edt-badge svg { width: 11px; height: 11px; }

.edt-body { display: flex; flex-direction: column; flex: 1; padding: 14px 15px 15px; }
.edt-cat { font: 700 11px/1 var(--font-display, sans-serif); letter-spacing: .12em; text-transform: uppercase; color: var(--color-blue, #1e5bff); margin-bottom: 8px; }
[data-theme="dark"] .edt-cat { color: #7fa2ff; }
.edt-name { font: 700 19px/1.15 var(--font-display, sans-serif); margin: 0 0 8px; color: var(--color-ink); }
.edt-desc { margin: 0 0 14px; font-size: 14px; line-height: 1.45; color: var(--color-muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.edt-foot { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; padding-top: 12px; border-top: 1px solid var(--color-line); }
.edt-price { display: flex; flex-direction: column; }
.edt-price b { font: 700 22px/1 var(--font-display, sans-serif); color: var(--color-ink); }
.edt-price small { font-size: 11px; color: var(--color-muted); margin-top: 3px; }
.edt-price.free b { color: var(--edt-free); }
.edt-go { flex: none; display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border-radius: 99px; background: var(--color-accent, #ff2e9a); color: #fff; font: 700 13px var(--font-body); white-space: nowrap; }
.edt-card.is-free .edt-go { background: var(--edt-free); }

.edt-empty { grid-column: 1 / -1; text-align: center; padding: 50px 20px; border: 1px dashed var(--color-line); border-radius: var(--edt-radius); color: var(--color-muted); }
.edt-empty button { margin-top: 12px; }
.edt-btn { display: inline-flex; align-items: center; height: 38px; padding: 0 16px; border-radius: 99px; border: 0; background: var(--color-blue, #1e5bff); color: #fff; font: 700 14px var(--font-body); cursor: pointer; }

.edt-backdrop { display: none; }

/* ---------- Tablet y celular: filtros en panel desplegable ---------- */
@media (max-width: 860px) {
	.edt-layout { grid-template-columns: minmax(0, 1fr); }
	.edt-open { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--color-line); background: var(--color-panel); color: var(--color-ink); font: 700 14px var(--font-body); cursor: pointer; }
	.edt-open b { background: var(--color-accent); color: #fff; border-radius: 99px; padding: 1px 7px; font-size: 12px; }
	.edt-open b:empty { display: none; }
	.edt-filters { position: fixed; z-index: 100001; top: 0; bottom: 0; left: 0; width: min(330px, 88vw); border-radius: 0 var(--edt-radius) var(--edt-radius) 0; overflow-y: auto; transform: translateX(-105%); transition: transform .22s ease; }
	.edt.is-open .edt-filters { transform: none; }
	.edt-close { display: inline-flex; background: none; border: 0; font-size: 26px; line-height: 1; color: var(--color-ink); cursor: pointer; padding: 0 0 0 10px; }
	.edt.is-open .edt-backdrop { display: block; position: fixed; inset: 0; z-index: 100000; background: rgba(5, 10, 25, .55); }
	.edt-show { margin-top: 18px; width: 100%; justify-content: center; }
}
@media (min-width: 861px) { .edt-show { display: none; } }

/* ---------- Celular chico: tarjeta más compacta, sigue en 2 por renglón ---------- */
@media (max-width: 520px) {
	.edt { padding: 20px 14px 56px; }
	.edt-grid { gap: 12px; }
	.edt-body { padding: 11px 11px 12px; }
	.edt-name { font-size: 16px; }
	.edt-desc { display: none; }
	.edt-foot { flex-direction: column; align-items: stretch; }
	.edt-go { justify-content: center; }
	.edt-price b { font-size: 19px; }
	.edt-badge { top: 8px; left: 8px; padding: 4px 8px; font-size: 10px; }
	.edt-bar { gap: 8px; }
	.edt-sort { max-width: 150px; }
	.edt-grid.is-list .edt-cover { min-height: 120px; flex-basis: 34%; }
	.edt-grid.is-list .edt-desc { display: -webkit-box; font-size: 13px; margin-bottom: 10px; }
	.edt-grid.is-list .edt-foot { flex-direction: row; align-items: flex-end; }
}
