/* ==========================================================================
   Inés Trigo Fernández · Psicóloga General Sanitaria en Madrid
   Versión 100% estática fiel al diseño original (sin PHP, sin login, sin CDN)
   ========================================================================== */

body {
  display: grid;
  min-height: 100vh;
  grid-template-rows: auto 1fr auto;
  overflow-x: clip;
}

footer {
  margin-top: auto;
}

/* Cabecera */
.bg-navbar {
  background: #fff8e7;
}

.page-inicio .bg-navbar {
  width: 100%;
  height: auto;
  display: flex;
  flex-direction: column;
  position: relative;
  background: transparent;
}

.page-inicio .bg-navbar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  background: #fff8e7;
  width: 100%;
  height: 100%;
  opacity: 0.8;
}

.bg-navbarI,
.bg-navbarH {
  position: relative;
}

.navbar-nav .nav-link.active,
.navbar-nav .nav-link[aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* Portada */
.bg-body {
  background-image: url(../img/bienvenido.webp);
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center center;
}

.page-inicio .link-color {
  color: #fff8e7;
}

.page-inicio .d-background {
  background: transparent;
}

.d-background {
  background: #fff8e7;
}

/* Quién soy */
.bg-quienSoy {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background-color: #ffc1d5;
  position: relative;
}

.bg-quienSoy::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  background-image: url(../img/despacho.webp);
  background-repeat: no-repeat;
  background-size: 100% 100%;
  background-attachment: fixed;
  width: 100%;
  height: 100%;
  opacity: 0.2;
}

.bg-quienSoyT {
  position: relative;
  height: auto;
  color: #000000;
}

.bg-quienSoyI,
.bg-quienSoyTi {
  position: relative;
}

/* Terapias y formación */
.bg-chico {
  background-image: url(../img/terapias-bg.webp);
  background-repeat: no-repeat;
  background-size: 100% 100%;
  background-attachment: fixed;
}

.bg-ayuda {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
}

.bg-ayuda::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  background-image: url(../img/carta-bg.webp);
  background-repeat: no-repeat;
  background-size: 100% 100%;
  background-attachment: fixed;
  width: 100%;
  height: 100%;
  opacity: 0.2;
}

.bg-ayudaP {
  position: relative;
  width: 100%;
  height: auto;
  color: #000000;
  padding: 10px;
}

.bg-ayudaR {
  position: relative;
}

#apartadoF {
  background-color: rgb(74, 105, 114);
}

#content {
  background-color: rgb(240, 185, 174);
}

#frase {
  font-family: Georgia, 'Times New Roman', serif;
  font-style: italic;
  font-size: 20px;
}

/* Tarifas */
.bg-reloj {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
}

.bg-reloj::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  background-image: url(../img/reloj-bg.webp);
  background-repeat: no-repeat;
  background-size: 100% 100%;
  background-attachment: fixed;
  width: 100%;
  height: 100%;
  opacity: 0.2;
}

.bg-relojT {
  position: relative;
  height: auto;
  color: #000000;
}

.bg-relojTi {
  position: relative;
}

/* Contacto */
.bg-buzon {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
}

.bg-buzon::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  background-image: url(../img/buzon-bg.webp);
  background-repeat: no-repeat;
  background-size: 100% 100%;
  background-attachment: fixed;
  width: 100%;
  height: 100%;
  opacity: 0.2;
}

.bg-buzonR {
  position: relative;
}

.contact-link {
  color: inherit;
  text-decoration: none;
}

.contact-link:hover {
  text-decoration: underline;
}

/* Componentes compartidos fieles al original */
.remove-bg {
  filter: brightness(1.1);
  mix-blend-mode: multiply;
}

.btn-rp {
  background-color: #ffc1d5 !important;
  color: #000000 !important;
  border-color: transparent !important;
}

.btn-rp:hover,
.btn-rp:focus-visible {
  background-color: #f7acc5 !important;
  color: #000000 !important;
}

.bg-tr {
  background-color: #fff8e7;
}

.bg-rs {
  background-color: #ffc1d5;
}

/* Pie de página limpio (sin logos de Kit Digital) */
.footer-legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.9rem;
  justify-content: flex-start;
  align-items: center;
}

@media (min-width: 768px) {
  .footer-legal-links {
    justify-content: center;
  }
}

.footer-legal-links a {
  text-decoration: none;
  font-size: 0.95rem;
}

.footer-legal-links a:hover {
  text-decoration: underline;
}

.footer-social-icons {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.footer-social-icons img {
  width: 30px;
  height: 30px;
  display: block;
}

.footer-contact-info {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  justify-content: center;
  align-items: center;
}

.footer-contact-info a {
  color: inherit;
  text-decoration: none;
}

.footer-contact-info a:hover {
  text-decoration: underline;
}

/* Botón flotante de WhatsApp (misma posición/tamaño visual, sin overflow-x) */
.btn-whatsapp-float {
  position: fixed;
  right: 18px;
  bottom: 14px;
  z-index: 1030;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: block;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.22);
  transition: transform 0.2s ease;
}

.btn-whatsapp-float:hover {
  transform: scale(1.06);
}

.btn-whatsapp-float img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

/* Páginas legales y bloque institucional Kit Digital (EXCLUSIVO en legales) */
.legal-container {
  max-width: 1040px;
}

.legal-card {
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  padding: clamp(1.25rem, 3vw, 2.25rem);
}

.legal-nav-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.legal-nav-pills a {
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: #fff8e7;
  color: #212529;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

.legal-nav-pills a[aria-current="page"] {
  background: #212529;
  color: #fff8e7;
  border-color: #212529;
}

.kit-digital-box {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 12px;
  padding: 1.5rem;
  margin-top: 2rem;
}

.kit-digital-box h2 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.kit-digital-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  gap: 1.15rem 1.5rem;
  align-items: center;
  justify-items: center;
  margin-top: 1.25rem;
}

.kit-digital-grid img {
  max-height: 54px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

/* En móviles iOS/Android, background-attachment: fixed puede distorsionar el fondo */
@media (max-width: 767.98px) {
  footer.d-background {
    padding-right: 76px;
  }

  .bg-quienSoy::before,
  .bg-reloj::before,
  .bg-chico,
  .bg-ayuda::before,
  .bg-buzon::before {
    background-attachment: scroll;
    background-size: cover;
    background-position: center;
  }
}
