/* ============================================================
   CLÍNICA ALAR — Global Base Stylesheet
   style.css: Variables, Reset, Nav, Footer, Buttons
   ============================================================ */

/* 1. CSS CUSTOM PROPERTIES */
:root {
  --white: #FFFFFF;
  --black: #1A1A1A;
  --sage: #7A9A7E;
  --sage-dark: #52715A;
  --sage-light: #EEF3EF;
  --taupe: #8C7B6B;
  --taupe-light: #F5F2EF;
  --gray-mid: #5F6471;
  --gray-light: #F8F7F5;
  --border: #E8E4E0;
  --ink-deep: #0A0806;
  --ink-glow: 173, 89, 22;

  --font: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 24px;

  --shadow-sm: 0 1px 4px rgba(0, 0, 0, .06);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, .08);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, .10);

  --max-w: 1140px;
  --section-py: clamp(3rem, 6vw, 6rem);
}

/* 2. RESET */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  color: var(--black);
  background: var(--white);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
picture,
video,
svg {
  display: block;
  max-width: 100%;
}

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

ul,
ol {
  list-style: none;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input,
textarea,
select {
  font: inherit;
}

h1,
h2,
h3,
h4,
h5 {
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -.02em;
}

/* 3. LAYOUT UTILITIES */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}

.section {
  padding-block: var(--section-py);
}

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

/* 4. TYPOGRAPHY HELPERS */
.overline {
  display: inline-block;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--sage-dark);
  margin-bottom: .75rem;
}

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

.text-sage {
  color: var(--sage);
}

.text-taupe {
  color: var(--taupe);
}

.text-mid {
  color: var(--gray-mid);
}

/* 5. BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .8125rem 1.875rem;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  transition: background-color .2s ease, color .2s ease, transform .15s ease, box-shadow .2s ease;
  cursor: pointer;
  border: 2px solid transparent;
  text-decoration: none;
  white-space: nowrap;
}

.btn--primary {
  background: var(--sage-dark);
  color: var(--white);
  border-color: var(--sage-dark);
}

.btn--primary:hover {
  background: #3D5741;
  border-color: #3D5741;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn--outline {
  background: transparent;
  color: var(--sage-dark);
  border-color: var(--sage-dark);
}

.btn--outline:hover {
  background: var(--sage-dark);
  color: var(--white);
  transform: translateY(-1px);
}

.btn--light {
  background: var(--white);
  color: var(--black);
  border-color: var(--white);
}

.btn--light:hover {
  background: var(--sage-light);
  border-color: var(--sage-light);
  transform: translateY(-1px);
}

.btn--lg {
  padding: 1.0625rem 2.375rem;
  font-size: 1rem;
}

.btn--sm {
  padding: .5625rem 1.25rem;
  font-size: 1rem;
}

/* 6. SITE HEADER */
.site-header {
  position: static;
  z-index: 100;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

/* When panel is open: dissolve the stacking context so the panel can
   paint at its own z-index (110) above the overlay (109) */
.site-header.nav-is-open {
  z-index: auto;
}

.nav {
  display: flex;
  align-items: center;
  height: 68px;
  gap: 1.5rem;
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 400;
  letter-spacing: -.015em;
  color: var(--black);
  flex-shrink: 0;
}

.nav__logo-img {
  width: 36px;
  height: auto;
  display: block;
  color: var(--sage);
}

.nav__logo strong {
  color: var(--sage);
  font-weight: 700;
}

.nav__menu {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-left: auto;
}

.nav__menu a {
  font-size: 1rem;
  color: var(--gray-mid);
  transition: color .2s;
}

.nav__menu a:hover {
  color: var(--black);
}

.nav__menu .btn {
  color: var(--white);
}

.nav__cita-mobile { display: inline-flex; order: 3; }

.nav__lang-item { display: flex; align-items: center; }

.nav__lang {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .3rem .7rem;
  border-radius: var(--radius-sm);
  font-size: .8125rem;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--black);
  background: var(--taupe-light);
}

.nav__lang-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

/* Compact language toggle for the tablet/mobile header — hidden on desktop,
   the pill above (.nav__lang) already covers that. See ≤1024px override below. */
.nav__lang-toggle {
  display: none;
}

.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: .5rem;
  border-radius: var(--radius-sm);
  transition: background .2s;
}

.nav__toggle:hover {
  background: var(--gray-light);
}

.nav__toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--black);
  border-radius: 2px;
  transition: transform .25s ease, opacity .25s ease;
}

.nav__toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav__toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.nav__toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Panel is a body child — hidden on desktop, shown only on mobile */
.nav__panel { display: none; }

@media (max-width: 1024px) {
  /* Compact header: logo, language toggle, "Pedir Cita" and hamburger all sized to match */
  .nav__logo { font-size: 1.05rem; gap: .5rem; }
  .nav__logo-img { width: 36px; height: auto; }

  .nav__lang-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    margin-left: auto;
    height: 36px;
    padding-inline: .7rem;
    border-radius: var(--radius-sm);
    font-size: .8125rem;
    font-weight: 700;
    letter-spacing: .02em;
    color: var(--black);
    background: var(--taupe-light);
  }

  .nav__cita-mobile {
    order: 0;
    height: 36px;
    padding-inline: .85rem;
    font-size: .8125rem;
  }
  .nav__toggle { display: flex; }

  /* Hide original nav menu — panel carries its own copy of the links */
  .nav__menu { display: none; }

  /* Language switcher already lives in the persistent header toggle above;
     don't duplicate it inside the off-canvas panel list */
  .nav__panel-links > li.nav__lang-item { display: none; }

  /* Backdrop overlay */
  .nav__overlay {
    position: fixed;
    inset: 0;
    background: rgba(26, 26, 26, .52);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 500;
    opacity: 0;
    pointer-events: none;
    transition: opacity .35s ease;
  }
  .nav__overlay.is-visible {
    opacity: 1;
    pointer-events: auto;
  }

  /* Slide panel — direct body child, no stacking-context parent */
  .nav__panel {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: 82vw;
    max-width: 340px;
    background: var(--white);
    z-index: 510;
    box-shadow: -16px 0 48px rgba(0, 0, 0, .15);
    transform: translateX(100%);
    visibility: hidden;
    transition: transform .4s cubic-bezier(.25, .46, .45, .94), visibility 0s linear .4s;
    overflow-y: auto;
    overflow-x: hidden;
  }
  .nav__panel.is-open {
    transform: translateX(0);
    visibility: visible;
    transition: transform .4s cubic-bezier(.25, .46, .45, .94), visibility 0s;
  }

  /* Panel header */
  .nav__panel-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    padding: 1rem 1.375rem 1.25rem;
    flex-shrink: 0;
  }
  /* The separator doesn't reach the panel edges: it starts where the list
     icons start (list padding + row padding, 1.75rem) leaving the same
     symmetric gap on the other side. */
  .nav__panel-header::after {
    content: '';
    position: absolute;
    left: 1.75rem;
    right: 1.75rem;
    bottom: 0;
    height: 1px;
    background: var(--border);
  }
  .nav__panel-header .nav__logo {
    font-size: 1.1rem;
    white-space: nowrap;
  }
  .nav__panel-header .nav__logo-img { width: 36px; height: auto; }

  /* Close button */
  .nav__close {
    align-self: flex-end;
    margin-bottom: 1.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px; height: 34px;
    border-radius: var(--radius-sm);
    background: var(--sage-light);
    color: var(--sage-dark);
    transition: background .15s, color .15s;
  }
  .nav__close:hover { background: var(--sage); color: var(--white); }

  /* Nav links list inside panel */
  .nav__panel-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: .125rem;
    margin: 0;
    padding: .625rem .75rem;
    flex: 1;
  }

  /* Link styles */
  .nav__panel-links > li > a {
    display: flex;
    align-items: center;
    gap: .875rem;
    padding: .8125rem 1rem;
    border-radius: var(--radius-md);
    font-size: 1.0625rem;
    font-weight: 500;
    color: var(--gray-mid);
    transition: background .15s, color .15s;
  }
  .nav__panel-links > li > a:hover {
    background: var(--gray-light);
    color: var(--black);
  }
  .nav__panel-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 21px;
    height: 21px;
    flex-shrink: 0;
    color: inherit;
  }
  .nav__panel-icon svg {
    width: 100%;
    height: 100%;
  }
  .nav__panel-links > li > a[aria-current="page"] {
    background: var(--sage-light);
    color: var(--sage-dark);
    font-weight: 600;
  }
  .nav__panel-links > li > a[aria-current="page"]:hover {
    background: var(--sage-light);
  }

  /* Panel footer */
  .nav__panel-footer {
    border-top: 1px solid var(--border);
    background: var(--gray-light);
    padding: 1.25rem 1.625rem;
    flex-shrink: 0;
  }
  .nav__panel-footer-label {
    font-size: .6875rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--gray-mid);
    margin-bottom: .75rem;
  }
  .nav__panel-contact-links {
    display: flex;
    flex-direction: column;
    gap: .5625rem;
  }
  .nav__panel-contact-link {
    display: inline-flex;
    align-items: center;
    gap: .5625rem;
    font-size: .9375rem;
    font-weight: 500;
    color: var(--black);
    transition: color .15s;
  }
  .nav__panel-contact-link:hover { color: var(--sage-dark); }
  .nav__panel-contact-link svg {
    width: 15px; height: 15px;
    color: var(--sage-dark);
    flex-shrink: 0;
  }

  /* Language switcher — cloned into the panel as the last nav__menu item */
  .nav__panel-links > li > a.nav__lang {
    gap: .5625rem;
  }
  .nav__panel-links > li > a.nav__lang .nav__lang-icon {
    width: 21px;
    height: 21px;
    color: var(--sage-dark);
  }
  .nav__panel-links > li:has(> a.nav__lang) {
    margin-top: .5rem;
    padding-top: .625rem;
    border-top: 1px solid var(--border);
  }
}

/* Logo pinned left, lang/Pedir Cita/hamburger pinned right as one tight
   trio (margin-left:auto on .nav__lang-toggle, set above, does the
   pinning) — the flexible space between the two blocks is just the
   leftover auto margin, so it already resizes continuously with the
   viewport with no media query needed. `gap` below only controls the
   small constant "pelin" of separation within the right-hand trio. */
@media (max-width: 600px) {
  .nav { gap: .5rem; }
  .nav.container { padding-inline: 0.8rem; }
}

/* Extra-compact header for small phones — below this the trio no longer
   fits at tablet sizes even pinned tight to the right, so shrink it and
   give the logo a safety net: it's the only item allowed to shrink/
   truncate (flex-shrink + ellipsis below); lang toggle, Pedir Cita and
   the hamburger keep flex-shrink:0 so they can never get pushed off-screen. */
@media (max-width: 380px) {
  .nav__logo { flex-shrink: 1; min-width: 0; font-size: 0.9rem; gap: .35rem; }
  .nav__logo-img { width: 30px; flex-shrink: 0; }
  .nav__logo span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .nav.container { padding-inline: 0.8rem; }
  .nav__lang-toggle {
    flex-shrink: 0;
    gap: .25rem;
    padding-inline: .45rem;
    font-size: .7rem;
  }
  .nav__lang-toggle .nav__lang-icon { width: 13px; height: 13px; }

  .nav__cita-mobile { flex-shrink: 0; padding-inline: .55rem; font-size: .7rem; }

  .nav__toggle { flex-shrink: 0; padding: .35rem; gap: 4px; }
  .nav__toggle span { width: 18px; }
}

/* 7. SITE FOOTER */
/* A single warm amber blob, softened with a real filter: blur (not just a
   gradient falloff) low in the block, over a near-black base — reads as a
   dim studio backdrop rather than a flat gradient. isolation: isolate keeps
   the blurred ::before from ever painting over the footer's own content. */
.site-footer {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--ink-deep);
  color: rgba(255, 255, 255, .65);
  padding-block: 2.5rem 2rem;
}
.site-footer::before {
  content: '';
  position: absolute;
  z-index: -1;
  left: 4%;
  bottom: -22%;
  width: 50%;
  height: 65%;
  background: radial-gradient(closest-side, rgba(var(--ink-glow), .45) 0%, rgba(var(--ink-glow), 0) 100%);
  filter: blur(90px);
}

.footer__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.footer__brands {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.5rem;
}

.footer__brand-mark {
  display: flex;
  align-items: center;
  gap: .625rem;
  font-size: 1.0625rem;
  color: var(--white);
  white-space: nowrap;
}

.footer__brand-mark img { width: 28px; height: auto; flex-shrink: 0; }
.footer__brand-mark strong { font-weight: 700; }

.footer__brand-sep {
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, .15);
}

.footer__legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer__legal-links a {
  font-size: .9375rem;
  color: rgba(255, 255, 255, .55);
  transition: color .2s;
}

.footer__legal-links a:hover { color: var(--sage); }

.footer__bottom {
  padding-top: 1.75rem;
  font-size: 1rem;
  color: rgba(255, 255, 255, .5);
  text-align: center;
}

@media (max-width: 600px) {
  .footer__row { flex-direction: column; align-items: stretch; gap: 1.25rem; padding-bottom: 2rem; }
  .footer__brands { justify-content: space-around; gap: clamp(.4rem, 2vw, 1rem); flex-wrap: nowrap; width: 100%; }
  .footer__brand-mark { font-size: clamp(.625rem, 3.2vw, 1.0625rem); gap: clamp(.25rem, 1.2vw, .625rem); }
  .footer__brand-mark img { width: clamp(16px, 5vw, 28px); }
  .footer__legal-links { justify-content: space-around; gap: .75rem; flex-wrap: nowrap; width: 100%; }
  .footer__legal-links a { font-size: clamp(.6875rem, 3.2vw, .9375rem); white-space: nowrap; }
}

/* Tablet: when .footer__row wraps, each line (brands / legal links) would
   size to its own content width and not line up. Switching to a single-
   column grid sizes the track to the wider of the two and stretches the
   other to match. */
@media (min-width: 601px) and (max-width: 862px) {
  .footer__row { display: grid; grid-template-columns: max-content; gap: 1.25rem; }
  .footer__legal-links { justify-content: space-between; }
}

@media (max-width: 1024px) {
  .site-footer { padding-block-start: 1.5rem; }
}

@media (max-width: 600px) {
  .container { padding-inline: 1.75rem; }
  .site-footer { padding-block-start: 1rem; }
}

/* When the CTA banner and the footer sit back to back (wrapped together in
   .footer-wrap), they share one blurred blob instead of each painting its
   own — otherwise it visibly "restarts" at the seam between them. */
.footer-wrap {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--ink-deep);
}
.footer-wrap::before {
  content: '';
  position: absolute;
  z-index: -1;
  left: 4%;
  bottom: -12%;
  width: 46%;
  height: 55%;
  background: radial-gradient(closest-side, rgba(var(--ink-glow), .45) 0%, rgba(var(--ink-glow), 0) 100%);
  filter: blur(90px);
}
.footer-wrap .cta-banner,
.footer-wrap .site-footer {
  background: none;
}
.footer-wrap .site-footer::before {
  content: none;
}

/* 8. INTERNAL PAGE HEADER (shared between inner pages) */
.page-hero {
  background: var(--taupe-light);
  padding-block: clamp(3rem, 5vw, 4.5rem);
  border-bottom: 1px solid var(--border);
}

.page-hero__label {
  display: inline-block;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--sage-dark);
  margin-bottom: .75rem;
}

.page-hero h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  color: var(--black);
  max-width: 20ch;
  margin-bottom: 1rem;
}

.page-hero h1:last-child {
  margin-bottom: 0;
}

.page-hero p:not(.page-hero__label) {
  font-size: clamp(1rem, 1.5vw, 1.125rem);
  color: var(--gray-mid);
  max-width: 55ch;
  text-align: justify;
}

/* 9. BREADCRUMB */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: 1rem;
  color: var(--gray-mid);
  margin-bottom: 1.5rem;
}

.breadcrumb a {
  color: var(--sage-dark);
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb span {
  color: var(--border);
}