/* ==========================================================================
   Cemepsis C.B. — Hoja de estilos
   Mobile-first. Variables de marca en :root.
   ========================================================================== */

:root {
  /* Paleta */
  --color-primary: #0E4B4D;
  --color-primary-dark: #093435;
  --color-primary-light: #1C6E70;
  --color-primary-soft: #E7F1F1;
  --color-accent: #FF6B4A;
  --color-accent-dark: #E5502F;
  --color-accent-soft: #FFE4DB;
  --color-ivory: #FBF8F3;
  --color-white: #FFFFFF;
  --color-text: #1E2A2A;
  --color-text-muted: #55686A;
  --color-border: #E4E4DE;
  --color-success: #2E8B57;
  --color-success-soft: #E4F3EA;
  --color-danger: #C0483B;
  --color-danger-soft: #FBE9E7;

  /* Tipografía */
  --font-base: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;

  /* Espaciado */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;

  /* Otros */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --shadow-sm: 0 2px 8px rgba(14, 75, 77, 0.08);
  --shadow-md: 0 8px 24px rgba(14, 75, 77, 0.12);
  --header-h: 72px;
}

/* ============ RESET BÁSICO ============ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-base);
  color: var(--color-text);
  background: var(--color-white);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4, p { margin: 0; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font: inherit; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

section[id] { scroll-margin-top: var(--header-h); }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--color-primary);
  color: white;
  padding: 0.75rem 1.25rem;
  z-index: 1000;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

/* ============ BOTONES ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.98rem;
  white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn--accent { background: var(--color-accent); color: white; box-shadow: var(--shadow-sm); }
.btn--accent:hover { background: var(--color-accent-dark); }
.btn--primary { background: var(--color-primary); color: white; }
.btn--primary:hover { background: var(--color-primary-dark); }
.btn--ghost { background: transparent; color: var(--color-primary); border: 2px solid var(--color-primary); }
.btn--ghost:hover { background: var(--color-primary-soft); }
.btn--whatsapp { background: #25D366; color: white; }
.btn--whatsapp:hover { background: #1DA851; }
.btn--lg { padding: 1rem 1.9rem; font-size: 1.05rem; }
.btn--sm { padding: 0.55rem 1.1rem; font-size: 0.88rem; }

/* ============ HEADER ============ */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: rgba(251, 248, 243, 0.96);
  backdrop-filter: blur(6px);
  z-index: 500;
  border-bottom: 1px solid var(--color-border);
  transition: box-shadow 0.2s ease;
}
.header.is-scrolled { box-shadow: var(--shadow-sm); }

.header__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.logo { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.logo__mark {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-primary);
  color: var(--color-accent);
  border-radius: 10px;
}
.logo__text {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-primary-dark);
}
.logo__text span { color: var(--color-accent); }
.logo__text--footer { font-size: 1.35rem; color: white; }
.logo__text--footer span { color: var(--color-accent); }

.nav__list {
  display: none;
}
.nav__list a {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-text);
  padding: 0.5rem 0;
  position: relative;
}
.nav__list a:hover { color: var(--color-primary); }

.header__actions { display: flex; align-items: center; gap: 0.6rem; }
.header__directions { display: none; }

.nav__toggle {
  width: 40px; height: 40px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 5px;
  border-radius: 8px;
}
.nav__toggle span {
  width: 22px; height: 2.4px;
  background: var(--color-primary-dark);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7.4px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7.4px) rotate(-45deg); }

/* Menú móvil desplegable */
.nav {
  position: absolute;
  top: var(--header-h);
  left: 0; right: 0;
}
.nav__list.is-open {
  display: flex;
  flex-direction: column;
  background: var(--color-white);
  padding: var(--space-sm) var(--space-md) var(--space-md);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
  gap: 0.2rem;
}
.nav__list.is-open a { display: block; padding: 0.75rem 0.25rem; }

@media (min-width: 900px) {
  .header__directions { display: inline-flex; }
  .nav { position: static; }
  .nav__list {
    display: flex;
    gap: 1.75rem;
    position: static;
  }
  .nav__list.is-open { flex-direction: row; padding: 0; box-shadow: none; border: none; }
  .nav__toggle { display: none; }
}

/* ============ HERO ============ */
.hero {
  padding: calc(var(--header-h) + var(--space-lg)) 0 var(--space-xl);
  background: linear-gradient(180deg, var(--color-primary-soft) 0%, var(--color-ivory) 60%);
}
.hero__inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}
.eyebrow {
  color: var(--color-accent-dark);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}
.eyebrow--center { text-align: center; }

.hero h1 {
  font-size: clamp(2rem, 5.5vw, 3.1rem);
  line-height: 1.1;
  color: var(--color-primary-dark);
  font-weight: 800;
  margin-bottom: var(--space-sm);
}
.hero__subtitle {
  font-size: 1.08rem;
  color: var(--color-text-muted);
  max-width: 46ch;
  margin-bottom: var(--space-md);
}

.hero__rating {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.95rem;
  color: var(--color-text-muted);
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
}
.stars { display: inline-flex; gap: 2px; color: var(--color-accent); }
.stars svg { fill: var(--color-accent); }
.star--half { opacity: 0.4; }

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: var(--space-md);
}

.hero__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.2rem;
}
.hero__badges li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-primary);
}

.hero__visual { display: flex; justify-content: center; }
.hero-card {
  position: relative;
  width: min(300px, 80vw);
}
.hero-card__doc {
  filter: drop-shadow(var(--shadow-md));
}
.hero-card__float {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: white;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  box-shadow: var(--shadow-md);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--color-primary-dark);
}
.hero-card__float--1 { top: 8%; left: -8%; }
.hero-card__float--2 { bottom: 10%; right: -10%; }

@media (min-width: 900px) {
  .hero__inner { flex-direction: row; align-items: center; }
  .hero__content { flex: 1.1; }
  .hero__visual { flex: 0.9; }
}

/* ============ BARRA DE CONFIANZA ============ */
.trust {
  background: var(--color-primary);
  color: white;
  padding: var(--space-md) 0;
}
.trust__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}
.trust__item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.trust__item svg { color: var(--color-accent); flex-shrink: 0; }
.trust__item strong { display: block; font-size: 1rem; }
.trust__item span { display: block; font-size: 0.82rem; color: rgba(255,255,255,0.75); }
.trust__item--link { border-radius: var(--radius-sm); transition: background-color 0.15s ease; }
.trust__item--link:hover { background: rgba(255,255,255,0.08); }
.trust__item--link:hover span { color: var(--color-accent); }

@media (min-width: 700px) {
  .trust__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1000px) {
  .trust__grid { grid-template-columns: repeat(4, 1fr); }
}

/* ============ SECCIÓN GENÉRICA ============ */
.section-head { text-align: center; max-width: 640px; margin: 0 auto var(--space-lg); }
.section-head--left { text-align: left; margin: 0 0 var(--space-lg); max-width: none; }
.section-head h2 {
  font-size: clamp(1.6rem, 4vw, 2.3rem);
  color: var(--color-primary-dark);
  font-weight: 800;
  margin-bottom: 0.75rem;
}
.section-head__lead { color: var(--color-text-muted); font-size: 1.02rem; }

.services, .why, .reviews, .location, .faq, .contact {
  padding: var(--space-xl) 0;
}
.services { background: var(--color-white); }
.why { background: var(--color-primary-soft); }
.reviews { background: var(--color-white); }
.location { background: var(--color-ivory); }
.faq { background: var(--color-white); }
.contact { background: var(--color-primary-soft); }

/* ============ SERVICIOS ============ */
.services__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}
.service-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.service-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.service-card__icon {
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-primary-soft);
  color: var(--color-primary);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-sm);
}
.service-card h3 { font-size: 1.12rem; color: var(--color-primary-dark); margin-bottom: 0.5rem; font-weight: 700; }
.service-card p { color: var(--color-text-muted); font-size: 0.95rem; margin-bottom: var(--space-sm); }
.service-card__cta {
  color: var(--color-accent-dark);
  font-weight: 700;
  font-size: 0.92rem;
}
.service-card__cta:hover { text-decoration: underline; }

@media (min-width: 640px) {
  .services__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 980px) {
  .services__grid { grid-template-columns: repeat(3, 1fr); }
}

/* ============ POR QUÉ ELEGIRNOS ============ */
.why__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}
.why-card {
  background: var(--color-white);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.why-card__icon {
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-accent-soft);
  color: var(--color-accent-dark);
  border-radius: 50%;
  margin-bottom: var(--space-sm);
}
.why-card h3 { font-size: 1.05rem; color: var(--color-primary-dark); margin-bottom: 0.4rem; font-weight: 700; }
.why-card p { color: var(--color-text-muted); font-size: 0.93rem; }

@media (min-width: 700px) {
  .why__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1100px) {
  .why__grid { grid-template-columns: repeat(4, 1fr); }
}

/* ============ OPINIONES ============ */
.reviews__score {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin-top: var(--space-sm);
  color: var(--color-text-muted);
  flex-wrap: wrap;
}
.reviews__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}
.review-card {
  background: var(--color-ivory);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
}
.review-card p { font-size: 1.02rem; margin: 0.75rem 0; color: var(--color-text); font-style: italic; }
.review-card__nolabel { color: var(--color-text-muted); font-style: normal; font-size: 0.95rem; }
.review-card cite { font-weight: 700; font-style: normal; color: var(--color-primary-dark); display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.badge-guide {
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--color-primary-soft);
  color: var(--color-primary);
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
}
.reviews__more { text-align: center; margin-top: var(--space-lg); }

@media (min-width: 760px) {
  .reviews__grid { grid-template-columns: repeat(3, 1fr); }
}

/* ============ HORARIO Y UBICACIÓN ============ */
.location__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
  align-items: start;
}
.schedule {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  box-shadow: var(--shadow-sm);
}
.schedule__status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.92rem;
  margin-bottom: var(--space-md);
}
.schedule__status.is-open { background: var(--color-success-soft); color: var(--color-success); }
.schedule__status.is-closed { background: var(--color-danger-soft); color: var(--color-danger); }
.schedule__status::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.schedule__list { border-top: 1px solid var(--color-border); }
.schedule__list li {
  display: flex;
  justify-content: space-between;
  padding: 0.7rem 0.1rem;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.98rem;
}
.schedule__list li span:first-child { font-weight: 600; color: var(--color-primary-dark); }
.schedule__ok { color: var(--color-success); font-weight: 700; }
.schedule__closed { color: var(--color-danger); font-weight: 700; }

.schedule__note {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  font-size: 0.86rem;
  color: var(--color-text-muted);
  margin: var(--space-md) 0;
}
.schedule__address {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--color-primary-dark);
  margin-bottom: var(--space-md);
}
.schedule__address svg { flex-shrink: 0; color: var(--color-accent); }

.map {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  min-height: 320px;
}
.map iframe { width: 100%; height: 100%; min-height: 320px; border: 0; }

@media (min-width: 900px) {
  .location__grid { grid-template-columns: 1fr 1fr; }
  .map { min-height: 480px; }
  .map iframe { min-height: 480px; }
}

/* ============ FAQ ============ */
.faq__list {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.faq-item {
  background: var(--color-ivory);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0.4rem var(--space-md);
}
.faq-item summary {
  cursor: pointer;
  list-style: none;
  padding: var(--space-sm) 0;
  font-weight: 700;
  color: var(--color-primary-dark);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--color-accent);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.faq-item[open] summary::after { content: "−"; }
.faq-item p { color: var(--color-text-muted); padding-bottom: var(--space-sm); font-size: 0.96rem; }

/* ============ CONTACTO ============ */
.contact__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
}
.contact__info h2 { color: var(--color-primary-dark); font-size: clamp(1.6rem, 4vw, 2.1rem); font-weight: 800; margin: 0.5rem 0; }
.contact__info p { color: var(--color-text-muted); margin-bottom: var(--space-md); }
.contact__phone {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--color-primary-dark);
  margin-bottom: var(--space-sm);
}
.contact__phone:hover { color: var(--color-accent-dark); }
.contact__address {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--color-primary-dark);
}
.contact__address svg { color: var(--color-accent); flex-shrink: 0; }

.contact__form {
  background: var(--color-white);
  padding: var(--space-md);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
.form-row { display: flex; flex-direction: column; gap: 0.35rem; }
.form-row label { font-weight: 600; font-size: 0.9rem; color: var(--color-primary-dark); }
.form-row input, .form-row select, .form-row textarea {
  padding: 0.75rem 0.9rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-ivory);
  color: var(--color-text);
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
  border-color: var(--color-primary);
  background: white;
}
.contact__submit { margin-top: 0.4rem; }
.contact__formnote { font-size: 0.9rem; font-weight: 600; min-height: 1.2em; }
.contact__formnote.success { color: var(--color-success); }
.contact__formnote.error { color: var(--color-danger); }

@media (min-width: 900px) {
  .contact__inner { grid-template-columns: 1fr 1.1fr; align-items: start; }
}

/* ============ FOOTER ============ */
.footer {
  background: var(--color-primary-dark);
  color: rgba(255,255,255,0.85);
  padding: var(--space-xl) 0 var(--space-md);
}
.footer__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid rgba(255,255,255,0.15);
}
.footer__col h4 { color: white; font-size: 0.95rem; margin-bottom: 0.75rem; }
.footer__col p { font-size: 0.9rem; margin-bottom: 0.5rem; line-height: 1.6; }
.footer__col a:hover { color: var(--color-accent); }
.footer__bottom { padding-top: var(--space-md); text-align: center; font-size: 0.82rem; }

@media (min-width: 700px) {
  .footer__inner { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1000px) {
  .footer__inner { grid-template-columns: repeat(4, 1fr); }
}

/* ============ BOTÓN FLOTANTE DE LLAMADA ============ */
.floating-call {
  display: none;
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  width: 58px; height: 58px;
  background: var(--color-accent);
  color: white;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(255, 107, 74, 0.5);
  z-index: 400;
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255,107,74,0.55), 0 6px 20px rgba(255,107,74,0.5); }
  70% { box-shadow: 0 0 0 14px rgba(255,107,74,0), 0 6px 20px rgba(255,107,74,0.5); }
  100% { box-shadow: 0 0 0 0 rgba(255,107,74,0), 0 6px 20px rgba(255,107,74,0.5); }
}

@media (max-width: 899px) {
  .floating-call { display: flex; }
}
