/* RunSupply Reseñas — v1.4.0
 * Inherits the theme's font. Tune the look in Apariencia → Personalizar → CSS adicional, e.g.
 *   :root { --rsr-star: #111; --rsr-card-radius: 14px; }
 */

:root {
	--rsr-star: #f6b400;
	--rsr-star-empty: #e7e5e1;
	--rsr-accent: #111;
	--rsr-accent-ink: #fff;
	--rsr-link: #111;
	--rsr-verified: #1f9d63;
	--rsr-ink: #121212;
	--rsr-body: #45464a;
	--rsr-muted: #8b8c90;
	--rsr-line: rgba(18, 18, 18, .07);
	--rsr-card-bg: #fff;
	--rsr-card-radius: 20px;
	--rsr-card-shadow: 0 1px 2px rgba(18, 18, 18, .03), 0 10px 30px -6px rgba(18, 18, 18, .08);
	--rsr-card-shadow-hover: 0 2px 4px rgba(18, 18, 18, .04), 0 18px 44px -8px rgba(18, 18, 18, .14);
	--rsr-gap: 20px;
	--rsr-radius: 999px;
	--rsr-field-radius: 14px;
	--rsr-scroll-offset: 96px;
	--rsr-star-svg: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='-2 0 28 24'><path d='M12 1.8c.4 0 .7.2.9.6l2.6 5.3 5.8.8c.8.1 1.1 1.1.5 1.7l-4.2 4.1 1 5.8c.1.8-.7 1.4-1.4 1L12 18.4l-5.2 2.7c-.7.4-1.5-.2-1.4-1l1-5.8-4.2-4.1c-.6-.6-.3-1.6.5-1.7l5.8-.8 2.6-5.3c.2-.4.5-.6.9-.6z'/></svg>");
}

/* ---------- stars (one element, crisp at any DPR) ---------- */
.rsr-stars {
	--s: 18px;
	display: inline-block;
	flex: none;
	vertical-align: -3px;
	height: var(--s);
	width: calc(var(--s) * 28 / 24 * 5);
	background: linear-gradient(90deg, var(--rsr-star) var(--rsr-fill, 0%), var(--rsr-star-empty) var(--rsr-fill, 0%));
	-webkit-mask: var(--rsr-star-svg) left center / calc(var(--s) * 28 / 24) var(--s) repeat-x;
	mask: var(--rsr-star-svg) left center / calc(var(--s) * 28 / 24) var(--s) repeat-x;
}
.rsr-stars--sm { --s: 16px; }
.rsr-stars--md { --s: 17px; }
.rsr-stars--lg { --s: 24px; }

/* ---------- header rating (under the price) ---------- */
.rsr-header { margin: 2px 0 20px; }
.rsr-header-link {
	display: inline-flex; align-items: center; gap: 8px;
	color: inherit; text-decoration: none; font-size: 14px; line-height: 1;
	border: 0; box-shadow: none;
}
.rsr-header-avg { font-weight: 700; }
.rsr-header-count { color: var(--rsr-muted); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: transparent; transition: text-decoration-color .15s, color .15s; }
.rsr-header-link:hover .rsr-header-count { color: inherit; text-decoration-color: currentColor; }
.rsr-header-link--empty { color: var(--rsr-muted); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- section ---------- */
.rsr {
	scroll-margin-top: var(--rsr-scroll-offset);
	margin: 80px 0;
	color: var(--rsr-ink);
	font-size: 15px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}
.rsr *, .rsr *::before, .rsr *::after { box-sizing: border-box; }
.rsr p { margin: 0; }

/* resets against theme-wide button / list styles */
.rsr button { text-transform: none; letter-spacing: normal; box-shadow: none; text-shadow: none; min-width: 0; float: none; vertical-align: middle; }
.rsr button::before, .rsr button::after { content: none; }
.rsr input[type="text"], .rsr textarea { height: auto; max-width: 100%; box-shadow: none; }
.rsr dialog:not([open]) { display: none; }

/* grid: plain CSS grid without JS, real masonry columns with JS */
.rsr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: var(--rsr-gap); align-items: start; }
.rsr-grid.is-masonry { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--rsr-gap); }
.rsr-grid.is-narrow > .rsr-card--summary { flex: 1 0 100%; }
.rsr-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: var(--rsr-gap); }

/* ---------- cards ---------- */
.rsr-card {
	position: relative;
	overflow: hidden;
	background: var(--rsr-card-bg);
	border: 1px solid var(--rsr-line);
	border-radius: var(--rsr-card-radius);
	box-shadow: var(--rsr-card-shadow);
	transition: box-shadow .3s ease, transform .3s ease;
}
.rsr-card:not(.rsr-card--summary):hover { box-shadow: var(--rsr-card-shadow-hover); transform: translateY(-3px); }
.rsr-card.is-new { animation: rsr-rise .5s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes rsr-rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

.rsr-card-body { padding: 26px 26px 28px; }

/* name → stars → verified → text */
.rsr-author {
	font-size: 16.5px; font-weight: 600; line-height: 1.3; letter-spacing: -.01em;
	color: var(--rsr-ink); overflow-wrap: anywhere;
}
.rsr-card-body > .rsr-stars { display: block; margin-top: 9px; }
.rsr-verified {
	display: flex; align-items: center; gap: 6px;
	margin-top: 9px;
	font-size: 12.5px; font-weight: 500; line-height: 1.2; letter-spacing: .01em;
	color: var(--rsr-verified);
}
.rsr-verified svg { flex: none; width: 15px; height: 15px; fill: currentColor; }

.rsr-text {
	margin-top: 16px !important;
	padding-top: 16px;
	border-top: 1px solid var(--rsr-line);
	font-size: 15px; line-height: 1.7; color: var(--rsr-body);
	white-space: pre-line; overflow-wrap: anywhere;
}
.rsr-text.is-clamped { display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.rsr .rsr-toggle {
	appearance: none; display: inline-flex; align-items: center; gap: 4px; height: auto; margin: 8px 0 0; padding: 0;
	border: 0; background: none; color: var(--rsr-link);
	font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
	text-decoration: underline; text-underline-offset: 4px; text-decoration-color: rgba(18, 18, 18, .25);
	transition: text-decoration-color .15s;
}
.rsr .rsr-toggle:hover { text-decoration-color: currentColor; }

/* ---------- cover photo (edge to edge, top of the card) ---------- */
.rsr-media { position: relative; aspect-ratio: var(--rsr-ratio, .8); background: #f1f0ee; overflow: hidden; }
.rsr .rsr-photo {
	appearance: none; display: block; position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0;
	border: 0; border-radius: 0; background: transparent; overflow: hidden; cursor: zoom-in;
}
.rsr .rsr-photo + .rsr-photo { display: none; } /* extra photos open in the lightbox */
.rsr-photo img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; display: block; transition: transform .7s cubic-bezier(.2, .7, .2, 1); }
.rsr-card:hover .rsr-photo img { transform: scale(1.04); }
.rsr .rsr-photo:focus-visible { outline-offset: -4px; outline-color: #fff; }
.rsr-photo-count {
	position: absolute; top: 12px; right: 12px; pointer-events: none;
	display: inline-flex; align-items: center; gap: 5px;
	padding: 5px 10px 5px 8px; border-radius: 999px;
	background: rgba(18, 18, 18, .55); color: #fff;
	-webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
	font-size: 12px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums;
}
.rsr-photo-count svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }

/* ---------- summary card ---------- */
.rsr-card--summary { text-align: center; padding: 40px 28px 34px; }
.rsr-sum-title { margin: 0 0 18px; font-size: 22px; font-weight: 700; line-height: 1.25; letter-spacing: -.02em; color: var(--rsr-ink); outline: none; }
.rsr-sum-score { display: flex; align-items: center; justify-content: center; gap: 12px; }
.rsr-sum-avg { font-size: 34px; font-weight: 700; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.rsr-sum-count { margin: 12px 0 26px !important; font-size: 14.5px; color: var(--rsr-muted); }
.rsr--empty .rsr-sum-count { color: var(--rsr-muted); }
.rsr--empty .rsr-grid { grid-template-columns: minmax(0, 420px); }

/* ---------- buttons ---------- */
.rsr .rsr-btn {
	appearance: none;
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	height: auto; min-height: 52px; margin: 0; padding: 0 30px;
	border: 1px solid var(--rsr-accent); border-radius: var(--rsr-radius);
	background: var(--rsr-accent); color: var(--rsr-accent-ink);
	font: inherit; font-size: 15px; font-weight: 600; line-height: 1.2; letter-spacing: .005em;
	cursor: pointer; transition: opacity .15s, transform .15s, background-color .15s, color .15s, border-color .15s;
}
.rsr .rsr-btn:hover { opacity: .86; }
.rsr .rsr-btn:active { transform: scale(.985); }
.rsr .rsr-btn:disabled { opacity: .5; cursor: default; }
.rsr .rsr-btn--block { width: 100%; max-width: 300px; }
.rsr .rsr-btn--ghost { min-height: 50px; padding: 0 34px; border-color: rgba(18, 18, 18, .14); background: var(--rsr-card-bg); color: var(--rsr-ink); }
.rsr .rsr-btn--ghost:hover { opacity: 1; border-color: var(--rsr-ink); }
.rsr :focus-visible { outline: 2px solid var(--rsr-accent); outline-offset: 2px; }

.rsr-more-wrap { display: flex; justify-content: center; padding-top: 40px; }
.rsr-more-wrap[hidden] { display: none; }

/* ---------- modal ---------- */
.rsr-modal, .rsr-lightbox { border: 0; padding: 0; color: inherit; }
.rsr-modal {
	width: min(540px, calc(100% - 32px));
	max-height: min(92vh, 880px);
	border-radius: 24px;
	background: #fff;
	color: var(--rsr-ink);
	box-shadow: 0 30px 90px rgba(0, 0, 0, .22);
	font-size: 15px;
	line-height: 1.5;
}
.rsr-modal::backdrop { background: rgba(10, 10, 10, .5); backdrop-filter: blur(3px); }
.rsr-modal[open] { animation: rsr-in .24s ease-out; }
@keyframes rsr-in { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }

.rsr-form, .rsr-success { padding: 32px; display: grid; gap: 20px; }
.rsr-modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.rsr-modal-title { margin: 0; font-size: 22px; font-weight: 700; line-height: 1.25; }
.rsr-modal-product { margin: 4px 0 0; color: var(--rsr-muted); font-size: 14px; }
.rsr .rsr-close { appearance: none; flex: none; width: 38px; height: 38px; margin: -6px -10px 0 0; padding: 0; border: 0; border-radius: 50%; background: #f3f3f3; color: inherit; font-size: 22px; line-height: 1; cursor: pointer; transition: background-color .15s; }
.rsr .rsr-close:hover { background: #e8e8e8; }

.rsr-field { display: grid; gap: 7px; margin: 0; padding: 0; border: 0; min-width: 0; }
.rsr-field > span, .rsr-field legend { font-size: 13.5px; font-weight: 600; padding: 0; }
.rsr-field em { font-style: normal; font-weight: 400; color: var(--rsr-muted); }
.rsr-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.rsr-modal input[type="text"], .rsr-modal textarea {
	width: 100%; margin: 0;
	padding: 13px 14px;
	border: 1px solid #dedede;
	border-radius: var(--rsr-field-radius);
	background: #fafafa; color: inherit;
	font: inherit; font-size: 16px; /* ≥16px stops iOS zoom */
	transition: border-color .15s, background-color .15s, box-shadow .15s;
}
.rsr-modal textarea { resize: vertical; min-height: 130px; }
.rsr-modal input[type="text"]:focus, .rsr-modal textarea:focus { outline: none; background: #fff; border-color: var(--rsr-accent); box-shadow: 0 0 0 4px rgba(17, 17, 17, .07); }
.rsr-field.has-error input, .rsr-field.has-error textarea { border-color: #d93025; background: #fff; }
.rsr-field-error { margin: 0; font-size: 12.5px; color: #d93025; }
.rsr-field-error:empty { display: none; }
.rsr-counter { justify-self: end; margin-top: -2px; font-size: 12px; color: var(--rsr-muted); font-variant-numeric: tabular-nums; }

/* star picker */
.rsr-rate { display: flex; align-items: center; gap: 4px; }
.rsr-rate-star { position: relative; cursor: pointer; padding: 2px; line-height: 0; border-radius: 6px; }
.rsr-rate-star input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.rsr-rate-star svg { width: 36px; height: 36px; fill: var(--rsr-star-empty); transition: fill .12s, transform .15s; }
.rsr-rate-star:has(input:checked) svg,
.rsr-rate-star:has(~ .rsr-rate-star input:checked) svg { fill: var(--rsr-star); }
.rsr-rate:hover .rsr-rate-star svg { fill: var(--rsr-star-empty); }
.rsr-rate:hover .rsr-rate-star:hover svg,
.rsr-rate:hover .rsr-rate-star:has(~ .rsr-rate-star:hover) svg { fill: var(--rsr-star); }
.rsr-rate-star:hover svg { transform: scale(1.1); }
.rsr-rate-star:has(input:focus-visible) { outline: 2px solid var(--rsr-accent); outline-offset: 1px; }
.rsr-rate-text { margin-left: 10px; font-size: 14px; font-weight: 500; color: var(--rsr-body); }
.rsr-rate-field.has-error .rsr-rate-star svg { fill: #f6d4d1; }

/* photo picker */
.rsr-file { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 64px; padding: 0 16px; border: 1.5px dashed #d6d6d6; border-radius: var(--rsr-field-radius); background: #fafafa; font-size: 14px; font-weight: 500; color: var(--rsr-body); cursor: pointer; position: relative; transition: border-color .15s, background-color .15s; }
.rsr-file:hover { border-color: var(--rsr-ink); background: #fff; }
.rsr-file:has(input:focus-visible) { outline: 2px solid var(--rsr-accent); outline-offset: 2px; }
.rsr-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.rsr-file svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.rsr-previews { display: flex; gap: 8px; flex-wrap: wrap; }
.rsr-previews:empty { display: none; }
.rsr-preview { position: relative; width: 76px; height: 76px; border-radius: 12px; overflow: hidden; background: #f2f2f2; }
.rsr-preview img { width: 100%; height: 100%; object-fit: cover; }
.rsr .rsr-preview button { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; margin: 0; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .65); color: #fff; font-size: 14px; line-height: 22px; padding: 0; cursor: pointer; }

.rsr-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.rsr-note { margin: 0; font-size: 12.5px; color: var(--rsr-muted); text-align: center; }
.rsr-form-error { margin: 0; padding: 12px 14px; border-radius: var(--rsr-field-radius); background: #fdecea; color: #8e1c1c; font-size: 14px; }
.rsr-form .rsr-btn--block { max-width: none; }
.rsr-success { text-align: center; justify-items: center; padding: 56px 32px 40px; }
.rsr-success p { margin: 0; color: var(--rsr-body); }
.rsr-success-icon { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: #e9f6ee; color: #1e8e3e; }
.rsr-success-icon svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.rsr-success-title { font-size: 21px; font-weight: 700; color: var(--rsr-ink) !important; }
.rsr-success .rsr-btn { min-width: 160px; }
.rsr-success[hidden], .rsr-form[hidden], .rsr-form-error[hidden] { display: none; }

.rsr-visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- lightbox ---------- */
.rsr-lightbox { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; background: transparent; }
.rsr-lightbox[open] { display: flex; align-items: center; justify-content: center; }
.rsr-lightbox::backdrop { background: rgba(10, 10, 10, .92); }
.rsr-lb-img { max-width: min(92vw, 1200px); max-height: 86vh; object-fit: contain; border-radius: 14px; }
.rsr-lb-count { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); color: rgba(255, 255, 255, .8); font-size: 13px; font-weight: 500; letter-spacing: .06em; font-variant-numeric: tabular-nums; }
.rsr .rsr-lb-close, .rsr .rsr-lb-nav { appearance: none; position: fixed; margin: 0; padding: 0; border: 0; background: rgba(255, 255, 255, .12); color: #fff; width: 46px; height: 46px; border-radius: 50%; font-size: 26px; line-height: 1; cursor: pointer; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); transition: background-color .15s; }
.rsr .rsr-lb-close:hover, .rsr .rsr-lb-nav:hover { background: rgba(255, 255, 255, .24); }
.rsr .rsr-lb-close { top: 18px; right: 18px; }
.rsr .rsr-lb-prev { left: 18px; top: 50%; transform: translateY(-50%); }
.rsr .rsr-lb-next { right: 18px; top: 50%; transform: translateY(-50%); }
.rsr .rsr-lb-nav[hidden] { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 640px) {
	.rsr { margin: 56px 0; --rsr-gap: 10px; }
	/* No-JS fallback also shows 2 columns on phones */
	.rsr-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
	.rsr-grid > .rsr-card--summary { grid-column: 1 / -1; }
	.rsr--empty .rsr-grid { grid-template-columns: 1fr; }

	/* compact cards for two columns */
	.rsr-card { border-radius: 16px; }
	.rsr-card:not(.rsr-card--summary):hover { transform: none; }
	.rsr-card:hover .rsr-photo img { transform: none; }
	.rsr-card-body { padding: 15px 14px 16px; }
	.rsr-author { font-size: 14px; }
	.rsr-card-body > .rsr-stars { margin-top: 6px; --s: 13px; }
	.rsr-verified { margin-top: 6px; gap: 4px; font-size: 10.5px; letter-spacing: 0; }
	.rsr-verified svg { width: 12px; height: 12px; }
	.rsr-text { margin-top: 11px !important; padding-top: 11px; font-size: 13px; line-height: 1.55; }
	.rsr-text.is-clamped { -webkit-line-clamp: 7; }
	.rsr .rsr-toggle { margin-top: 6px; font-size: 12.5px; }
	.rsr-photo-count { top: 8px; right: 8px; padding: 4px 8px 4px 6px; font-size: 11px; gap: 4px; }
	.rsr-photo-count svg { width: 11px; height: 11px; }

	.rsr-card--summary { padding: 28px 20px 24px; border-radius: 18px; }
	.rsr-sum-title { font-size: 19px; margin-bottom: 12px; }
	.rsr-sum-avg { font-size: 28px; }
	.rsr-card--summary .rsr-stars--lg { --s: 21px; }
	.rsr-sum-count { margin: 8px 0 18px !important; font-size: 13.5px; }
	.rsr .rsr-btn { min-height: 48px; }
	.rsr .rsr-btn--block { max-width: none; }
	.rsr-more-wrap { padding-top: 28px; }

	.rsr-row { grid-template-columns: 1fr; }
	.rsr-modal { width: 100%; max-width: none; max-height: 94vh; margin: auto 0 0; border-radius: 22px 22px 0 0; }
	.rsr-modal[open] { animation-name: rsr-up; }
	@keyframes rsr-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
	.rsr-form, .rsr-success { padding: 24px 20px calc(24px + env(safe-area-inset-bottom)); }
}

/* very narrow phones: keep "Cliente verificado" on one line */
@media (max-width: 360px) {
	.rsr-card-body { padding: 13px 12px 14px; }
	.rsr-verified { font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
	.rsr *, .rsr *::before { animation: none !important; transition: none !important; }
}
