:root {
  --blue: #6980be;
  --dark: #3f4d72;
  --light: #92a4d4;
  --cyan: #4bbcce;
  --lime: #d7e269;
  --pink: #d8246a;
  --text: #777;
  --yellow: #ffd24f;
}

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

html {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  font-family: Quicksand, Arial, sans-serif;
  font-size: 16px;
}

header,
main,
main > section,
footer {
  width: 100%;
  max-width: 100%;
}

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

a:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

/* Portada */
.hero {
  --portrait-size: 270px;
  --portrait-x: 50px;
  --portrait-y: 73px;
  --portrait-image-x: 50%;
  --portrait-image-y: 50%;
  --portrait-image-zoom: 1;
  --portrait-mobile-size: 245px;
  --portrait-mobile-x: 0px;
  --portrait-mobile-y: 0px;

  position: relative;
  height: 458px;
  min-height: 0;
  overflow: hidden;
  background: var(--blue);
  color: #fff;
}

.bubble {
  position: absolute;
  border-radius: 50%;
  background: var(--light);
}

.bubble-a {
  top: -115px;
  left: calc(25% - 397px);
  width: 450px;
  height: 450px;
}

.bubble-c {
  top: 125px;
  right: calc(30% - 545px);
  width: 320px;
  height: 320px;
}

.hero-inner {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  max-width: 795px;
  height: 458px;
  margin: 0 auto;
  padding: 0;
}

.portrait {
  position: absolute;
  top: var(--portrait-y);
  left: var(--portrait-x);
  width: var(--portrait-size);
  height: var(--portrait-size);
  overflow: hidden;
  border-radius: 50%;
  background: #536aa0;
  aspect-ratio: 1;
}

.portrait img {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: var(--portrait-image-x) var(--portrait-image-y);
  transform: scale(var(--portrait-image-zoom));
  transform-origin: center;
}

.hero-copy {
  position: absolute;
  top: 78px;
  left: 329px;
  width: 350px;
  min-width: 0;
  text-align: center;
}

.name-ribbon {
  position: relative;
  z-index: 1;
  padding: 13px 18px;
  transform: rotate(-1.5deg);
  background: #f3e751;
  font-size: 32px;
  font-weight: 700;
}

.name-ribbon::before {
  position: absolute;
  z-index: -1;
  inset: -12px -18px 8px 10px;
  transform: rotate(2deg);
  background: var(--cyan);
  content: "";
}

.hero h1 {
  margin: 8px 0 14px;
  font-size: 29px;
  font-weight: 500;
}

.socials {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 20px;
}

.socials a {
  display: grid;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  place-items: center;
  background: var(--cyan);
  color: #fff;
  font-size: 24px;
  font-weight: 600;
  text-decoration: none;
}

.socials a[aria-disabled="true"] {
  pointer-events: none;
}

.socials img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.appointment {
  display: inline-block;
  padding: 11px 14px;
  border-radius: 14px;
  background: var(--pink);
  color: #fff;
  font-size: 25px;
  text-decoration: none;
}

/* Presentación */
.wave-top {
  position: relative;
  padding-top: 50px;
}

.wave-top::before {
  position: absolute;
  top: -45px;
  left: -5%;
  width: 110%;
  height: 90px;
  border-radius: 50% 50% 0 0 / 70% 70% 0 0;
  background: #fff;
  box-shadow: 0 -18px 22px rgb(0 0 0 / 8%);
  content: "";
}

.about {
  padding-bottom: 70px;
  background: #fff;
}

.about-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.75fr 0.8fr;
  gap: 80px;
  max-width: 990px;
  margin: 0 auto;
}

.bio {
  align-self: center;
  font-size: 15.5px;
  line-height: 1.32;
  text-align: justify;
}

.bio p {
  margin: 0 0 20px;
}

.credentials {
  color: var(--cyan);
  font-size: 13px;
  text-align: center;
}

.credential-photo {
  width: 260px;
  height: 260px;
  margin: 0 auto 22px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--lime);
}

.credential-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.credentials p {
  margin: 0 0 26px;
}

/* Certificaciones */
.awards {
  padding: 45px 0;
  background: var(--cyan);
  color: #fff;
}

.award-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px 50px;
  max-width: 1020px;
  margin: 0 auto;
}

.award-list article {
  display: grid;
  grid-template-columns: 74px 1fr;
  align-items: start;
  gap: 18px;
  font-size: 11px;
  line-height: 1.15;
}

.award-list strong {
  font-size: 11px;
}

.award-list p {
  margin: 3px 0 12px;
}

.medal {
  display: grid;
  align-self: start;
  width: 70px;
  height: 70px;
  border: 5px solid #f4c63e;
  border-radius: 50%;
  place-items: center;
  background: var(--yellow);
  color: #fff;
  font-size: 42px;
}

.medal.cnn {
  color: #fff;
  font-size: 17px;
  font-weight: 700;
}

/* Servicios */
.services {
  padding: 40px 30px 55px;
}

.services h2 {
  margin: 0 0 35px;
  color: var(--blue);
  font-size: 38px;
  font-weight: 500;
  text-align: center;
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 52px 65px;
  max-width: 1020px;
  margin: 0 auto;
}

.service-grid article {
  font-size: 14px;
  line-height: 1.2;
  text-align: center;
}

.service-icon {
  display: grid;
  width: 112px;
  height: 112px;
  margin: 0 auto 22px;
  overflow: hidden;
  border-radius: 50%;
  place-items: center;
  background: var(--lime);
  color: #fff;
  font-size: 32px;
  font-weight: 700;
}

.service-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.service-grid h3 {
  margin: 0 0 24px;
  color: var(--cyan);
  font-size: 16px;
  line-height: 1.05;
}

.service-grid p {
  margin: 0;
}

/* Ubicación */
.location {
  --hospital-logo-width: 190px;

  display: flex;
  min-height: 510px;
  align-items: center;
  justify-content: center;
  gap: 110px;
  padding: 42px;
  background: var(--blue);
  color: #fff;
}

.location-copy {
  font-size: 16px;
  line-height: 1.25;
  text-align: center;
}

.location-copy p {
  margin: 20px 0;
}

.location-copy a {
  color: #fff;
  text-decoration: none;
}

.hospital-logo {
  display: block;
  width: var(--hospital-logo-width);
  height: auto;
  margin: 0 auto;
}

.hospital-logo img {
  width: 100%;
  height: auto;
  object-fit: contain;
  aspect-ratio: 412 / 88;
}

.map {
  position: relative;
  display: block;
  width: 350px;
  height: 350px;
  overflow: hidden;
}

.map iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.map-link {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 7px 10px;
  border-radius: 8px;
  background: rgb(63 77 114 / 90%);
  color: #fff;
  font-size: 11px;
  text-decoration: none;
}

.map-link:focus-visible {
  outline-color: var(--yellow);
}

/* Pie de página */
footer {
  display: flex;
  min-height: 60px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 15px 40px;
  background: var(--dark);
  color: #fff;
  font-size: 12px;
  text-align: center;
}

/* Vista equivalente al diseño de referencia de 795 px */
@media (min-width: 651px) and (max-width: 800px) {
  .about {
    padding-bottom: 35px;
  }

  .about-grid {
    grid-template-columns: 1.75fr 0.8fr;
    gap: 55px;
    max-width: 675px;
    padding: 0;
  }

  .bio {
    font-size: 11px;
    line-height: 1.28;
  }

  .bio p {
    margin-bottom: 14px;
  }

  .credentials {
    font-size: 10px;
  }

  .credential-photo {
    width: 200px;
    height: 200px;
    margin-bottom: 18px;
  }

  .credentials p {
    margin-bottom: 22px;
  }

  .awards {
    padding: 34px 0;
  }

  .award-list {
    grid-template-columns: 1fr 1fr;
    gap: 24px 38px;
    max-width: 675px;
    padding: 0;
  }

  .award-list article {
    grid-template-columns: 58px 1fr;
    gap: 14px;
    font-size: 8px;
  }

  .award-list strong {
    font-size: 8px;
  }

  .medal {
    width: 58px;
    height: 58px;
    border-width: 4px;
    font-size: 34px;
  }

  .medal.cnn {
    font-size: 14px;
  }

  .services {
    padding: 28px 30px 45px;
  }

  .services h2 {
    margin-bottom: 28px;
    font-size: 32px;
  }

  .service-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 40px 55px;
    max-width: 675px;
  }

  .service-grid article {
    font-size: 11px;
  }

  .service-icon {
    width: 82px;
    height: 82px;
    margin-bottom: 17px;
    font-size: 24px;
  }

  .service-grid h3 {
    margin-bottom: 18px;
    font-size: 13px;
  }

  .location {
    --hospital-logo-width: 130px;

    min-height: 288px;
    flex-direction: row;
    gap: 80px;
    padding: 25px;
  }

  .location-copy {
    font-size: 12px;
  }

  .location-copy p {
    margin: 14px 0;
  }

  .map {
    width: 243px;
    height: 243px;
  }

  footer {
    min-height: 37px;
    flex-direction: row;
    padding: 9px 26px;
    font-size: 9px;
  }
}

/* Móvil */
@media (max-width: 650px) {
  .hero {
    height: auto;
    min-height: 690px;
  }

  .hero-inner {
    display: flex;
    min-height: 690px;
    height: auto;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 55px 20px 85px;
  }

  .bubble-a {
    top: -85px;
    left: -115px;
    width: 230px;
    height: 230px;
  }

  .bubble-c {
    top: 250px;
    right: -135px;
    width: 220px;
    height: 220px;
  }

  .portrait {
    position: relative;
    top: var(--portrait-mobile-y);
    left: var(--portrait-mobile-x);
    width: var(--portrait-mobile-size);
    height: var(--portrait-mobile-size);
    flex: 0 0 auto;
  }

  .hero-copy {
    position: relative;
    top: auto;
    left: auto;
    width: 100%;
    max-width: 420px;
    padding: 0 5px;
  }

  .name-ribbon {
    padding: 12px 14px;
    font-size: 25px;
  }

  .hero h1 {
    font-size: 26px;
  }

  .appointment {
    font-size: 22px;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 30px;
    padding: 0 28px;
  }

  .bio {
    align-self: stretch;
  }

  .credential-photo {
    width: 190px;
    height: 190px;
  }

  .award-list {
    grid-template-columns: 1fr;
    padding: 0 25px;
  }

  .service-grid {
    grid-template-columns: 1fr 1fr;
    gap: 48px 30px;
  }

  .location {
    --hospital-logo-width: 180px;

    flex-direction: column;
    gap: 35px;
  }

  .map {
    width: min(100%, 350px);
    height: auto;
    aspect-ratio: 1;
  }

  footer {
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  .service-grid {
    grid-template-columns: 1fr;
  }

  .award-list article {
    grid-template-columns: 58px 1fr;
  }

  .medal {
    width: 56px;
    height: 56px;
    font-size: 32px;
  }

  .location {
    padding: 45px 20px;
  }
}
