@import url("./base/variables.css");
@import url("./base/reset.css");
@import url("./base/typography.css");

@import url("./components/buttons.css");
@import url("./components/section.css");

@import url("./pages/home.css");


/* ==========================================================================
   GLOBAL
   ========================================================================== */

main {
  min-height: 40vh;
}

main > .pm-container,
main.pm-container {
  padding-block: 48px;
}


/* ==========================================================================
   ACCESSIBILITY
   ========================================================================== */

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}


/* ==========================================================================
   HEADER
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;

  width: 100%;

  background: var(--pm-color-white);

  box-shadow: 0 2px 12px rgb(0 0 0 / 5%);
}


/* ==========================================================================
   FILA SUPERIOR
   ========================================================================== */

.site-header__top {
  background: #f2fbfc;
  border-bottom: 1px solid #dcebed;
}

.site-header__top-inner {
  display: grid;

  grid-template-columns:
    160px
    minmax(0, 1fr)
    auto;

  min-height: 82px;

  align-items: center;

  gap: 32px;
}


/* ==========================================================================
   LOGO
   ========================================================================== */

.site-header__brand {
  display: flex;
  align-items: center;

  align-self: stretch;
}

.site-header__brand .custom-logo-link {
  display: flex;

  height: 100%;

  align-items: center;
}

.site-header__brand .custom-logo {
  display: block;

  width: auto;
  max-width: 125px;
  max-height: 72px;

  object-fit: contain;
}


/* ==========================================================================
   ACCIONES SUPERIORES
   ========================================================================== */

.site-header__actions {
  display: flex;

  align-items: center;
  justify-content: flex-end;

  gap: 26px;

  margin-left: auto;
}


/* Encuentra tu clínica */

.site-header__clinic-link {
  display: inline-flex;

  align-items: center;

  gap: 8px;

  color: #5f858a;

  font-size: 16px;
  font-weight: 600;

  text-decoration: none;

  white-space: nowrap;
}

.site-header__mask-icon {
  display: inline-block;

  flex: 0 0 auto;

  background-color: currentColor;

  -webkit-mask-image: var(--pm-mask-icon);
  mask-image: var(--pm-mask-icon);

  -webkit-mask-position: center;
  mask-position: center;

  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;

  -webkit-mask-size: contain;
  mask-size: contain;
}

.site-header__clinic-icon {
  width: 21px;
  height: 21px;
}

.site-header__clinic-link:hover,
.site-header__clinic-link:focus-visible {
  color: var(--pm-color-primary);
}


/* Botón reserva */

.site-header__cta {
  display: inline-flex;

  min-height: 48px;

  align-items: center;
  justify-content: center;

  padding: 11px 30px;

  border-radius: 999px;

  background: var(--pm-color-primary);
  color: #fff;

  font-size: 17px;
  font-weight: 700;

  text-decoration: none;

  white-space: nowrap;
}


/* Teléfono */

.site-header__phone {
  display: inline-flex;

  align-items: center;

  gap: 10px;

  color: var(--pm-color-primary);

  text-decoration: none;

  white-space: nowrap;
}

.site-header__phone-icon {
  display: inline-flex;

  width: 44px;
  height: 44px;

  align-items: center;
  justify-content: center;

  flex: 0 0 44px;

  border: 2px solid currentColor;
  border-radius: 50%;
}

.site-header__phone-icon .site-header__mask-icon {
  width: 24px;
  height: 24px;
}

.site-header__phone strong {
  font-size: 27px;
  font-weight: 700;
  line-height: 1;
}


/* ==========================================================================
   FILA DEL MENÚ
   ========================================================================== */

.site-header__navigation {
  background: #fff;

  border-bottom: 1px solid #e7ecee;
}

.site-navigation {
  width: 100%;
}

.site-navigation__list {
  display: flex;

  align-items: center;
  justify-content: space-between;

  gap: 14px;

  margin: 0;
  padding: 0;

  list-style: none;
}


/* ==========================================================================
   ITEMS PRINCIPALES
   ========================================================================== */

.site-navigation__list > li {
  position: relative;

  margin: 0;
  padding: 0;
}

.site-navigation__list > li > a {
  position: relative;

  display: flex;

  min-height: 68px;

  align-items: center;

  gap: 8px;

  padding: 0 8px;

  color: var(--pm-color-primary);

  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;

  text-decoration: none;

  white-space: nowrap;
}

.site-navigation__list > li > a:hover,
.site-navigation__list > li > a:focus-visible,
.site-navigation__list > li.current-menu-item > a,
.site-navigation__list > li.current-menu-ancestor > a {
  color: #007c87;
}


/* ==========================================================================
   FLECHA PRIMER NIVEL
   ========================================================================== */

.site-navigation__list
  > .menu-item-has-children
  > a::after {
  content: "";

  width: 7px;
  height: 7px;

  margin-top: -4px;

  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;

  transform: rotate(45deg);

  transition: transform 180ms ease;
}

.site-navigation__list
  > .menu-item-has-children:hover
  > a::after,
.site-navigation__list
  > .menu-item-has-children:focus-within
  > a::after {
  transform: rotate(225deg);
}


/* ==========================================================================
   SUBMENÚ PRIMER NIVEL DESKTOP
   ========================================================================== */

.site-navigation__list li {
  position: relative;
}

.site-navigation__list > li > .sub-menu {
  position: absolute;

  top: 100%;
  left: 0;

  z-index: 2000;

  width: 290px;
  min-width: 290px;

  margin: 0;
  padding: 6px 0;

  overflow: visible;

  border: 1px solid #e4e8ea;
  border-radius: 0 0 14px 14px;

  background: #fff;

  box-shadow: 0 12px 30px rgb(0 0 0 / 12%);

  list-style: none;

  opacity: 0;
  visibility: hidden;

  pointer-events: none;

  transform: translateY(8px);

  transition:
    opacity 180ms ease,
    visibility 180ms ease,
    transform 180ms ease;
}

.site-navigation__list
  > li:hover
  > .sub-menu,
.site-navigation__list
  > li:focus-within
  > .sub-menu {
  opacity: 1;
  visibility: visible;

  pointer-events: auto;

  transform: translateY(0);
}


/* Items submenú */

.site-navigation__list .sub-menu li {
  position: relative;

  width: 100%;

  margin: 0;
  padding: 0;
}


/* Links submenú */

.site-navigation__list .sub-menu li > a {
  position: relative;

  display: flex;

  width: 100%;
  min-height: 44px;

  align-items: center;
  justify-content: space-between;

  padding: 11px 18px;

  color: #34495e;

  font-size: 16px;
  font-weight: 400;
  line-height: 1.3;

  text-decoration: none;

  white-space: normal;
}

.site-navigation__list .sub-menu li > a:hover,
.site-navigation__list .sub-menu li > a:focus-visible {
  background: rgb(0 171 183 / 12%);

  color: var(--pm-color-primary);
}


/* ==========================================================================
   ITEMS CON SUBMENÚ ANIDADO
   ========================================================================== */

.site-navigation__list
  .sub-menu
  li:has(> .sub-menu)
  > a {
  padding-right: 44px;
}

.site-navigation__list
  .sub-menu
  li:has(> .sub-menu)
  > a::after {
  position: absolute;

  top: 50%;
  right: 18px;

  width: 7px;
  height: 7px;

  border-top: 2px solid var(--pm-color-primary);
  border-right: 2px solid var(--pm-color-primary);

  content: "";

  transform:
    translateY(-50%)
    rotate(45deg);

  transition: transform 180ms ease;
}

.site-navigation__list
  .sub-menu
  li:has(> .sub-menu):hover
  > a,
.site-navigation__list
  .sub-menu
  li:has(> .sub-menu):focus-within
  > a {
  background: rgb(0 171 183 / 12%);

  color: var(--pm-color-primary);
}


/* ==========================================================================
   SEGUNDO NIVEL DESKTOP
   ========================================================================== */

@media (min-width: 901px) {

  .site-navigation__list
    .sub-menu
    li
    > .sub-menu {
    position: absolute;

    top: -7px;
    left: calc(100% - 1px);

    z-index: 2100;

    width: 290px;
    min-width: 290px;

    margin: 0;
    padding: 6px 0;

    overflow: visible;

    border: 1px solid #e4e8ea;
    border-radius: 0 14px 14px 14px;

    background: #fff;

    box-shadow: 0 12px 30px rgb(0 0 0 / 12%);

    list-style: none;

    opacity: 0;
    visibility: hidden;

    pointer-events: none;

    transform: translateX(8px);

    transition:
      opacity 180ms ease,
      visibility 180ms ease,
      transform 180ms ease;
  }

  .site-navigation__list
    .sub-menu
    li:hover
    > .sub-menu,
  .site-navigation__list
    .sub-menu
    li:focus-within
    > .sub-menu {
    opacity: 1;
    visibility: visible;

    pointer-events: auto;

    transform: translateX(0);
  }

}


/* ==========================================================================
   BOTÓN HAMBURGUESA
   ========================================================================== */

.site-navigation-toggle {
  display: none;

  padding: 8px;

  border: 0;

  background: transparent;

  color: var(--pm-color-text);

  cursor: pointer;
}

.site-navigation-toggle__icon {
  font-size: 30px;
  line-height: 1;
}


/* ==========================================================================
   ADMIN BAR WORDPRESS
   ========================================================================== */

.admin-bar .site-header {
  top: 32px;
}

@media screen and (max-width: 782px) {

  .admin-bar .site-header {
    top: 46px;
  }

}


/* ==========================================================================
   TABLET
   ========================================================================== */

@media (max-width: 1200px) {

  .site-header__top-inner {
    grid-template-columns:
      130px
      minmax(0, 1fr)
      auto;
  }

  .site-header__actions {
    gap: 16px;
  }

  .site-header__phone strong {
    font-size: 22px;
  }

  .site-navigation__list {
    gap: 6px;
  }

  .site-navigation__list > li > a {
    padding-inline: 6px;

    font-size: 14px;
  }

}


/* ==========================================================================
   MOBILE
   ========================================================================== */

@media (max-width: 900px) {

  /*
   * En mobile el header permanece sticky.
   * La zona del menú tiene su propio scroll cuando
   * supera el alto disponible de la pantalla.
   */

  .site-header {
    position: sticky;

    top: 0;

    z-index: 1000;

    width: 100%;

    background: #fff;
  }


  /*
   * Ajuste para usuarios logueados en WordPress.
   */

  .admin-bar .site-header {
    top: 46px;
  }


  /* ============================================================
     FILA SUPERIOR MOBILE
     ============================================================ */

  .site-header__top {
    position: relative;

    z-index: 2;

    width: 100%;

    background: #f2fbfc;

    border-bottom: 1px solid #dcebed;
  }

  .site-header__top-inner {
    display: flex;

    min-height: 74px;

    align-items: center;

    gap: 16px;
  }

  .site-header__brand {
    align-self: stretch;
  }

  .site-header__brand .custom-logo {
    max-width: 105px;
    max-height: 62px;
  }

  .site-header__actions {
    display: none;
  }


  /* ============================================================
     HAMBURGUESA
     ============================================================ */

  .site-navigation-toggle {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    margin-left: auto;

    cursor: pointer;
  }


  /* ============================================================
     CONTENEDOR DEL MENÚ MOBILE
     ============================================================ */

  .site-header__navigation {
    position: relative;

    display: none;

    width: 100%;

    /*
     * El menú nunca será más alto que el espacio
     * disponible debajo del logo.
     */

    max-height: calc(100dvh - 74px);

    overflow-x: hidden;
    overflow-y: auto;

    /*
     * Evita que al llegar al final del menú
     * comience inmediatamente a mover la página.
     */

    overscroll-behavior: contain;

    /*
     * Scroll fluido en iOS.
     */

    -webkit-overflow-scrolling: touch;

    background: #fff;

    border-bottom: 1px solid #e7ecee;

    box-shadow: 0 8px 20px rgb(0 0 0 / 8%);
  }


  /* Mostrar menú */

  .site-header__navigation:has(.site-navigation.is-open) {
    display: block;
  }


  /*
   * Si está visible la barra de administración de WordPress,
   * restamos también sus 46px.
   */

  .admin-bar .site-header__navigation {
    max-height: calc(100dvh - 74px - 46px);
  }


  /* ============================================================
     MENÚ PRINCIPAL MOBILE
     ============================================================ */

  .site-navigation {
    width: 100%;
  }

  .site-navigation__list {
    display: block;

    width: 100%;

    margin: 0;

    padding:
      12px
      20px
      24px;

    list-style: none;
  }

  .site-navigation__list > li {
    width: 100%;

    border-bottom: 1px solid #eee;
  }

  .site-navigation__list > li > a {
    display: flex;

    width: 100%;
    min-height: 52px;

    align-items: center;
    justify-content: space-between;

    padding: 10px 4px;

    font-size: 17px;

    white-space: normal;
  }


  /* ============================================================
     PRIMER NIVEL DE SUBMENÚ
     ============================================================ */

  .site-navigation__list > li > .sub-menu {
    position: static;

    display: none;

    width: 100%;
    min-width: 0;

    margin: 0;

    padding:
      0
      0
      12px
      14px;

    overflow: visible;

    border: 0;
    border-radius: 0;

    background: transparent;

    box-shadow: none;

    list-style: none;

    opacity: 1;
    visibility: visible;

    pointer-events: auto;

    transform: none;

    transition: none;
  }


  /* Abrir primer nivel */

  .site-navigation__list
    > .menu-item-has-children.is-open
    > .sub-menu {
    display: block;
  }


  /* Links primer nivel */

  .site-navigation__list
    > li
    > .sub-menu
    > li
    > a {
    display: flex;

    width: 100%;
    min-height: 44px;

    align-items: center;
    justify-content: space-between;

    padding: 10px 4px;

    white-space: normal;
  }


  /* ============================================================
     SEGUNDO NIVEL DE SUBMENÚ
     ============================================================ */

  .site-navigation__list
    .sub-menu
    .menu-item-has-children
    > .sub-menu {
    position: static;

    display: none;

    width: 100%;
    min-width: 0;

    margin: 0;

    padding:
      4px
      0
      10px
      16px;

    overflow: visible;

    border: 0;
    border-radius: 0;

    background: transparent;

    box-shadow: none;

    list-style: none;

    opacity: 1;
    visibility: visible;

    pointer-events: auto;

    transform: none;

    transition: none;
  }


  /* Abrir segundo nivel */

  .site-navigation__list
    .sub-menu
    .menu-item-has-children.is-open
    > .sub-menu {
    display: block;
  }


  /* Links segundo nivel */

  .site-navigation__list
    .sub-menu
    .sub-menu
    li
    > a {
    display: flex;

    width: 100%;
    min-height: 40px;

    align-items: center;

    padding: 8px 4px;

    font-size: 15px;

    white-space: normal;
  }


  /* ============================================================
     FLECHAS MOBILE
     ============================================================ */

  /* Primer nivel */

  .site-navigation__list
    > .menu-item-has-children
    > a::after {
    flex: 0 0 auto;

    margin-right: 4px;
  }


  /* Primer nivel abierto */

  .site-navigation__list
    > .menu-item-has-children.is-open
    > a::after {
    transform: rotate(225deg);
  }


  /* Segundo nivel cerrado */

  .site-navigation__list
    .sub-menu
    .menu-item-has-children
    > a::after {
    top: 50%;
    right: 6px;

    transform:
      translateY(-50%)
      rotate(135deg);
  }


  /* Segundo nivel abierto */

  .site-navigation__list
    .sub-menu
    .menu-item-has-children.is-open
    > a::after {
    transform:
      translateY(-50%)
      rotate(315deg);
  }

}


/* ==========================================================================
   FOOTER
   ========================================================================== */

.site-footer {
  padding: 72px 0 66px;

  border-top: 1px solid #edf1f2;

  background: #fff;
}

.site-footer__grid {
  display: grid;

  grid-template-columns:
    1.25fr
    0.95fr
    0.95fr
    1.1fr;

  gap: 64px;

  align-items: start;
}


/* ==========================================================================
   TITLES
   ========================================================================== */

.site-footer__brand {
  margin: 0 0 18px;

  color: var(--pm-color-primary);

  font-size: 32px;
  font-weight: 700;
  line-height: 1.28;
}

.site-footer__title {
  margin: 0 0 20px;

  color: #444;

  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
}


/* ==========================================================================
   CONTACT
   ========================================================================== */

.site-footer__contact-item {
  margin: 0 0 6px;

  color: #666;

  font-size: 16px;
  line-height: 1.5;
}

.site-footer__contact-item strong {
  color: #666;

  font-weight: 700;
}

.site-footer__contact-item a {
  color: var(--pm-color-primary);

  text-decoration: none;
}

.site-footer__contact-item a:hover {
  text-decoration: underline;
}


/* ==========================================================================
   MENUS
   ========================================================================== */

.site-footer__menu {
  margin: 0;
  padding: 0;

  list-style: none;
}

.site-footer__menu li {
  margin: 0 0 16px;
}

.site-footer__menu a {
  position: relative;

  display: inline-block;

  padding-left: 10px;

  color: #777;

  font-size: 17px;
  line-height: 1.4;

  text-decoration: none;

  transition: color 180ms ease;
}

.site-footer__menu a::before {
  position: absolute;

  top: 0;
  left: 0;

  color: #1686cf;

  content: "›";
}

.site-footer__menu a:hover,
.site-footer__menu a:focus-visible {
  color: var(--pm-color-primary);
}


/* ==========================================================================
   SOCIAL
   ========================================================================== */

.site-footer__social {
  text-align: center;
}

.site-footer__social-links {
  display: flex;

  margin-top: 28px;

  align-items: center;
  justify-content: center;

  gap: 12px;
}

.site-footer__social-link {
  display: flex;

  width: 46px;
  height: 46px;

  flex: 0 0 46px;

  align-items: center;
  justify-content: center;

  border-radius: 50%;

  background: #2997a9;

  color: #fff;

  text-decoration: none;

  transition:
    background-color 180ms ease,
    transform 180ms ease;
}

.site-footer__social-icon {
  display: block;

  width: 24px;
  height: 24px;

  fill: currentColor;
}

.site-footer__social-link:first-child
.site-footer__social-icon {
  width: 25px;
  height: 25px;
}


/* Instagram */

.site-footer__social-link:nth-child(2)
.site-footer__social-icon {
  width: 24px;
  height: 27px;
}

.site-footer__social-link:hover,
.site-footer__social-link:focus-visible {
  background: var(--pm-color-primary);

  color: #fff;

  transform: translateY(-2px);
}


/* ==========================================================================
   FEEDBACK
   ========================================================================== */

.site-footer__feedback {
  display: inline-flex;

  margin-top: 56px;

  align-items: flex-start;
  justify-content: center;

  gap: 8px;

  color: var(--pm-color-primary);

  font-size: 18px;
  line-height: 1.45;

  text-align: center;
  text-decoration: none;
}

.site-footer__feedback-icon {
  display: inline-flex;

  width: 19px;
  height: 19px;

  flex: 0 0 19px;

  margin-top: 3px;

  align-items: center;
  justify-content: center;

  border-radius: 50%;

  background: #444;

  color: #fff;

  font-family: Georgia, serif;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

.site-footer__feedback:hover {
  text-decoration: underline;
}


/* ==========================================================================
   FOOTER TABLET
   ========================================================================== */

@media (max-width: 1050px) {

  .site-footer__grid {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));

    gap: 48px;
  }

  .site-footer__social {
    text-align: left;
  }

  .site-footer__social-links {
    justify-content: flex-start;
  }

  .site-footer__feedback {
    justify-content: flex-start;

    text-align: left;
  }

}


/* ==========================================================================
   FOOTER MOBILE
   ========================================================================== */

@media (max-width: 650px) {

  .site-footer {
    padding: 48px 0;
  }

  .site-footer__grid {
    grid-template-columns: 1fr;

    gap: 38px;
  }

  .site-footer__brand {
    font-size: 27px;
  }

  .site-footer__title {
    margin-bottom: 16px;
  }

  .site-footer__menu li {
    margin-bottom: 12px;
  }

  .site-footer__social {
    text-align: left;
  }

  .site-footer__social-links {
    margin-top: 20px;

    justify-content: flex-start;
  }

  .site-footer__feedback {
    margin-top: 32px;

    justify-content: flex-start;

    text-align: left;
  }

}

.home-intro {
    padding-top: 40px;
    text-align: center;
}

.home-intro__title {
    margin: 0;
    color: #008F99;
    font-size: 24px;
    line-height: 1.2;
}

/* Botón flotante de WhatsApp */
.pm-whatsapp {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #25d366;
    color: #fff;
    box-shadow: 0 4px 16px rgb(0 0 0 / 20%);
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.pm-whatsapp svg {
    display: block;
    width: 30px;
    height: 30px;
    flex-shrink: 0;
}

.pm-whatsapp:hover {
    background: #128c7e;
    color: #fff;
}

.pm-whatsapp:focus-visible {
    outline: 3px solid #075e54;
    outline-offset: 4px;
}

@media (max-width: 767px) {
    .pm-whatsapp {
        right: 16px;
        bottom: calc(16px + env(safe-area-inset-bottom, 0px));
        width: 56px;
        height: 56px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pm-whatsapp {
        transition: none;
    }
}