/*
 * Photo Reviews — grid responsivo
 * Sin frameworks, sin fuentes externas, sin imágenes. ~9 KB sin comprimir.
 */

.pr-wrap {
	--pr-accent: #2ee6b6;
	--pr-radius: 14px;
	--pr-cols: 4;
	--pr-clamp: 8;
	--pr-card-w: 264px;
	--pr-card-min: 210px;   /* por debajo de esto una card deja de ser legible */
	--pr-gap: 16px;
	--pr-bg: #0d0d0f;
	--pr-fg: #ffffff;
	--pr-muted: rgba(255, 255, 255, .62);
	--pr-line: rgba(255, 255, 255, .22);
	--pr-card-bg: #ffffff;
	--pr-card-fg: #16181d;
	--pr-card-muted: #6b7280;
	--pr-star-empty: #d7dbe0;
	--pr-star-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 1.5l3.09 6.26 6.91 1-5 4.87 1.18 6.87L12 17.25l-6.18 3.25L7 13.63l-5-4.87 6.91-1z'/%3E%3C/svg%3E");

	box-sizing: border-box;
	position: relative;
	padding: clamp(20px, 4vw, 44px) 0 clamp(20px, 4vw, 40px);
	background: var(--pr-bg);
	color: var(--pr-fg);
	border-radius: 24px;
	font-family: inherit;
	line-height: 1.45;
	container-type: inline-size;
}

.pr-wrap *,
.pr-wrap *::before,
.pr-wrap *::after { box-sizing: border-box; }

/*
 * `[hidden]` del navegador es `display:none` sin clase, así que cualquier regla
 * nuestra con clase (p. ej. `.pr-btn{display:inline-flex}`) lo gana y el
 * elemento se sigue viendo. Hay que forzarlo.
 */
.pr-wrap [hidden] { display: none !important; }

.pr-wrap.pr-theme-light {
	--pr-bg: #f6f7f9;
	--pr-fg: #16181d;
	--pr-muted: #5b616e;
	--pr-line: rgba(0, 0, 0, .16);
	--pr-card-bg: #ffffff;
}

/* Padding lateral consistente para todo menos el track (que sangra hasta el borde). */
.pr-heading,
.pr-head,
.pr-panel,
.pr-empty,
.pr-more-wrap { padding-inline: clamp(16px, 3vw, 32px); }

.pr-heading {
	margin: 0 0 clamp(20px, 3vw, 36px);
	font-size: clamp(1.6rem, 1rem + 2.4vw, 3rem);
	font-weight: 300;
	line-height: 1.15;
	letter-spacing: -.01em;
	text-align: center;
	text-wrap: balance;
}

/* ---------- Cabecera ---------- */

.pr-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: clamp(16px, 2.5vw, 26px);
}

.pr-head-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pr-head-right { display: flex; align-items: center; gap: 10px; }
.pr-head:not(:has(.pr-head-right)) { justify-content: flex-start; }

.pr-count {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 2px;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	font-size: 1.05rem;
	font-weight: 500;
	cursor: pointer;
}

.pr-chev {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
	transition: transform .2s ease;
}

.pr-count[aria-expanded="true"] .pr-chev { transform: rotate(180deg); }

.pr-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 44px;
	padding: 0 22px;
	border: 1px solid var(--pr-line);
	border-radius: 999px;
	background: transparent;
	color: inherit;
	font: inherit;
	font-size: .95rem;
	font-weight: 500;
	text-decoration: none;
	cursor: pointer;
	transition: background-color .18s ease, border-color .18s ease, transform .18s ease;
}

.pr-btn:hover { background: color-mix(in srgb, currentColor 12%, transparent); border-color: currentColor; }
.pr-btn:active { transform: scale(.97); }

.pr-btn-icon { width: 44px; padding: 0; }
.pr-btn-icon svg {
	width: 20px;
	height: 20px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
}

/* ---------- Estrellas (una sola caja enmascarada, cero DOM extra) ---------- */

.pr-stars {
	--pr-r: 5;
	--pr-size: 15px;
	display: inline-block;
	flex: none;
	width: calc(var(--pr-size) * 5 + 2px * 4);
	height: var(--pr-size);
	background: linear-gradient(
		90deg,
		var(--pr-accent) 0 calc(var(--pr-r) / 5 * 100%),
		var(--pr-star-empty) calc(var(--pr-r) / 5 * 100%) 100%
	);
	-webkit-mask: var(--pr-star-mask) 0 0 / var(--pr-size) var(--pr-size) space;
	mask: var(--pr-star-mask) 0 0 / var(--pr-size) var(--pr-size) space;
	vertical-align: -2px;
}

.pr-stars-lg { --pr-size: 20px; --pr-star-empty: rgba(255, 255, 255, .28); }
.pr-theme-light .pr-stars-lg { --pr-star-empty: #d7dbe0; }

/* ---------- Paneles (desglose y filtros) ---------- */

.pr-panel {
	margin-bottom: clamp(16px, 2.5vw, 24px);
	animation: pr-fade .22s ease;
}

@keyframes pr-fade { from { opacity: 0; transform: translateY(-4px); } }

.pr-breakdown { display: grid; gap: 6px; max-width: 420px; }

.pr-bd-row {
	display: grid;
	grid-template-columns: 42px 1fr 40px;
	align-items: center;
	gap: 10px;
	padding: 3px 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	font-size: .85rem;
	cursor: pointer;
	border-radius: 6px;
}

.pr-bd-row:hover .pr-bd-bar i { filter: brightness(1.15); }
.pr-bd-row[aria-pressed="true"] { outline: 1px solid var(--pr-line); }
.pr-bd-label { display: inline-flex; align-items: center; gap: 3px; color: var(--pr-muted); }
.pr-bd-star { width: 12px; height: 12px; fill: var(--pr-accent); }

.pr-bd-bar {
	height: 8px;
	border-radius: 999px;
	background: color-mix(in srgb, currentColor 14%, transparent);
	overflow: hidden;
}

.pr-bd-bar i {
	display: block;
	height: 100%;
	background: var(--pr-accent);
	border-radius: inherit;
	transition: width .4s ease;
}

.pr-bd-n { color: var(--pr-muted); text-align: right; font-variant-numeric: tabular-nums; }

.pr-filters { display: flex; flex-wrap: wrap; gap: 10px; }

.pr-chip {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 38px;
	padding: 0 14px;
	border: 1px solid var(--pr-line);
	border-radius: 999px;
	font-size: .88rem;
	cursor: pointer;
}

.pr-chip input { accent-color: var(--pr-accent); margin: 0; }

.pr-chip-select select {
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	font-size: .88rem;
	cursor: pointer;
}

.pr-chip-select select option { color: #16181d; }

/* ---------- Viewport y track ---------- */

.pr-viewport { position: relative; }

.pr-track {
	display: flex;
	align-items: center;          /* el escalonado de Loox: alturas distintas centradas */
	gap: var(--pr-gap);
	padding-inline: clamp(16px, 3vw, 32px);
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x proximity;
	scroll-padding-inline: clamp(16px, 3vw, 32px);
	scrollbar-width: none;
	-ms-overflow-style: none;
}

.pr-track::-webkit-scrollbar { display: none; }

/*
 * Grid y masonry: sin scroll horizontal, altura libre.
 *
 * Las columnas NO se fijan por breakpoint. Se declara un ancho mínimo por card
 * y se deja que el navegador decida cuántas caben, con `--pr-cols` actuando
 * solo como tope máximo. Así funciona igual en una página completa que dentro
 * de una columna estrecha de Elementor, sin container queries ni media queries.
 */
.pr-layout-grid .pr-track {
	display: grid;
	grid-template-columns: repeat(
		auto-fill,
		minmax(
			max(
				min( var(--pr-card-min), 100% ),
				calc( ( 100% - ( var(--pr-cols) - 1 ) * var(--pr-gap) ) / var(--pr-cols) )
			),
			1fr
		)
	);
	align-items: start;
	overflow: visible;
}

/* `columns: <n> <ancho>` = como mucho n columnas, y nunca más estrechas que el ancho. */
.pr-layout-masonry .pr-track {
	display: block;
	columns: var(--pr-cols) var(--pr-card-min);
	column-gap: var(--pr-gap);
	overflow: visible;
}

.pr-layout-masonry .pr-card {
	width: 100%;
	margin-bottom: var(--pr-gap);
	break-inside: avoid;
}

.pr-layout-grid .pr-card { width: 100%; }

/* ---------- Card ---------- */

.pr-card {
	/* min() contra el ancho del track: en una columna estrecha la card encoge
	   sola y deja asomar la siguiente, sin necesitar un breakpoint. */
	flex: 0 0 min( var(--pr-card-w), 82% );
	width: min( var(--pr-card-w), 82% );
	min-width: 0;
	display: flex;
	flex-direction: column;
	background: var(--pr-card-bg);
	color: var(--pr-card-fg);
	border-radius: var(--pr-radius);
	overflow: hidden;
	scroll-snap-align: start;
	transition: transform .2s ease, box-shadow .2s ease;
}

.pr-card:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(0, 0, 0, .18); }

.pr-card-media {
	position: relative;
	margin: 0;
	background: #eceef1;
	cursor: zoom-in;
	aspect-ratio: 1 / 1;
}

.pr-layout-masonry .pr-card-media { aspect-ratio: auto; }

.pr-card-media .pr-img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.pr-layout-masonry .pr-card-media .pr-img { height: auto; }

.pr-more-photos {
	position: absolute;
	right: 8px;
	bottom: 8px;
	padding: 3px 9px;
	border-radius: 999px;
	background: rgba(0, 0, 0, .62);
	color: #fff;
	font-size: .75rem;
	font-weight: 600;
	backdrop-filter: blur(4px);
}

.pr-card-body { display: grid; gap: 8px; padding: 14px 15px 16px; min-width: 0; }
.pr-card-body > * { min-width: 0; max-width: 100%; }

.pr-card-author {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 4px 6px;
	font-size: .95rem;
	overflow-wrap: anywhere;
}

.pr-name { font-weight: 700; }

.pr-verified {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	color: var(--pr-card-muted);
	font-size: .82rem;
}

.pr-check { width: 15px; height: 15px; }
.pr-check circle { fill: var(--pr-card-fg); }
.pr-check .pr-check-tick { fill: none; stroke: var(--pr-card-bg); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

.pr-country { color: var(--pr-card-muted); font-size: .8rem; }

.pr-card-title {
	margin: 0;
	font-size: .95rem;
	font-weight: 700;
	line-height: 1.3;
}

.pr-card-text {
	margin: 0;
	color: #2b2f38;
	font-size: .9rem;
	line-height: 1.5;
	overflow: hidden;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: var(--pr-clamp);
	line-clamp: var(--pr-clamp);
	overflow-wrap: anywhere;
}

.pr-card-product {
	color: var(--pr-card-muted);
	font-size: .8rem;
	text-decoration: none;
	border-top: 1px solid #edeff2;
	padding-top: 8px;
}

.pr-card-product:hover { color: var(--pr-card-fg); text-decoration: underline; }

/* Card sin foto: un poco más de aire, como en Loox. */
.pr-no-media .pr-card-body { padding-top: 18px; }

/* ---------- Flechas ---------- */

.pr-nav {
	position: absolute;
	top: 50%;
	z-index: 2;
	width: 40px;
	height: 40px;
	transform: translateY(-50%);
	display: grid;
	place-items: center;
	border: 0;
	border-radius: 50%;
	background: var(--pr-fg);
	color: var(--pr-bg);
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(0, 0, 0, .3);
	transition: opacity .2s ease, transform .2s ease;
}

.pr-nav:hover { transform: translateY(-50%) scale(1.08); }
.pr-nav-prev { left: 8px; }
.pr-nav-next { right: 8px; }
.pr-nav svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.pr-nav[hidden] { display: none; }
.pr-layout-grid .pr-nav,
.pr-layout-masonry .pr-nav { display: none; }

/* ---------- Pie ---------- */

.pr-empty { color: var(--pr-muted); text-align: center; }
.pr-more-wrap { display: flex; justify-content: center; margin-top: clamp(16px, 2.5vw, 26px); }
.pr-more[disabled] { opacity: .5; cursor: default; }

/* ---------- Lightbox ---------- */

.pr-lb {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
	background: rgba(8, 8, 10, .94);
	animation: pr-lb-in .2s ease;
}

@keyframes pr-lb-in { from { opacity: 0; } }

.pr-lb-stage {
	position: relative;
	display: grid;
	place-items: center;
	padding: 24px;
	min-height: 0;
}

.pr-lb-stage img {
	max-width: 100%;
	max-height: calc(100vh - 48px);
	object-fit: contain;
	border-radius: 8px;
}

.pr-lb-side {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 56px 28px 28px;
	background: #fff;
	color: #16181d;
	overflow-y: auto;
}

.pr-lb-side .pr-card-text { -webkit-line-clamp: unset; line-clamp: unset; display: block; }

.pr-lb-close,
.pr-lb-nav {
	position: absolute;
	z-index: 2;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .14);
	color: #fff;
	cursor: pointer;
	transition: background-color .18s ease;
}

.pr-lb-close:hover,
.pr-lb-nav:hover { background: rgba(255, 255, 255, .28); }
.pr-lb-close { top: 16px; right: 16px; }
.pr-lb-nav-prev { top: 50%; left: 16px; transform: translateY(-50%); }
.pr-lb-nav-next { top: 50%; right: 16px; transform: translateY(-50%); }
.pr-lb-close svg,
.pr-lb-nav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.pr-lb-nav[hidden] { display: none; }

body.pr-lb-open { overflow: hidden; }

/* ---------- Formulario de subida ---------- */

.pr-upload { margin: 12px 0; }
.pr-upload-label {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 16px;
	border: 1px dashed currentColor;
	border-radius: 10px;
	cursor: pointer;
	font-size: .9rem;
	opacity: .85;
}
.pr-upload-label:hover { opacity: 1; }
.pr-upload input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.pr-upload-preview { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.pr-upload-thumb { position: relative; width: 72px; height: 72px; border-radius: 8px; overflow: hidden; }
.pr-upload-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pr-upload-thumb button {
	position: absolute;
	top: 2px;
	right: 2px;
	width: 20px;
	height: 20px;
	border: 0;
	border-radius: 50%;
	background: rgba(0, 0, 0, .7);
	color: #fff;
	font-size: 13px;
	line-height: 1;
	cursor: pointer;
}
.pr-upload-hint { margin-top: 6px; font-size: .78rem; opacity: .7; }
.pr-upload-error { margin-top: 6px; font-size: .82rem; color: #d3232f; }

/* ---------- Responsive ---------- */

/*
 * Los tres layouts ya se adaptan solos por el ancho mínimo de card, así que
 * esto solo afina detalles. Si el navegador no soporta container queries no se
 * rompe nada: simplemente no se aplican estos retoques.
 *
 * Recordatorio: `@container` consulta al contenedor ANCESTRO, así que estas
 * reglas tienen que apuntar a descendientes de `.pr-wrap`, nunca a `.pr-wrap`.
 */

@container (max-width: 600px) {
	.pr-track { --pr-gap: 12px; }
	.pr-head { flex-direction: column; align-items: flex-start; gap: 14px; }
	.pr-head-right { width: 100%; }
	.pr-btn-write { flex: 1; }
	.pr-nav { display: none; }
	.pr-heading { text-align: left; }
	.pr-breakdown { max-width: none; }
}

@container (max-width: 420px) {
	.pr-card-body { padding: 12px 12px 14px; }
	.pr-bd-row { grid-template-columns: 38px 1fr 32px; }
}

/* Sobre el propio contenedor, que no puede consultarse a sí mismo. */
@media (max-width: 600px) {
	.pr-wrap { border-radius: 16px; }
	.pr-lb { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }
	.pr-lb-side { max-height: 45vh; padding: 20px; }
}

@media (prefers-reduced-motion: reduce) {
	.pr-wrap *, .pr-lb * { animation: none !important; transition: none !important; }
	.pr-track { scroll-behavior: auto; }
}

.pr-wrap :focus-visible,
.pr-lb :focus-visible { outline: 2px solid var(--pr-accent); outline-offset: 2px; }
