/* Dónde Jugar Listings — Public board + single-listing detail.
 * Mobile-first, low-specificity, class-based. No IDs in selectors.
 * Self-contained: defines the tokens + button + field styles it needs
 * (scoped to .djl-board / .djl-listing-detail) so the page works without
 * dashboard.css or profile.css. */

/* --- Base (tokens live globally in tokens.css, enqueued as djl-tokens) --- */
.djl-board,
.djl-listing-detail {
	color: var(--djl-text);
	background: var(--djl-bg);
	font-family: var(--djl-font-body, inherit);
	line-height: 1.4;
	box-sizing: border-box;
}

.djl-board *,
.djl-board *::before,
.djl-board *::after,
.djl-listing-detail *,
.djl-listing-detail *::before,
.djl-listing-detail *::after {
	box-sizing: inherit;
}

.djl-board {
	display: block;
	padding: 1rem;
	max-width: 1360px;
	margin: 0 auto;
}

/* --- Filter bar --- */
.djl-board__filters {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: 0.6rem 0.75rem;
	align-items: end;
	background: var(--djl-card);
	border: 1px solid var(--djl-border);
	border-radius: 10px;
	padding: 1rem;
	margin-bottom: 1.25rem;
}

.djl-board__field {
	min-width: 0;
}

/* Min/max price share one filter cell so the bar stays compact. */
.djl-board__price-inputs {
	display: flex;
	gap: 0.4rem;
}

.djl-board__price-inputs .djl-field__input {
	width: 100%;
	min-width: 0;
}

.djl-board__filter-actions {
	grid-column: 1 / -1;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	justify-content: flex-start;
}

/* Visually-hidden but focusable — keeps the filter form submittable via Enter
   and without JS now that the visible "Filtrar" button is gone. */
.djl-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* --- Field (reused from profile.css conventions) --- */
.djl-field {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
}

.djl-field__label {
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--djl-text);
}

.djl-field__input {
	padding: 0.5rem 0.7rem;
	border: 1px solid var(--djl-border);
	border-radius: 6px;
	background: #fff;
	font-size: 0.95rem;
	color: var(--djl-text);
	font-family: inherit;
	width: 100%;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.djl-field__input:focus {
	outline: none;
	border-color: var(--djl-primary);
	box-shadow: 0 0 0 3px rgba(0, 51, 98, 0.15);
}

/* --- Buttons --- */
/* Button styles (.djl-btn / --primary / --ghost / --whatsapp …) live in the
 * shared assets/css/buttons.css, loaded before this file. */

/* --- Card grid --- */
/* Column counts are admin-editable (Ajustes → Tarjetas → "Columnas de la
 * cuadrícula"); the tablet/mobile counts live in the media queries below. */
.djl-board__grid {
	display: grid;
	grid-template-columns: repeat(var(--djl-cols-desktop), minmax(0, 1fr));
	gap: 1rem;
}

.djl-board__empty {
	padding: 2rem 1rem;
	text-align: center;
	background: var(--djl-card);
	border: 1px dashed var(--djl-border);
	border-radius: 10px;
	color: var(--djl-muted);
	font-size: 0.95rem;
}

/* --- Card --- */
.djl-bcard {
	display: flex;
	flex-direction: column;
	background: var(--djl-card);
	border: 1px solid var(--djl-border);
	border-radius: 10px;
	overflow: hidden;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.djl-bcard:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.djl-bcard__media {
	display: block;
	aspect-ratio: 4 / 3;
	background: #eef1f4;
	overflow: hidden;
}

.djl-bcard__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.djl-bcard__noimg {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #8a96a3;
	font-size: 0.85rem;
	letter-spacing: 0.02em;
	background: repeating-linear-gradient(
		45deg,
		#eef1f4,
		#eef1f4 8px,
		#e6eaef 8px,
		#e6eaef 16px
	);
}

.djl-bcard__body {
	padding: 0.75rem 0.9rem 0.9rem;
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	flex: 1;
	font-family: var(--djl-font-body, 'Open Sans', system-ui, sans-serif);
}

.djl-bcard__title {
	margin: 0 0 0.25rem;
	font-family: var(--djl-font-title, inherit);
	font-size: var(--djl-card-title-size);
	font-weight: var(--djl-card-title-weight);
	color: var(--djl-text);
	line-height: 1.25;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.djl-bcard__title a {
	color: inherit;
	text-decoration: none;
}

.djl-bcard__title a:hover,
.djl-bcard__title a:focus {
	text-decoration: none;
}

.djl-bcard__meta {
	margin: 0.1rem 0;
	font-size: var(--djl-card-meta-size);
	font-weight: var(--djl-card-meta-weight);
	color: var(--djl-muted);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.djl-bcard__meta--vendor {
	color: var(--djl-vendor-color);
}

/* Seller note shown as a one-line description; truncates with an ellipsis.
 * The full text is shown on the single-listing detail (.djl-detail__notes). */
.djl-bcard__note {
	margin: 0.1rem 0;
	font-size: var(--djl-card-meta-size);
	color: var(--djl-muted);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.djl-bcard__price {
	margin-top: auto;
	padding-top: 0.4rem;
	font-size: var(--djl-price-size);
	font-weight: var(--djl-price-weight);
	color: var(--djl-price-color);
}

.djl-bcard__more {
	margin: 0.5rem 0 0;
}

/* The "Ver detalles" card button (.djl-bcard__btn) is styled in the shared
 * buttons.css so it matches every other outline button. */

/* --- Defeat the theme underline on card media + title links --------------
 * hello-elementor underlines all <a> at specificity 0,1,1, so these two-class
 * selectors (0,2,x) win for every state. Button underlines are handled
 * globally in buttons.css. */
.djl-bcard a.djl-bcard__media,
.djl-bcard a.djl-bcard__media:visited,
.djl-bcard .djl-bcard__title a,
.djl-bcard .djl-bcard__title a:visited,
.djl-bcard .djl-bcard__title a:hover,
.djl-bcard .djl-bcard__title a:focus {
	text-decoration: none;
}

/* --- Pagination ---
 * Mirrors the shared .djl-btn--small .djl-btn--ghost visual language (same
 * tokens) so the pagination buttons stay in lockstep with the rest of the
 * button system. Update --djl-btn-outline-color / --djl-btn-radius /
 * --djl-btn-border in Ajustes → Dónde Jugar → Botones and the pagination
 * follows. */
.djl-board__pagination {
	margin: 1.5rem 0 0;
}

.djl-board__pagination ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	justify-content: center;
}

.djl-board__pagination li {
	display: inline-block;
}

.djl-board__pagination a,
.djl-board__pagination span {
	display: inline-block;
	padding: 0.3rem 0.6rem;
	font-size: 0.8rem;
	font-weight: 600;
	line-height: 1.2;
	border: var(--djl-btn-border) solid var(--djl-btn-outline-color);
	border-radius: var(--djl-btn-radius);
	background: transparent;
	color: var(--djl-btn-outline-color);
	text-decoration: none;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.djl-board__pagination a:hover,
.djl-board__pagination a:focus {
	background: var(--djl-btn-outline-color);
	color: #fff;
	border-color: var(--djl-btn-outline-color);
}

.djl-board__pagination .current {
	background: var(--djl-btn-outline-color);
	color: #fff;
	border-color: var(--djl-btn-outline-color);
	cursor: default;
}

/* --- Seller storefront header --- */
.djl-storefront__header {
	display: flex;
	align-items: center;
	gap: 1rem;
	flex-wrap: wrap;
	margin: 0 0 1.25rem;
	padding: 1rem 1.25rem;
	background: var(--djl-card, #fff);
	border: 1px solid var(--djl-border, #e0e6ed);
	border-radius: 10px;
}

.djl-storefront__avatar {
	width: 72px;
	height: 72px;
	border-radius: 50%;
	object-fit: cover;
	background: #eef1f4;
	border: 1px solid var(--djl-border, #e0e6ed);
}

.djl-storefront__title {
	margin: 0;
	font-size: 1.5rem;
	color: var(--djl-primary, #1a2a3a);
}

.djl-storefront__city {
	margin: 0.25rem 0 0;
	color: var(--djl-muted, #5a6b7b);
	font-size: 0.95rem;
}

.djl-storefront__contact {
	margin: 0.75rem 0 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

/* --- Single-listing detail --- */
.djl-listing-detail {
	display: block;
	max-width: 980px;
	margin: 0 auto;
	padding: 1rem;
}

/* Admin-styled title (size/weight/color/align come from inline style). */
.djl-detail__title {
	margin: 0 0 0.75rem;
	font-family: var(--djl-font-title, inherit);
	line-height: 1.2;
}

.djl-detail__back {
	margin: 0 0 1rem;
	font-size: 0.9rem;
}

.djl-detail__back a {
	color: var(--djl-primary);
	text-decoration: none;
	font-weight: 600;
}

.djl-detail__back a:hover,
.djl-detail__back a:focus {
	text-decoration: underline;
}

.djl-detail__layout {
	display: grid;
	grid-template-columns: minmax(240px, 380px) minmax(0, 1fr);
	gap: 1.5rem;
	align-items: start;
	background: var(--djl-card);
	border: 1px solid var(--djl-border);
	border-radius: 10px;
	padding: 1.25rem;
}

/* Keep the info column from stretching full-width (Walter: "demasiados
   espacios vacíos") — caps line length and pulls the stats/contact in. */
.djl-detail__info {
	max-width: 560px;
}

/* The media column holds the main image AND the thumbnail strip, so it must
   grow with its content — a fixed aspect-ratio + overflow:hidden here clips the
   thumbnails when a tall image is swapped into the main slot. The uniform 4:3
   frame lives on .djl-gallery__main (see lightbox.css) instead. */
.djl-detail__media {
	background: transparent;
	border-radius: 8px;
}

.djl-detail__info {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.djl-detail__price {
	margin: 0;
	font-size: 1.5rem;
	font-weight: 700;
	color: var(--djl-price-color);
}

.djl-detail__meta {
	margin: 0;
	font-size: 0.95rem;
	color: var(--djl-text);
}

/* Jugadores / Duración / Edad (and Complejidad) sit inline on one row; they
   wrap only when the column is too narrow to hold them. */
.djl-detail__stats {
	margin: 0.75rem 0 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1.5rem;
}

.djl-detail__stats > div {
	display: flex;
	flex-direction: column;
	gap: 0.1rem;
}

.djl-detail__stats dt {
	font-size: 0.7rem;
	font-weight: 700;
	color: var(--djl-muted);
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.djl-detail__stats dd {
	margin: 0;
	font-size: 0.95rem;
	color: var(--djl-text);
}

.djl-detail__notes {
	margin: 0.75rem 0 0;
	font-size: 0.95rem;
	color: var(--djl-text);
}

.djl-detail__contact {
	margin: 1rem 0 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.djl-detail__unavailable {
	margin: 1rem 0 0;
	padding: 0.75rem 1rem;
	background: #fff4ec;
	border: 1px solid #f5cba7;
	border-radius: 6px;
	color: #8a4a16;
	font-size: 0.95rem;
}

/* --- Grid columns: tablet / mobile (counts are admin-editable tokens) --- */
@media (max-width: 1024px) {
	.djl-board__grid {
		grid-template-columns: repeat(var(--djl-cols-tablet), minmax(0, 1fr));
	}
}

@media (max-width: 600px) {
	.djl-board__grid {
		grid-template-columns: repeat(var(--djl-cols-mobile), minmax(0, 1fr));
		gap: 0.75rem;
	}
}

/* --- Small screens --- */
@media (max-width: 720px) {
	.djl-detail__layout {
		grid-template-columns: 1fr;
		gap: 1rem;
	}

	.djl-detail__media {
		max-width: 320px;
	}
}
