:root {
  --green: #08783a;
  --green-dark: #075b30;
  --lime: #b8e45b;
  --ink: #14251b;
  --muted: #66746b;
  --mist: #f2f8ee;
  --line: #dce8dd;
  --shadow: 0 18px 45px rgba(5, 74, 34, 0.12);
  --r: 20px;
}

* {
  box-sizing: border-box;
}

html,
body {
  max-width: 100%;
  overflow-x: clip;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 85px;
}

body {
  margin: 0;
  color: var(--ink);
  font:
    16px/1.55 Arial,
    Helvetica,
    sans-serif;
  background: #fff;
}

body.modal-open {
  position: fixed;
  width: 100%;
  overflow: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

.wrap {
  width: min(1120px, calc(100% - 40px));
  margin: auto;
}

.section {
  width: 100%;
  padding: 88px 0;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.heading {
  max-width: 700px;
  margin: 0 auto 42px;
  text-align: center;
}

.heading h2 {
  margin: 0 0 13px;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.08;
}

.muted {
  color: var(--muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 13px 23px;
  border: 2px solid transparent;
  border-radius: 999px;
  font: 700 0.94rem Arial;
  cursor: pointer;
  transition: 0.2s;
}

.btn.primary {
  background: var(--green);
  color: #fff;
}

.btn.primary:hover {
  background: var(--green-dark);
  transform: translateY(-2px);
}

.header {
  position: fixed;
  z-index: 20;
  inset: 0 0 auto;
  height: 76px;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(8, 120, 58, 0.1);
}

.header.scrolled {
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.08);
}

.nav {
  width: min(1180px, calc(100% - 40px));
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand img {
  width: 148px;
  height: 56px;
  object-fit: contain;
}

.links {
  display: flex;
  align-items: center;
  gap: 21px;
  font-size: 0.92rem;
  font-weight: 700;
}

.links a:not(.btn):hover,
.links .active {
  color: var(--green);
}

.menu-button {
  display: none;
  border: 0;
  background: transparent;
  color: var(--green);
  font-size: 1.7rem;
  cursor: pointer;
}

.mobile-booking {
  display: none;
}

.intro {
  position: relative;
  min-height: 550px;
  display: grid;
  place-items: center;
  padding-top: 76px;
  background: #fff;
  isolation: isolate;
}

.intro-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 45px;
  align-items: center;
}

.intro-copy h1 {
  margin: 0 0 17px;
  color: var(--green-dark);
  font-size: clamp(2.7rem, 5vw, 4.6rem);
  line-height: 0.98;
}

.intro-copy p {
  max-width: 610px;
  margin: 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.intro-image {
  height: 330px;
  overflow: hidden;
  border: 4px solid var(--mist);
  border-radius: var(--r);
  box-shadow: var(--shadow);
}

.intro-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.services {
  background: var(--mist);
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
}

.service-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--r);
  background: #fff;
  box-shadow: 0 9px 25px rgba(6, 83, 36, 0.08);
}

.service-card img {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
}

.service-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 20px;
}

.service-body h3 {
  margin: 0 0 8px;
  color: var(--green-dark);
  font-size: 1.15rem;
}

.service-body p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.92rem;
}

.service-body .btn {
  align-self: flex-start;
  margin-top: auto;
}

.modal {
  position: fixed;
  z-index: 60;
  inset: 0;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(5, 33, 17, 0.7);
  height: 100dvh;
  min-height: 0;
}

.modal.open {
  display: grid;
}

.modal-box {
  display: flex;
  flex-direction: column;
  width: min(620px, 100%);
  max-height: min(720px, 88svh);
  max-height: min(720px, 88dvh);
  min-height: 0;
  overflow: hidden;
  border-radius: var(--r);
  background: #fff;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
  position: relative;
  z-index: 2;
  flex: none;
  padding: 28px 76px 16px 28px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 20px;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--green-dark);
  background: #fff;
  font-size: 1.45rem;
  cursor: pointer;
}

.modal-box h2 {
  margin: 0;
  color: var(--green-dark);
  line-height: 1.15;
}

.modal-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding: 20px 28px 28px;
}

.modal-content > p {
  margin: 0 0 24px;
  color: var(--muted);
}

.modal-services {
  display: grid;
  gap: 12px;
}

.modal-service {
  padding: 15px;
  border-left: 4px solid var(--lime);
  border-radius: 8px;
  background: var(--mist);
}

.modal-service strong {
  display: block;
  margin-bottom: 3px;
  color: var(--green-dark);
}

.modal-service span {
  font-size: 0.92rem;
  color: #526057;
}

.doctor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.doctor-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #fff;
  box-shadow: 0 8px 24px rgba(6, 83, 36, 0.06);
}

.doctor-card img {
  width: 100%;
  aspect-ratio: 4/4.5;
  object-fit: cover;
}

.doctor-info {
  padding: 18px;
}

.doctor-info h3 {
  margin: 0 0 6px;
  color: var(--green-dark);
  font-size: 1.06rem;
}

.doctor-info p {
  margin: 4px 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.doctor-info strong {
  color: var(--ink);
}

.facilities {
  background: var(--mist);
}

.facility-copy {
  max-width: 690px;
  margin: 0 auto 34px;
  text-align: center;
}

.facility-copy h2 {
  margin: 0 0 12px;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.08;
}

.facility-carousel {
  position: relative;
  width: min(80vw, 980px);
  margin: auto;
  aspect-ratio: 16/8.2;
  overflow: hidden;
  border-radius: 28px;
  box-shadow: var(--shadow);
  background: #173d25;
}

.facility-slide {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: end;
  padding: clamp(22px, 4vw, 45px);
  opacity: 0;
  color: #fff;
  background: center/cover no-repeat;
  transition: opacity 0.6s ease;
}

.facility-slide.active {
  opacity: 1;
}

.facility-slide:before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    0deg,
    rgba(1, 45, 21, 0.9),
    rgba(1, 45, 21, 0.08) 70%
  );
}

.facility-slide > * {
  position: relative;
  z-index: 1;
}

.facility-slide h3 {
  margin: 0 0 5px;
  font-size: clamp(1.5rem, 3vw, 2.4rem);
}

.facility-slide p {
  max-width: 550px;
  margin: 0;
  color: rgba(255, 255, 255, 0.92);
}

.facility-dots {
  display: flex;
  justify-content: center;
  gap: 9px;
  margin-top: 18px;
}

.facility-dot {
  width: 34px;
  height: 5px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: #bed2bf;
  cursor: pointer;
}

.facility-dot.active {
  background: var(--green);
}

footer {
  padding: 34px 0;
  color: rgba(255, 255, 255, 0.8);
  background: #123722;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.footer-content img {
  width: 138px;
  height: auto;
  object-fit: contain;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.9rem;
}

.footer-links a:hover {
  color: var(--lime);
}

@media (max-width: 850px) {
  .menu-button {
    display: block;
  }

  .mobile-booking {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  min-height: 40px;
  padding: 9px 14px;
  font-size: 0.78rem;
  line-height: 1;
  white-space: nowrap;
}

  .links {
    position: absolute;
    top: 76px;
    right: 0;
    left: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 13px 20px 22px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 13px 20px rgba(0, 0, 0, 0.1);
  }

  .links.open {
    display: flex;
  }

  .links .desktop-booking {
    display: none;
  }

  .links a {
    padding: 12px 3px;
  }

  .links .btn {
    margin-top: 8px;
  }

  .intro-grid {
    grid-template-columns: 1fr;
  }

  .intro-image {
    display: none;
  }

  .intro {
    min-height: 510px;
  }

  .service-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

@media (max-width: 560px) {
  html {
    scroll-behavior: auto;
  }

  .wrap,
  .nav {
    width: min(100% - 30px, 1120px);
  }

  .section {
    padding: 65px 0;
  }

  .intro {
    min-height: 100svh;
  }

.intro:before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -10px;
  background:
    linear-gradient(
      rgba(255, 255, 255, 0.68),
      rgba(255, 255, 255, 0.68)
    ),
    url("../assets/conocenos_portada.jpg") center 18%/contain no-repeat;
  filter: blur(1px);
}

  .intro-copy h1 {
    font-size: clamp(2.6rem, 12vw, 3.8rem);
  }

  .intro-copy p {
    font-size: 1rem;
  }

  .service-grid {
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    gap: 12px;
  }

  .service-body {
    padding: 14px;
  }

  .service-body h3 {
    font-size: 1rem;
  }

  .service-body p {
    font-size: 0.84rem;
  }

  .service-body .btn {
    width: 100%;
    min-height: 44px;
    padding: 10px;
    font-size: 0.83rem;
  }

  .doctor-grid {
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    gap: 12px;
  }

  .doctor-info {
    padding: 13px;
  }

  .doctor-info h3 {
    font-size: 0.94rem;
  }

  .doctor-info p {
    font-size: 0.78rem;
  }

  .facility-carousel {
    width: calc(100% - 30px);
    aspect-ratio: 4/5;
  }

  .facility-slide {
    padding: 24px;
  }

  .facility-dots {
    gap: 7px;
  }

  .facility-dot {
    width: 29px;
  }

  .modal {
    padding: 14px;
  }

  .modal-header {
    padding: 24px 68px 14px 20px;
  }

  .modal-content {
    padding: 18px 20px 24px;
  }

  .modal-close {
    top: 14px;
    right: 16px;
  }

  .footer-content {
    flex-direction: column;
    align-items: flex-start;
  }
}

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