/* Marcas amigas + Credencial de miembro — estilo del theme (usa los tokens del team) */

.cdh-cred, .cdh-marcas {
	--c-primary: var(--cdh-primary, #d71920);
	--c-primary-dark: var(--cdh-primary-dark, #b0151a);
	--c-text: var(--cdh-text, #161616);
	--c-muted: var(--cdh-muted, #6b6b72);
	--c-line: var(--cdh-line, rgba(0,0,0,.08));
	--c-soft: var(--cdh-soft, #f4f4f5);
	--c-dark: var(--cdh-dark, #141414);
	--c-display: var(--cdh-font-display, 'Barlow Condensed', sans-serif);
	--c-body: var(--cdh-font-body, 'Inter', sans-serif);
	font-family: var(--c-body);
	color: var(--c-text);
}
.cdh-cred *, .cdh-cred *::before, .cdh-cred *::after,
.cdh-marcas *, .cdh-marcas *::before, .cdh-marcas *::after { box-sizing: border-box; }

/* Las páginas de credencial y marcas van sin la caja blanca del theme */
article.entry:has(.cdh-cred),
article.entry:has(.cdh-marcas) {
	background: transparent;
	box-shadow: none;
	border: 0;
	border-radius: 0;
	padding-left: 0;
	padding-right: 0;
}
.elementor-widget-shortcode:has(.cdh-cred),
.elementor-shortcode:has(.cdh-cred),
.elementor-widget-shortcode:has(.cdh-marcas),
.elementor-shortcode:has(.cdh-marcas) { width: 100%; max-width: 100%; }

.cdh-cred__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 0;
	border-radius: 999px;
	background: var(--c-primary);
	color: #fff;
	font-family: var(--c-display);
	font-style: var(--cdh-display-style, italic);
	font-weight: var(--cdh-display-weight, 800);
	text-transform: uppercase;
	letter-spacing: .04em;
	font-size: 19px;
	line-height: 1;
	padding: 14px 26px;
	text-decoration: none;
	cursor: pointer;
	box-shadow: 0 10px 22px color-mix(in srgb,var(--cdh-primary,#d71920) 25%,transparent);
	transition: background .15s, transform .1s;
}
.cdh-cred__btn:hover { background: var(--c-primary-dark); color: #fff; }
.cdh-cred__btn:disabled { opacity: .55; cursor: not-allowed; }
.cdh-cred__btn--ghost { background: var(--c-soft); color: var(--c-text); box-shadow: none; }
.cdh-cred__btn--ghost:hover { background: #e7e7e9; color: var(--c-text); }

/* ---------- Mensajes / foto ---------- */
.cdh-cred { max-width: 560px; margin: 8px auto 34px; width: 100%; }
.cdh-cred--msg { text-align: center; padding: 10px 0; }
.cdh-cred h2,
.cdh-cred__intro h2 {
	margin: 0 0 10px;
	font-family: var(--c-display);
	font-style: var(--cdh-display-style, italic);
	font-weight: var(--cdh-display-weight, 800);
	text-transform: uppercase;
	font-size: clamp(30px, 6vw, 42px);
	line-height: 1;
}
.cdh-cred p, .cdh-cred li { color: #444; line-height: 1.55; font-size: 15px; }
.cdh-cred__intro ul { padding-left: 20px; margin: 10px 0 18px; }
.cdh-cred__alert {
	background: #fef2f2;
	border-left: 4px solid var(--c-primary);
	border-radius: 12px;
	padding: 12px 16px;
	margin: 0 0 14px;
	font-weight: 600;
	color: #7f1d1d;
}
.cdh-cred__camera { background: #fff; border: 1px solid var(--c-line); border-radius: 20px; padding: 18px; box-shadow: 0 8px 22px rgba(0,0,0,.05); }
.cdh-cred__stage { border-radius: 16px; overflow: hidden; background: #000; margin-bottom: 14px; }
.cdh-cred__stage[hidden], .cdh-cred__stage video[hidden], .cdh-cred__stage canvas[hidden],
.cdh-cred [hidden] { display: none !important; }
.cdh-cred__stage video, .cdh-cred__stage canvas { display: block; width: 100%; height: auto; max-height: 70vh; object-fit: cover; }
.cdh-cred__stage video { transform: scaleX(-1); }
.cdh-cred__actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.cdh-cred__fallback { display: block; margin-top: 12px; font-size: 14px; color: var(--c-muted); text-align: center; }
.cdh-cred__fallback input { display: block; margin: 8px auto 0; max-width: 100%; }
.cdh-cred__msg { min-height: 20px; margin-top: 12px; text-align: center; font-weight: 700; font-size: 14px; }
.cdh-cred__msg.is-ok { color: #166534; }
.cdh-cred__msg.is-error { color: #b91c1c; }

/* ---------- Credencial ---------- */
.cdh-cred__card {
	background: #fff;
	border: 1px solid var(--c-line);
	border-radius: 26px;
	overflow: hidden;
	box-shadow: 0 18px 44px rgba(0,0,0,.12);
}
.cdh-cred__band {
	background: linear-gradient(135deg, var(--c-primary), var(--c-primary-dark));
	color: #fff;
	padding: 16px 20px;
	text-align: center;
	line-height: 1.1;
}
.cdh-cred__band span { display: block; font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; opacity: .85; }
.cdh-cred__band strong {
	display: block;
	margin-top: 4px;
	font-family: var(--c-display);
	font-style: var(--cdh-display-style, italic);
	font-weight: var(--cdh-display-weight, 800);
	text-transform: uppercase;
	font-size: 28px;
}
.cdh-cred__photo { background: #111; }
.cdh-cred__photo img { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.cdh-cred__data { padding: 20px 22px 6px; text-align: center; }
.cdh-cred__data h2 { margin: 0 0 12px; font-size: clamp(30px, 7vw, 40px); }
.cdh-cred__data dl { margin: 0; display: grid; gap: 10px; }
.cdh-cred__data dl > div { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; background: var(--c-soft); border-radius: 12px; }
.cdh-cred__data dt { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--c-muted); }
.cdh-cred__data dd { margin: 0; font-weight: 700; }
.cdh-cred__badge { display: inline-block; padding: 5px 14px; border-radius: 999px; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; background: #e7e7e9; }
.cdh-cred__badge--premium { background: #fef3c7; color: #92400e; }
.cdh-cred__badge--gratuito { background: #dcfce7; color: #166534; }

.cdh-cred__qrwrap { padding: 18px 22px 26px; text-align: center; }
.cdh-cred__qr {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 244px;
	min-height: 244px;
	padding: 12px;
	background: #fff;
	border: 1px solid var(--c-line);
	border-radius: 18px;
}
.cdh-cred__qr img, .cdh-cred__qr canvas { display: block; max-width: 100%; height: auto; }
.cdh-cred__err { margin: 0; color: #b91c1c; font-weight: 700; font-size: 14px; max-width: 200px; }
.cdh-cred__timer { margin: 14px auto 0; max-width: 260px; }
.cdh-cred__bar { height: 8px; border-radius: 999px; background: var(--c-soft); overflow: hidden; }
.cdh-cred__bar span { display: block; height: 100%; width: 100%; background: #16a34a; border-radius: 999px; transition: width .25s linear, background .3s; }
.cdh-cred.is-expiring .cdh-cred__bar span { background: var(--c-primary); }
.cdh-cred__count { margin-top: 8px; font-size: 14px; font-weight: 700; color: var(--c-muted); font-variant-numeric: tabular-nums; }
.cdh-cred__count strong { color: var(--c-text); font-size: 18px; }
.cdh-cred.is-expiring .cdh-cred__count strong { color: var(--c-primary); }
.cdh-cred__hint { margin: 12px 0 0; font-size: 13px; color: var(--c-muted); }

/* ---------- Marcas amigas ---------- */
.cdh-marcas { max-width: 1100px; margin: 8px auto 40px; width: 100%; }
.cdh-marcas__head { padding-bottom: 18px; margin-bottom: 20px; border-bottom: 1px solid var(--c-line); }
.cdh-marcas__eyebrow { display: inline-flex; background: var(--c-primary); color: #fff; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; padding: 6px 12px; margin-bottom: 10px; }
.cdh-marcas__head h2 { margin: 2px 0 8px; font-family: var(--c-display); font-style: var(--cdh-display-style, italic); font-weight: var(--cdh-display-weight, 800); text-transform: uppercase; font-size: clamp(30px, 5vw, 46px); line-height: 1; }
.cdh-marcas__head p { margin: 0; color: var(--c-muted); font-size: 15px; line-height: 1.5; max-width: 720px; }
.cdh-marcas__head a { color: var(--c-primary); font-weight: 700; }
.cdh-marcas__empty { background: var(--c-soft); border-left: 4px solid var(--c-primary); border-radius: 14px; padding: 16px 18px; font-weight: 600; }
.cdh-marcas__filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.cdh-marcas__search, .cdh-marcas__rubro { border: 1px solid var(--c-line); background: #fff; border-radius: 999px; padding: 12px 18px; font: inherit; font-size: 15px; min-width: 0; }
.cdh-marcas__search { flex: 1 1 240px; }
.cdh-marcas__rubro { flex: 0 1 220px; }
.cdh-marcas__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; align-items: start; }
.cdh-marca[hidden] { display: none; }
.cdh-marca { background: #fff; border: 1px solid var(--c-line); border-radius: 22px; padding: 20px; box-shadow: 0 8px 22px rgba(0,0,0,.05); position: relative; overflow: hidden; }
.cdh-marca::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 6px; background: var(--c-primary); }
.cdh-marca__head { display: flex; align-items: center; gap: 14px; margin-top: 4px; }
.cdh-marca__logo { --cdh-logo-scale: 1; box-sizing: border-box; width: 64px; height: 64px; object-fit: contain; object-position: center; border-radius: 14px; background: var(--c-soft); padding: calc(4px + 56px * (1 - var(--cdh-logo-scale)) / 2); flex: 0 0 auto; } /* 100 % = 64 px de cuadro; menos de 100 % achica el logo dentro del mismo cuadro, centrado */
.cdh-marca__head h3 { margin: 0; font-family: var(--c-display); font-style: var(--cdh-display-style, italic); font-weight: var(--cdh-display-weight, 800); text-transform: uppercase; font-size: 26px; line-height: 1; }
.cdh-marca__rubro { display: inline-block; margin-top: 6px; background: var(--c-soft); color: var(--c-muted); border-radius: 999px; padding: 3px 10px; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.cdh-marca__desc { margin: 12px 0 0; color: #444; font-size: 14px; line-height: 1.5; }
.cdh-marca__meta { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 4px; font-size: 13px; color: var(--c-muted); }
.cdh-marca__meta a { color: var(--c-primary); font-weight: 600; }
.cdh-benef { margin-top: 14px; padding: 14px; background: var(--c-soft); border-radius: 16px; }
.cdh-benef__img { display: block; width: 100%; max-height: 180px; object-fit: cover; border-radius: 12px; margin-bottom: 10px; }
.cdh-benef h4 { margin: 0 0 6px; font-size: 17px; font-weight: 800; }
.cdh-benef__body { font-size: 14px; line-height: 1.5; color: #333; }
.cdh-benef__body > :first-child { margin-top: 0; }
.cdh-benef__body > :last-child { margin-bottom: 0; }
.cdh-benef__lock { margin: 0; font-size: 14px; color: var(--c-muted); }
.cdh-benef__lock a { color: var(--c-primary); font-weight: 700; }
.cdh-benef__until { display: block; margin-top: 8px; font-size: 12px; color: var(--c-muted); }

/* ---------- Carrusel de logos (marcas amigas) ---------- */
/* El encabezado (.cdh-s / .cdh-w / .cdh-hd) usa los mismos estilos que las demás secciones de la home. */
.cdh-logos .cdh-hd { margin-bottom: 18px; }
.cdh-logos__viewport { overflow: hidden; }
.cdh-logos__track {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	align-items: flex-start;
	padding: 6px 0 10px;
}
.cdh-logos.is-scrolling .cdh-logos__viewport {
	-webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
	mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.cdh-logos.is-scrolling .cdh-logos__track {
	flex-wrap: nowrap;
	justify-content: flex-start;
	width: max-content;
	animation: cdh-logos-scroll var(--cdh-logos-time, 40s) linear infinite;
}
.cdh-logos.is-scrolling .cdh-logos__track:hover { animation-play-state: paused; }
.cdh-logos__item {
	flex: 0 0 auto;
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 270px;
	margin: 0 20px;
	text-align: center;
}
.cdh-logos__item img {
	--cdh-logo-scale: 1; /* 1 = tamaño máximo (caja de 245 x 92 px); se ajusta por marca en el administrador (50 % a 100 %) */
	display: block;
	width: 245px;
	max-width: 100%;
	height: 92px;
	object-fit: contain;
	object-position: center;
	transform: scale(var(--cdh-logo-scale)); /* escala desde el centro: queda centrado horizontal y verticalmente */
	transform-origin: center center;
	filter: grayscale(1);
	opacity: .65;
	transition: filter .25s ease, opacity .25s ease, transform .25s ease;
}
.cdh-logos__item:hover img { filter: grayscale(0); opacity: 1; transform: scale(calc(var(--cdh-logo-scale) * 1.06)); }
.cdh-logos__name {
	margin-top: 12px;
	font-family: var(--cdh-font-display, 'Barlow Condensed', sans-serif);
	font-style: var(--cdh-display-style, italic);
	font-weight: var(--cdh-display-weight, 800);
	text-transform: uppercase;
	font-size: 17px;
	line-height: 1.05;
	color: var(--cdh-text, #161616);
}
.cdh-logos__meta { margin-top: 4px; font-size: 13px; line-height: 1.35; color: var(--cdh-muted, #6b6b72); overflow-wrap: anywhere; }
.cdh-logos__name + .cdh-logos__meta { margin-top: 6px; }
.cdh-logos__link { display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; transition: color .15s ease; }
.cdh-logos__link:hover, .cdh-logos__link:focus-visible { color: var(--cdh-primary, #d71920); }
.cdh-logos__link .cdh-ico { flex: 0 0 auto; width: 16px; height: 16px; }
@keyframes cdh-logos-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
	.cdh-logos.is-scrolling .cdh-logos__viewport { overflow-x: auto; }
	.cdh-logos.is-scrolling .cdh-logos__track { animation: none; }
}

/* ---------- Credencial a pantalla completa en celular ---------- */
.cdh-cred__close { display: none; }
@media (max-width: 768px) {
	body:has(.cdh-cred[data-cdh-cred="card"]) { overflow: hidden; }
	.cdh-cred[data-cdh-cred="card"] {
		position: fixed;
		inset: 0;
		z-index: 2147483000;
		width: 100%;
		max-width: none;
		margin: 0;
		height: 100vh;
		height: 100dvh;
		background: #fff;
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
	}
	.cdh-cred[data-cdh-cred="card"] .cdh-cred__card {
		min-height: 100%;
		display: flex;
		flex-direction: column;
		border: 0;
		border-radius: 0;
		box-shadow: none;
	}
	.cdh-cred[data-cdh-cred="card"] .cdh-cred__close {
		display: flex;
		align-items: center;
		justify-content: center;
		position: fixed;
		top: calc(10px + env(safe-area-inset-top, 0px));
		right: 12px;
		z-index: 5;
		width: 40px;
		height: 40px;
		padding: 0;
		border: 0;
		border-radius: 50%;
		background: rgba(0,0,0,.35);
		color: #fff;
		font-size: 28px;
		line-height: 1;
		cursor: pointer;
	}
	.cdh-cred[data-cdh-cred="card"] .cdh-cred__band { padding: calc(12px + env(safe-area-inset-top, 0px)) 60px 10px; }
	.cdh-cred[data-cdh-cred="card"] .cdh-cred__band strong { font-size: 24px; }
	.cdh-cred[data-cdh-cred="card"] .cdh-cred__photo { flex: 1 1 150px; min-height: 120px; position: relative; }
	.cdh-cred[data-cdh-cred="card"] .cdh-cred__photo img { position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; object-fit: cover; }
	.cdh-cred[data-cdh-cred="card"] .cdh-cred__data { padding: 12px 18px 4px; }
	.cdh-cred[data-cdh-cred="card"] .cdh-cred__data h2 { font-size: 26px; margin: 0 0 8px; }
	.cdh-cred[data-cdh-cred="card"] .cdh-cred__data dl { gap: 6px; }
	.cdh-cred[data-cdh-cred="card"] .cdh-cred__data dl > div { padding: 7px 12px; }
	.cdh-cred[data-cdh-cred="card"] .cdh-cred__qrwrap { padding: 10px 18px calc(14px + env(safe-area-inset-bottom, 0px)); }
	.cdh-cred[data-cdh-cred="card"] .cdh-cred__qr { min-width: 0; min-height: 0; padding: 8px; }
	.cdh-cred[data-cdh-cred="card"] .cdh-cred__timer { margin-top: 10px; }
	.cdh-cred[data-cdh-cred="card"] .cdh-cred__hint { margin-top: 8px; font-size: 12px; }
}
