/* =========================================================
   Medivet — hoja de estilos principal
   Tokens, base, componentes, secciones, responsive.
   ========================================================= */

:root {
	--carbon: #232323;
	--ink-2: #4d535a;
	--ink-3: #7a8088;
	--line: #e4e7eb;
	--surface: #ffffff;
	--surface-2: #f3f5f7;
	--night: #161a1f;
	--night-2: #1f252c;

	--red: #e01f1a;
	--orange: #f0700e;
	--green: #2a973a;
	--green-700: #237f31;
	--blue: #1083d0;
	--teal: #0e6a90;

	--red-soft: #fcebea;
	--orange-soft: #fef0e3;
	--green-soft: #e8f4ea;
	--blue-soft: #e6f2fb;
	--teal-soft: #e4eff4;

	--font-display: "Montserrat", "Avenir Next", system-ui, sans-serif;
	--font-body: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

	--fs-0: 0.9rem;
	--fs-1: 1.0625rem;
	--fs-2: 1.2rem;
	--fs-3: 1.5rem;
	--fs-4: clamp(1.7rem, 1.2rem + 1.6vw, 2.25rem);
	--fs-5: clamp(2rem, 1.4rem + 2.4vw, 3rem);
	--fs-6: clamp(2.5rem, 1.6rem + 4.2vw, 4.6rem);

	--wrap: 1180px;
	--gutter: clamp(16px, 4vw, 40px);
	--section: clamp(60px, 9vw, 120px);
	--radius: 10px;
	--radius-lg: 22px;
	--shadow: 0 10px 30px -14px rgba(20, 26, 31, 0.22);
	--ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ---------- base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
	margin: 0;
	font-family: var(--font-body);
	font-size: var(--fs-1);
	line-height: 1.6;
	color: var(--carbon);
	background: var(--surface);
	-webkit-font-smoothing: antialiased;
}

img, svg, iframe { max-width: 100%; display: block; }
img { height: auto; }
a { color: inherit; text-underline-offset: 0.16em; text-decoration-thickness: 1px; }
a:hover { color: var(--green-700); }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.12; margin: 0; letter-spacing: -0.012em; text-wrap: balance; }
p { margin: 0; }
ul { list-style: none; margin: 0; padding: 0; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
address { font-style: normal; }
dl, dd { margin: 0; }

:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 4px; }

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 14px; background: var(--carbon); color: #fff; border-radius: 8px; }
.skip:focus { top: 12px; }

.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }

.icon { width: 1.25em; height: 1.25em; flex: none; }

/* marcador cuando falta una foto */
.ph { background: var(--surface-2); border-radius: var(--radius-lg); min-height: 240px; }

/* La barra de 4 colores: firma de la marca, se usa pocas veces. */
.brandbar { display: inline-flex; gap: 0; height: 5px; width: 128px; border-radius: 3px; overflow: hidden; margin: 22px 0 26px; }
.brandbar i { flex: 1; }
.brandbar i:nth-child(1) { background: var(--red); }
.brandbar i:nth-child(2) { background: var(--orange); }
.brandbar i:nth-child(3) { background: var(--green); }
.brandbar i:nth-child(4) { background: var(--blue); }

/* ---------- botones ---------- */
.btn {
	display: inline-flex; align-items: center; gap: 10px;
	padding: 14px 22px; border-radius: 999px;
	font-weight: 600; font-size: var(--fs-1); line-height: 1.15; text-decoration: none;
	transition: background-color 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease), transform 0.18s var(--ease);
	border: 1.5px solid transparent; white-space: nowrap;
}
.btn .icon { width: 1.3em; height: 1.3em; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--green); color: #fff; }
.btn--primary:hover { background: var(--green-700); color: #fff; }
.btn--ghost { background: transparent; color: var(--carbon); border-color: #cfd4da; }
.btn--ghost:hover { border-color: var(--carbon); color: var(--carbon); }
.btn--white { background: #fff; color: var(--green-700); }
.btn--white:hover { background: #f1f7f2; color: var(--green-700); }
.btn--ghost-white { color: #fff; border-color: rgba(255, 255, 255, 0.55); }
.btn--ghost-white:hover { border-color: #fff; color: #fff; }
.btn--sm { padding: 10px 16px; font-size: var(--fs-0); }

/* ---------- barra superior ---------- */
.topbar { background: var(--carbon); color: #e9ecef; font-size: var(--fs-0); }
.topbar__in { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 38px; }
.topbar__hours, .topbar__phone { display: inline-flex; align-items: center; gap: 8px; }
.topbar__hours .icon { color: var(--orange); }
.topbar__phone { color: #fff; text-decoration: none; font-weight: 600; }
.topbar__phone:hover { color: #fff; text-decoration: underline; }
@media (max-width: 640px) {
	.topbar__hours span { display: none; }
	.topbar__hours::after { content: "Urgencias 24 h"; }
}

/* ---------- header ---------- */
.site-header {
	position: sticky; top: 0; z-index: 50;
	background: rgba(255, 255, 255, 0.92);
	backdrop-filter: saturate(160%) blur(10px);
	-webkit-backdrop-filter: saturate(160%) blur(10px);
	border-bottom: 1px solid transparent;
	transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.site-header.is-stuck { border-color: var(--line); box-shadow: 0 6px 24px -18px rgba(20, 26, 31, 0.35); }
.site-header__in { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 76px; }
.brand { display: inline-flex; align-items: center; }
.brand img, .brand svg { height: 54px; width: auto; }
@media (max-width: 640px) { .brand img, .brand svg { height: 44px; } }

.nav { display: flex; align-items: center; gap: 28px; }
.nav__list { display: flex; gap: 6px; }
.nav__list a {
	display: inline-block; padding: 8px 12px; border-radius: 8px;
	font-weight: 500; text-decoration: none; color: var(--carbon);
	position: relative;
}
.nav__list a:hover { background: var(--surface-2); color: var(--carbon); }
.nav__list a[aria-current="true"], body:not(.home) .nav__list .current-menu-item > a { color: var(--green-700); }

.nav-toggle { display: none; width: 44px; height: 44px; align-items: center; justify-content: center; border-radius: 10px; }
.nav-toggle .icon { width: 26px; height: 26px; }
.nav-toggle__close { display: none; }
body.nav-open .nav-toggle__close { display: inline-flex; }
body.nav-open .nav-toggle__open { display: none; }

@media (max-width: 900px) {
	.nav-toggle { display: inline-flex; }
	.nav {
		position: absolute; left: 0; right: 0; top: 100%;
		flex-direction: column; align-items: stretch; gap: 8px;
		padding: 10px var(--gutter) 22px;
		background: #fff; border-bottom: 1px solid var(--line);
		box-shadow: 0 24px 40px -24px rgba(20, 26, 31, 0.35);
		display: none;
	}
	body.nav-open .nav { display: flex; }
	.nav__list { flex-direction: column; gap: 0; }
	.nav__list a { display: block; padding: 14px 10px; font-size: var(--fs-2); border-bottom: 1px solid var(--line); border-radius: 0; }
	.nav__cta { padding-top: 8px; }
	.nav__cta .btn { width: 100%; justify-content: center; padding: 14px; font-size: var(--fs-1); }
}

/* ---------- hero ---------- */
.hero { padding: clamp(36px, 6vw, 88px) 0 clamp(40px, 6vw, 80px); }
.hero__in { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: clamp(32px, 6vw, 80px); align-items: center; }
.hero__title { font-size: var(--fs-6); font-weight: 800; letter-spacing: -0.025em; line-height: 1.02; max-width: 12ch; }
.hero__text { font-size: var(--fs-2); color: var(--ink-2); max-width: 50ch; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero__facts { display: flex; flex-wrap: wrap; gap: 10px 26px; margin-top: 30px; color: var(--ink-2); font-size: var(--fs-0); }
.hero__facts li { display: inline-flex; align-items: center; gap: 8px; }
.hero__facts .icon { color: var(--carbon); }
.hero__media { margin: 0; position: relative; }
.hero__img, .hero__media .ph {
	width: 100%; aspect-ratio: 1 / 1; object-fit: cover;
	border-radius: 28px 28px 28px 120px;
	box-shadow: var(--shadow);
}
.hero__media .ph { aspect-ratio: 1 / 1; min-height: 0; }

@media (prefers-reduced-motion: no-preference) {
	.hero__copy > * { animation: rise 0.7s var(--ease) both; }
	.hero__copy > *:nth-child(2) { animation-delay: 0.05s; }
	.hero__copy > *:nth-child(3) { animation-delay: 0.1s; }
	.hero__copy > *:nth-child(4) { animation-delay: 0.15s; }
	.hero__copy > *:nth-child(5) { animation-delay: 0.2s; }
	.hero__media { animation: fade 0.9s var(--ease) 0.15s both; }
	@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
	@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
}

@media (max-width: 900px) {
	.hero__in { grid-template-columns: 1fr; }
	.hero__media { order: 2; }
	.hero__img, .hero__media .ph { aspect-ratio: 4 / 3; border-radius: 22px 22px 22px 80px; }
	.hero__title { max-width: none; }
}

/* ---------- franja de marca (los 5 servicios del logo) ---------- */
.strip { background: var(--surface-2); padding: clamp(28px, 4vw, 44px) 0; }
.strip__list { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.strip__item a { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; text-decoration: none; color: var(--carbon); padding: 8px 4px; border-radius: 12px; }
.strip__item a:hover { background: #fff; }
.strip__ring {
	width: 72px; height: 72px; border-radius: 50%;
	display: inline-flex; align-items: center; justify-content: center;
	border: 2.5px solid var(--c); color: var(--c); background: #fff;
}
.strip__ring .icon { width: 32px; height: 32px; stroke-width: 1.6; }
.strip__label { font-family: var(--font-display); font-weight: 700; font-size: 0.95rem; line-height: 1.2; max-width: 11ch; }
.strip__dash { width: 44px; height: 4px; border-radius: 2px; background: var(--c); }
.strip__item--red { --c: var(--red); }
.strip__item--orange { --c: var(--orange); }
.strip__item--green { --c: var(--green); }
.strip__item--blue { --c: var(--blue); }
.strip__item--teal { --c: var(--teal); }
@media (max-width: 900px) { .strip__list { grid-template-columns: repeat(3, 1fr); row-gap: 24px; } }
@media (max-width: 560px) { .strip__list { grid-template-columns: repeat(2, 1fr); } .strip__ring { width: 64px; height: 64px; } }

/* ---------- secciones ---------- */
.section { padding: var(--section) 0; }
.section--tight { padding-top: clamp(28px, 4vw, 56px); }
.section__head { max-width: 62ch; margin-bottom: clamp(28px, 4vw, 48px); }
.section__head--row { max-width: none; display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.section__head--row > div { max-width: 62ch; }
.section__title { font-size: var(--fs-5); font-weight: 800; letter-spacing: -0.02em; }
.section__lead { margin-top: 14px; font-size: var(--fs-2); color: var(--ink-2); }
.section__foot { margin-top: 28px; color: var(--ink-2); }

/* ---------- servicios ---------- */
.services { display: grid; grid-template-columns: 1fr 1fr; gap: 0 clamp(24px, 4vw, 56px); border-top: 1px solid var(--line); }
.service { display: flex; gap: 18px; padding: 26px 0; border-bottom: 1px solid var(--line); }
.service__icon {
	width: 56px; height: 56px; flex: none; border-radius: 16px;
	display: inline-flex; align-items: center; justify-content: center;
	background: var(--soft); color: var(--c);
}
.service__icon .icon { width: 28px; height: 28px; }
.service__title { font-size: var(--fs-2); font-weight: 700; }
.service__text { margin-top: 6px; color: var(--ink-2); max-width: 46ch; }
.service--red { --c: var(--red); --soft: var(--red-soft); }
.service--orange { --c: var(--orange); --soft: var(--orange-soft); }
.service--green { --c: var(--green); --soft: var(--green-soft); }
.service--blue { --c: var(--blue); --soft: var(--blue-soft); }
.service--teal { --c: var(--teal); --soft: var(--teal-soft); }
@media (max-width: 760px) { .services { grid-template-columns: 1fr; } }

/* ---------- salud, confianza, siempre ---------- */
.about { background: var(--carbon); color: #fff; padding: var(--section) 0; }
.about__in { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: clamp(32px, 6vw, 88px); align-items: center; }
.about__title { font-size: var(--fs-5); font-weight: 800; letter-spacing: -0.02em; }
.about__lead { margin-top: 12px; color: #c9ced4; font-size: var(--fs-2); }
.about__values { margin-top: 36px; display: grid; gap: 26px; }
.about__values div { display: grid; grid-template-columns: 9rem 1fr; gap: 12px 20px; padding-top: 22px; border-top: 1px solid rgba(255, 255, 255, 0.14); }
.about__values dt { font-family: var(--font-display); font-weight: 800; font-size: var(--fs-3); letter-spacing: -0.01em; }
.about__values div:nth-child(1) dt { color: #ff8a86; }
.about__values div:nth-child(2) dt { color: #ffb067; }
.about__values div:nth-child(3) dt { color: #7fd38c; }
.about__values dd { color: #e2e5e9; max-width: 48ch; }
.about__media { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: end; }
.about__img, .about__media .ph { width: 100%; object-fit: cover; border-radius: 18px; aspect-ratio: 3 / 4; }
.about__img--1 { transform: translateY(-28px); }
.about__media .ph { background: var(--night-2); }
@media (max-width: 900px) {
	.about__in { grid-template-columns: 1fr; }
	.about__values div { grid-template-columns: 1fr; gap: 6px; }
	.about__img--1 { transform: none; }
}

/* ---------- equipo ---------- */
.members { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px clamp(16px, 2.5vw, 28px); }
.member__photo img, .member__photo .ph { width: 100%; aspect-ratio: 1; object-fit: cover; object-position: center top; border-radius: 18px; min-height: 0; }
.member__name { margin-top: 14px; font-size: var(--fs-2); font-weight: 700; }
.member__role { margin-top: 2px; color: var(--green-700); font-weight: 600; font-size: var(--fs-0); }
.member__bio { margin-top: 8px; color: var(--ink-2); font-size: var(--fs-0); }
.members--preview .member__bio { display: none; }
@media (max-width: 900px) { .members { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 620px) { .members { grid-template-columns: repeat(2, 1fr); gap: 24px 14px; } .member__name { font-size: var(--fs-1); } }

/* ---------- tienda ---------- */
.store { background: var(--surface-2); padding: var(--section) 0; }
.store__in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 88px); align-items: center; }
.store__media { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.store__img, .store__media .ph { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 18px; min-height: 0; }
.store__media .store__img:last-child, .store__media .ph:last-child { transform: translateY(32px); }
.store__copy p { margin-top: 14px; color: var(--ink-2); font-size: var(--fs-2); max-width: 48ch; }
.store__copy .btn { margin-top: 28px; }
.checks { margin-top: 22px; display: grid; gap: 10px; }
.checks li { display: flex; align-items: center; gap: 10px; }
.checks .icon { color: var(--green); width: 1.35em; height: 1.35em; }
@media (max-width: 900px) {
	.store__in { grid-template-columns: 1fr; }
	.store__media { order: 2; }
}

/* ---------- ubicación ---------- */
.location__in { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: clamp(32px, 6vw, 72px); align-items: start; }
.location__list { margin-top: 28px; display: grid; gap: 22px; }
.location__list li { display: flex; gap: 14px; align-items: flex-start; }
.location__list .icon { width: 26px; height: 26px; color: var(--green-700); margin-top: 2px; }
.location__list strong { display: block; font-weight: 600; }
.location__list span, .location__list a:not(strong a) { color: var(--ink-2); }
.location__list div > a { display: inline-block; margin-top: 2px; font-weight: 600; color: var(--green-700); }
.location__social { margin-top: 32px; display: flex; gap: 10px; flex-wrap: wrap; }
.location__social a { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border: 1.5px solid var(--line); border-radius: 999px; text-decoration: none; font-weight: 600; }
.location__social a:hover { border-color: var(--carbon); color: var(--carbon); }
.location__map iframe { width: 100%; aspect-ratio: 4 / 3; border: 0; border-radius: 22px; background: var(--surface-2); }
@media (max-width: 900px) { .location__in { grid-template-columns: 1fr; } }

/* ---------- franja de urgencias ---------- */
.cta-band { background: var(--green); color: #fff; padding: clamp(40px, 6vw, 72px) 0; }
.cta-band__in { display: flex; justify-content: space-between; align-items: center; gap: 32px; flex-wrap: wrap; }
.cta-band__title { font-size: var(--fs-4); font-weight: 800; letter-spacing: -0.015em; }
.cta-band__text { margin-top: 10px; max-width: 52ch; color: #e7f3e9; font-size: var(--fs-1); }
.cta-band__actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- pie ---------- */
.site-footer { background: var(--night); color: #cfd4da; padding: clamp(48px, 7vw, 88px) 0 40px; }
.site-footer a { text-decoration: none; color: #e9ecef; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer__grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 40px; }
.site-footer__brand img, .site-footer__brand svg { width: min(100%, 220px); height: auto; }
.site-footer__h { font-size: var(--fs-1); font-weight: 700; color: #fff; margin-bottom: 14px; }
.site-footer__list { display: grid; gap: 10px; }
.site-footer__list li a { display: inline-flex; align-items: center; gap: 8px; }
.site-footer__menu { margin-top: 20px; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.site-footer__address { line-height: 1.7; }
.partners { margin-top: 56px; padding-top: 30px; border-top: 1px solid rgba(255, 255, 255, 0.1); display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.partners__label { font-size: var(--fs-0); color: #9aa1a9; }
.partners__list { display: flex; gap: 14px; flex-wrap: wrap; }
.partners__list li { background: #fff; border-radius: 12px; padding: 10px 16px; }
.partners__list img { height: 44px; width: auto; }
.site-footer__bottom { margin-top: 40px; padding: 22px 150px 0 0; border-top: 1px solid rgba(255, 255, 255, 0.1); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: var(--fs-0); color: #9aa1a9; }
@media (max-width: 900px) { .site-footer__grid { grid-template-columns: 1fr 1fr; } .site-footer__brand { grid-column: 1 / -1; } }
@media (max-width: 520px) { .site-footer__grid { grid-template-columns: 1fr; } .site-footer__bottom { padding-right: 0; padding-bottom: 56px; } }

/* ---------- WhatsApp flotante ---------- */
.wa-float {
	position: fixed; right: 18px; bottom: 18px; z-index: 60;
	display: inline-flex; align-items: center; gap: 10px;
	padding: 12px 18px 12px 14px; border-radius: 999px;
	background: #25d366; color: #fff; font-weight: 700; text-decoration: none;
	box-shadow: 0 12px 28px -10px rgba(37, 211, 102, 0.7);
	transition: transform 0.18s var(--ease), background-color 0.18s var(--ease);
}
.wa-float:hover { transform: translateY(-2px); background: #1fbd5a; color: #fff; }
.wa-float .icon { width: 28px; height: 28px; }
@media (max-width: 640px) { .wa-float span { display: none; } .wa-float { padding: 14px; } }

/* ---------- cabecera de páginas internas ---------- */
.page-head { padding: clamp(36px, 6vw, 72px) 0 0; }
.page-head__title { font-size: var(--fs-5); font-weight: 800; letter-spacing: -0.02em; }
.page-head__lead { font-size: var(--fs-2); color: var(--ink-2); max-width: 62ch; }
.page-head__meta { color: var(--ink-3); font-size: var(--fs-0); }

/* ---------- contenido editorial ---------- */
.prose { max-width: 72ch; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font-size: var(--fs-3); margin-top: 1.8em; }
.prose h3 { font-size: var(--fs-2); margin-top: 1.5em; }
.prose img { border-radius: 14px; }
.prose__hero { margin-bottom: 1.6em; aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }

/* ---------- listado de entradas ---------- */
.posts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.post-card a { text-decoration: none; }
.post-card__img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; border-radius: 14px; }
.post-card__title { margin-top: 12px; font-size: var(--fs-2); }
.post-card__meta { color: var(--ink-3); font-size: var(--fs-0); margin: 4px 0 6px; }
.pagination { margin-top: 36px; }
.pagination .nav-links { display: flex; gap: 8px; flex-wrap: wrap; }
.pagination .page-numbers { padding: 8px 14px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; }
.pagination .current { background: var(--carbon); color: #fff; border-color: var(--carbon); }
@media (max-width: 760px) { .posts { grid-template-columns: 1fr; } }

/* ---------- 404 ---------- */
.notfound__in { display: grid; grid-template-columns: 1fr minmax(0, 320px); gap: 48px; align-items: center; }
.notfound__code { font-family: var(--font-display); font-weight: 800; font-size: var(--fs-6); color: var(--line); line-height: 1; }
.notfound__logo svg, .notfound__logo img { width: 100%; height: auto; }
@media (max-width: 760px) { .notfound__in { grid-template-columns: 1fr; } .notfound__logo { max-width: 200px; } }

/* ---------- admin bar ---------- */
body.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { body.admin-bar .site-header { top: 46px; } }
