/* ============================================================
   Clínica Dental ROE — Editorial premium, gris y blanco
   ============================================================ */

:root {
  --ink:        #17191c;   /* casi negro / charcoal del logo */
  --graphite:   #26292e;
  --slate:      #4a4f57;
  --steel:      #71767e;
  --silver:     #a7acb3;
  --mist:       #d9dbde;
  --cloud:      #eceded;
  --porcelain:  #f6f6f5;
  --paper:      #fbfbfa;
  --white:      #ffffff;

  --accent:     #17191c;   /* acento marcado = tinta profunda */
  --accent-line:#b8bcc2;   /* hairline metálico */

  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans:  'Karla', system-ui, sans-serif;

  --maxw: 1240px;
  --gap: clamp(1.5rem, 4vw, 4rem);
  --radius: 2px;
  --shadow-soft: 0 18px 50px -24px rgba(23,25,28,0.35);
  --shadow-deep: 0 40px 90px -40px rgba(23,25,28,0.55);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.08; letter-spacing: -0.01em; }

::selection { background: var(--ink); color: var(--white); }

/* ---------- Reusables ---------- */
.eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--steel);
  font-weight: 600;
  margin-bottom: 1.1rem;
}
.eyebrow-light { color: var(--silver); }

.section { padding: clamp(4.5rem, 9vw, 8.5rem) var(--gap); max-width: var(--maxw); margin: 0 auto; }

.section-head { max-width: 640px; margin-bottom: clamp(2.5rem, 5vw, 4.5rem); }
.section-title { font-size: clamp(2.1rem, 5vw, 3.6rem); color: var(--ink); }
.section-title em { font-style: italic; color: var(--slate); }
.section-intro { margin-top: 1.4rem; color: var(--slate); font-size: 1.08rem; max-width: 60ch; }

/* Buttons */
.btn-cta {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  background: var(--ink); color: var(--white);
  font-family: var(--sans); font-weight: 600; font-size: 0.9rem;
  letter-spacing: 0.04em;
  padding: 0.95rem 1.9rem;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  cursor: pointer;
  isolation: isolate;
  position: relative; overflow: hidden;
  transition: color .5s var(--ease), transform .4s var(--ease);
}
.btn-cta::after {
  content: ""; position: absolute; inset: 0;
  background: var(--white);
  transform: translateY(101%);
  transition: transform .5s var(--ease);
  z-index: -1;
}
.btn-cta:hover { color: var(--ink); transform: translateY(-2px); }
.btn-cta:hover::after { transform: translateY(0); }

.btn-cta-invert { background: var(--white); color: var(--ink); border-color: var(--white); }
.btn-cta-invert::after { background: var(--ink); }
.btn-cta-invert:hover { color: var(--white); }

.btn-ghost {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--sans); font-weight: 600; font-size: 0.9rem;
  letter-spacing: 0.04em;
  color: var(--ink);
  padding: 0.9rem 0.2rem;
  border-bottom: 1px solid var(--accent-line);
  transition: border-color .3s var(--ease);
}
.btn-ghost::after { content: "→"; transition: transform .3s var(--ease); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-ghost:hover::after { transform: translateX(6px); }
.btn-ghost-light { color: var(--white); border-color: rgba(255,255,255,.4); }
.btn-ghost-light:hover { border-color: var(--white); }

.btn-block { width: 100%; }

/* Reveal animation */
.reveal { opacity: 0; transform: translateY(34px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: var(--graphite);
  transition: background .4s var(--ease), box-shadow .4s var(--ease), padding .4s var(--ease);
  padding: 0.5rem 0;
}
.site-header.scrolled {
  background: rgba(38,41,46,0.92);
  backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 rgba(255,255,255,0.08);
}
.header-inner {
  max-width: var(--maxw); margin: 0 auto;
  padding: 0.8rem var(--gap);
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
}
.brand { display: flex; align-items: center; gap: 0.7rem; }
.brand-logo { width: auto; height: auto; max-height: 80px; object-fit: contain; }

.main-nav { display: flex; gap: 2rem; }
.main-nav a {
  font-size: 0.85rem; font-weight: 500; letter-spacing: 0.02em; color: var(--silver);
  position: relative; padding: 4px 0;
  transition: color .3s var(--ease);
}
.main-nav a::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 0; height: 1px; background: var(--white);
  transition: width .35s var(--ease);
}
.main-nav a:hover { color: var(--white); }
.main-nav a:hover::after { width: 100%; }

.header-cta { padding: 0.7rem 1.4rem; font-size: 0.82rem; background: var(--white); color: var(--ink); border-color: var(--white); }
.header-cta::after { background: var(--graphite); }
.header-cta:hover { color: var(--white); }

.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 8px; }
.nav-toggle span { width: 26px; height: 2px; background: var(--white); transition: transform .3s var(--ease), opacity .3s var(--ease); }
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav { display: none; flex-direction: column; padding: 0 var(--gap); background: rgba(38,41,46,0.98); backdrop-filter: blur(14px); overflow: hidden; max-height: 0; transition: max-height .45s var(--ease); }
.mobile-nav.open { max-height: 460px; padding-bottom: 1.5rem; box-shadow: 0 1px 0 rgba(255,255,255,0.08); }
.mobile-nav a { padding: 0.85rem 0; border-bottom: 1px solid rgba(255,255,255,0.1); font-size: 0.95rem; color: var(--silver); }
.mobile-cta { border: none !important; margin-top: 1rem; background: var(--white) !important; color: var(--ink) !important; }
.mobile-cta::after { background: var(--graphite); }

/* ============================================================
   HERO
   ============================================================ */
.hero { position: relative; padding-top: clamp(7rem, 12vw, 9rem); overflow: hidden; }
.hero-grid {
  max-width: var(--maxw); margin: 0 auto;
  padding: 0 var(--gap);
  display: grid; grid-template-columns: 40% 60%;
  align-items: center; gap: clamp(1.5rem, 4vw, 3.5rem);
  min-height: 80vh;
}
.hero-copy { padding: clamp(1rem, 3vw, 2rem) 0; z-index: 2; }
.hero-title { font-size: clamp(2.8rem, 6.5vw, 5.2rem); color: var(--ink); margin-bottom: 1.6rem; }
.hero-title em { font-style: italic; color: var(--slate); }
.hero-lead { color: var(--slate); font-size: 1.12rem; max-width: 46ch; margin-bottom: 2.2rem; }
.hero-lead strong { color: var(--ink); font-weight: 600; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1.4rem; margin-bottom: 3rem; }

.hero-meta { display: flex; align-items: center; gap: 1.8rem; }
.hero-meta > div { display: flex; flex-direction: column; }
.hero-meta-num { font-family: var(--serif); font-size: 1.9rem; font-weight: 600; color: var(--ink); line-height: 1; }
.hero-meta-label { font-size: 0.78rem; color: var(--steel); letter-spacing: 0.02em; margin-top: 4px; }
.hero-meta-divider { width: 1px; height: 46px; background: var(--mist); }

.hero-media { position: relative; z-index: 1; }
.hero-figure {
  position: relative;
  clip-path: polygon(12% 0, 100% 0, 100% 100%, 0 100%);
  box-shadow: var(--shadow-deep);
  overflow: hidden;
}
.hero-figure img { width: 100%; height: clamp(420px, 62vh, 640px); object-fit: cover; filter: grayscale(0.15) contrast(1.02); transform: scale(1.02); }
.hero-badge {
  position: absolute; left: 14%; bottom: 1.8rem;
  background: rgba(23,25,28,0.86); backdrop-filter: blur(6px);
  color: var(--white); font-family: var(--serif); font-size: 1.2rem; font-style: italic;
  padding: 0.7rem 1.4rem; display: flex; align-items: center; gap: 0.6rem;
  letter-spacing: 0.02em;
}
.hero-badge-star { font-style: normal; color: var(--silver); }
.hero-accent {
  position: absolute; top: -6%; left: -4%; width: 44%; height: 44%;
  border: 1px solid var(--accent-line);
  z-index: -1;
}

.hero-marquee { margin-top: clamp(3rem, 6vw, 5rem); border-top: 1px solid var(--cloud); border-bottom: 1px solid var(--cloud); padding: 1rem 0; overflow: hidden; }
.marquee-track { display: flex; gap: 2rem; white-space: nowrap; animation: marquee 32s linear infinite; }
.marquee-track span { font-family: var(--serif); font-style: italic; font-size: 1.5rem; color: var(--silver); }
.marquee-track span:nth-child(even) { color: var(--mist); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ============================================================
   SERVICIOS
   ============================================================ */
.services { padding-top: clamp(4rem, 7vw, 6rem); }

.service-feature {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
  background: var(--ink); color: var(--white);
  border-radius: var(--radius); overflow: hidden;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
  box-shadow: var(--shadow-deep);
}
.service-feature-media { position: relative; min-height: 380px; }
.service-feature-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: grayscale(0.2); }
.service-feature-body { padding: clamp(2.2rem, 5vw, 4rem); display: flex; flex-direction: column; align-items: flex-start; }
.badge-star {
  display: inline-block; font-size: 0.7rem; letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--ink); background: var(--white); padding: 0.4rem 0.9rem; margin-bottom: 1.6rem; font-weight: 700;
}
.service-feature-icon { width: 68px; height: 68px; color: var(--white); margin-bottom: 1.2rem; }
.service-feature-icon svg { width: 100%; height: 100%; }
.service-feature h3 { font-size: clamp(2rem, 4vw, 3rem); margin-bottom: 1rem; }
.service-feature p { color: var(--silver); margin-bottom: 2rem; max-width: 42ch; }
.service-feature .btn-cta { background: var(--white); color: var(--ink); border-color: var(--white); }
.service-feature .btn-cta::after { background: var(--slate); }
.service-feature .btn-cta:hover { color: var(--white); }

.service-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--cloud); border: 1px solid var(--cloud); }
.service-card {
  background: var(--paper);
  padding: clamp(1.8rem, 3vw, 2.6rem);
  transition: background .5s var(--ease), transform .5s var(--ease);
  position: relative;
}
.service-card::before {
  content: ""; position: absolute; left: 0; top: 0; width: 100%; height: 2px; background: var(--ink);
  transform: scaleX(0); transform-origin: left; transition: transform .5s var(--ease);
}
.service-card:hover { background: var(--white); }
.service-card:hover::before { transform: scaleX(1); }
.service-icon { width: 52px; height: 52px; color: var(--slate); margin-bottom: 1.3rem; transition: color .4s var(--ease), transform .5s var(--ease); }
.service-icon svg { width: 100%; height: 100%; }
.service-card:hover .service-icon { color: var(--ink); transform: translateY(-3px); }
.service-card h3 { font-size: 1.55rem; margin-bottom: 0.6rem; color: var(--ink); }
.service-card p { font-size: 0.96rem; color: var(--slate); }

/* ============================================================
   NOSOTROS
   ============================================================ */
.about { }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2.5rem, 6vw, 5rem); align-items: center; }
.about-media { position: relative; }
.about-figure { position: relative; z-index: 2; box-shadow: var(--shadow-deep); overflow: hidden; clip-path: polygon(0 0, 100% 0, 100% 88%, 0 100%); }
.about-figure img { width: 100%; height: clamp(420px, 55vh, 600px); object-fit: cover; filter: grayscale(0.1); }
.about-figure-2 {
  position: absolute; right: -8%; bottom: -14%; width: 46%; z-index: 3;
  box-shadow: var(--shadow-deep); overflow: hidden; border: 6px solid var(--paper);
}
.about-figure-2 img { width: 100%; height: 200px; object-fit: cover; filter: grayscale(0.25); }
.about-accent { position: absolute; left: -6%; top: -8%; width: 40%; height: 40%; border: 1px solid var(--accent-line); z-index: 1; }

.about-copy p { color: var(--slate); margin-bottom: 1.2rem; font-size: 1.05rem; }
.about-copy strong { color: var(--ink); font-weight: 600; }
.credential {
  display: flex; align-items: center; gap: 1rem; margin: 2rem 0;
  padding: 1.2rem 1.4rem; background: var(--porcelain); border-left: 2px solid var(--ink);
}
.credential-icon { width: 40px; height: 40px; color: var(--ink); flex-shrink: 0; }
.credential-icon svg { width: 100%; height: 100%; }
.credential-name { display: block; font-family: var(--serif); font-size: 1.35rem; font-weight: 600; color: var(--ink); line-height: 1.2; }
.credential-detail { display: block; font-size: 0.85rem; color: var(--steel); letter-spacing: 0.04em; }

/* ============================================================
   TESTIMONIOS
   ============================================================ */
.testimonials { background: linear-gradient(180deg, var(--porcelain), var(--paper)); max-width: none; }
.testimonials > .section-head, .testimonials > .testi-grid { max-width: var(--maxw); margin-left: auto; margin-right: auto; }
.testi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
.testi-card {
  background: var(--white); padding: 2.2rem; border: 1px solid var(--cloud);
  display: flex; flex-direction: column;
  transition: transform .5s var(--ease), box-shadow .5s var(--ease);
}
.testi-card:nth-child(4) { grid-column: span 1; }
.testi-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-soft); }
.stars { color: var(--ink); letter-spacing: 3px; font-size: 1rem; margin-bottom: 1.2rem; }
.testi-card blockquote { font-family: var(--serif); font-size: 1.28rem; font-style: italic; color: var(--graphite); line-height: 1.45; margin-bottom: 1.6rem; }
.testi-card figcaption { margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--cloud); }
.testi-name { display: block; font-weight: 700; font-size: 0.95rem; color: var(--ink); }
.testi-role { display: block; font-size: 0.8rem; color: var(--steel); letter-spacing: 0.04em; margin-top: 2px; }

/* ============================================================
   GALERIA
   ============================================================ */
.gallery-grid { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 210px; gap: 12px; }
.gallery-item {
  position: relative; overflow: hidden; cursor: pointer; border: none; padding: 0;
  background: var(--cloud); border-radius: var(--radius);
}
.gallery-item img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(0.15); transition: transform .8s var(--ease), filter .6s var(--ease); }
.gallery-item::after {
  content: "⤢"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--white); font-size: 1.6rem; background: rgba(23,25,28,0); opacity: 0;
  transition: background .5s var(--ease), opacity .5s var(--ease);
}
.gallery-item:hover img { transform: scale(1.08); filter: grayscale(0); }
.gallery-item:hover::after { background: rgba(23,25,28,0.32); opacity: 1; }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(17,19,22,0.94); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .4s var(--ease);
}
.lightbox.open { opacity: 1; pointer-events: auto; }
.lb-figure { max-width: 86vw; max-height: 84vh; }
.lb-figure img { max-width: 86vw; max-height: 84vh; object-fit: contain; box-shadow: var(--shadow-deep); }
.lb-close, .lb-nav {
  position: absolute; background: none; border: none; color: var(--white); cursor: pointer;
  font-size: 2.4rem; line-height: 1; width: 60px; height: 60px; display: flex; align-items: center; justify-content: center;
  transition: transform .3s var(--ease), opacity .3s var(--ease); opacity: 0.75;
}
.lb-close:hover, .lb-nav:hover { opacity: 1; transform: scale(1.12); }
.lb-close { top: 1.5rem; right: 1.8rem; font-size: 2.6rem; }
.lb-nav { top: 50%; transform: translateY(-50%); font-size: 3.4rem; }
.lb-prev { left: 1rem; }
.lb-next { right: 1rem; }
.lb-nav:hover { transform: translateY(-50%) scale(1.12); }

/* ============================================================
   FAQ
   ============================================================ */
.faq-list { max-width: 820px; }
.faq-item { border-bottom: 1px solid var(--mist); }
.faq-item summary {
  list-style: none; cursor: pointer; padding: 1.5rem 3rem 1.5rem 0; position: relative;
  font-family: var(--serif); font-size: clamp(1.25rem, 2.5vw, 1.7rem); font-weight: 600; color: var(--ink);
  transition: color .3s var(--ease);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  font-family: var(--sans); font-size: 1.6rem; font-weight: 300; color: var(--steel); transition: transform .4s var(--ease);
}
.faq-item[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq-item summary:hover { color: var(--slate); }
.faq-item p { padding: 0 3rem 1.6rem 0; color: var(--slate); font-size: 1.02rem; max-width: 64ch; }

/* ============================================================
   CTA BAND
   ============================================================ */
.cta-band {
  background: var(--ink); color: var(--white); position: relative; overflow: hidden;
  padding: clamp(4.5rem, 9vw, 8rem) var(--gap);
}
.cta-band::before {
  content: ""; position: absolute; right: -10%; top: -30%; width: 55%; height: 160%;
  background: radial-gradient(circle at center, rgba(255,255,255,0.05), transparent 68%);
}
.cta-inner { max-width: 760px; margin: 0 auto; text-align: center; position: relative; }
.cta-title { font-size: clamp(2.2rem, 5vw, 3.8rem); margin-bottom: 1.4rem; }
.cta-text { color: var(--silver); font-size: 1.1rem; max-width: 54ch; margin: 0 auto 2.4rem; }
.cta-actions { display: flex; flex-wrap: wrap; gap: 1.4rem; justify-content: center; align-items: center; }

/* ============================================================
   CONTACTO
   ============================================================ */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2.5rem, 6vw, 5rem); align-items: start; }
.contact-details { list-style: none; margin-top: 2rem; display: flex; flex-direction: column; gap: 1.3rem; }
.contact-details li { display: flex; align-items: flex-start; gap: 1rem; color: var(--slate); font-size: 1rem; }
.contact-details a:hover { color: var(--ink); text-decoration: underline; }
.contact-ico { width: 40px; height: 40px; flex-shrink: 0; border: 1px solid var(--mist); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--ink); }
.contact-ico svg { width: 20px; height: 20px; }

.contact-form { background: var(--white); border: 1px solid var(--cloud); padding: clamp(1.8rem, 4vw, 2.8rem); box-shadow: var(--shadow-soft); }
.field { margin-bottom: 1.3rem; }
.field label { display: block; font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--steel); font-weight: 600; margin-bottom: 0.5rem; }
.field input, .field select, .field textarea {
  width: 100%; font-family: var(--sans); font-size: 1rem; color: var(--ink);
  padding: 0.85rem 1rem; border: 1px solid var(--mist); border-radius: var(--radius);
  background: var(--paper); transition: border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(23,25,28,0.06);
}
.field textarea { resize: vertical; }
.form-note { font-size: 0.8rem; color: var(--steel); margin-top: 1rem; text-align: center; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer { background: var(--ink); color: var(--silver); padding: clamp(3.5rem, 6vw, 5.5rem) var(--gap) 2rem; }
.footer-grid { max-width: var(--maxw); margin: 0 auto; display: grid; grid-template-columns: 1.6fr 1fr 1.2fr 1.6fr; gap: clamp(2rem, 4vw, 3.5rem); }
.footer-logo { width: 56px; height: 56px; border-radius: 4px; margin-bottom: 1.2rem; }
.footer-tag { font-size: 0.95rem; color: var(--silver); max-width: 32ch; margin-bottom: 1.5rem; }
.footer-social { display: flex; gap: 0.8rem; }
.footer-social a { width: 42px; height: 42px; border: 1px solid rgba(255,255,255,0.16); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--silver); transition: background .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease); }
.footer-social a svg { width: 20px; height: 20px; }
.footer-social a:hover { background: var(--white); color: var(--ink); border-color: var(--white); }

.footer-col h3, .footer-map h3 { font-family: var(--serif); font-size: 1.3rem; color: var(--white); font-weight: 600; margin-bottom: 1.2rem; }
.footer-col a, .footer-col p { display: block; font-size: 0.92rem; color: var(--silver); margin-bottom: 0.7rem; transition: color .3s var(--ease); }
.footer-col a:hover { color: var(--white); }
.footer-hours { margin-top: 1rem; }
.footer-hours strong { color: var(--white); }
.footer-map iframe { border-radius: var(--radius); filter: grayscale(0.4) contrast(1.05); }

.footer-bottom { max-width: var(--maxw); margin: 2.5rem auto 0; padding-top: 1.8rem; border-top: 1px solid rgba(255,255,255,0.1); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.6rem; font-size: 0.8rem; color: var(--steel); }

/* ============================================================
   CHAT WIDGET — Ayuda Activa
   ============================================================ */
.chat-widget { position: fixed; right: clamp(1rem, 3vw, 2rem); bottom: clamp(1rem, 3vw, 2rem); z-index: 150; }

.chat-toggle {
  width: 64px; height: 64px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--ink); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-deep); position: relative; margin-left: auto;
  transition: transform .4s var(--ease);
}
.chat-toggle svg { width: 28px; height: 28px; transition: opacity .3s var(--ease), transform .3s var(--ease); }
.chat-toggle .chat-ico-close { position: absolute; opacity: 0; transform: rotate(-90deg) scale(.6); }
.chat-widget.open .chat-ico-open { opacity: 0; transform: rotate(90deg) scale(.6); }
.chat-widget.open .chat-ico-close { opacity: 1; transform: rotate(0) scale(1); }
.chat-toggle:hover { transform: scale(1.06); }

/* Pulso: SOLO transform + opacity (animación compuesta) */
.chat-widget:not(.open) .chat-toggle::before,
.chat-widget:not(.open) .chat-toggle::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid var(--ink); opacity: 0;
  animation: pulseRing 2.4s var(--ease) infinite;
}
.chat-widget:not(.open) .chat-toggle::after { animation-delay: 1.2s; }
@keyframes pulseRing {
  0%   { transform: scale(1); opacity: 0.55; }
  100% { transform: scale(2); opacity: 0; }
}

.chat-tooltip {
  position: absolute; right: 78px; bottom: 16px; white-space: nowrap;
  background: var(--white); color: var(--ink); font-size: 0.85rem; font-weight: 500;
  padding: 0.6rem 1rem; border-radius: var(--radius);
  box-shadow: var(--shadow-soft); border: 1px solid var(--cloud);
  opacity: 0; transform: translateX(10px); pointer-events: none;
  transition: opacity .4s var(--ease), transform .4s var(--ease);
}
.chat-tooltip::after { content: ""; position: absolute; right: -6px; bottom: 18px; width: 12px; height: 12px; background: var(--white); border-right: 1px solid var(--cloud); border-bottom: 1px solid var(--cloud); transform: rotate(-45deg); }
.chat-widget:not(.open) .chat-tooltip.show { opacity: 1; transform: translateX(0); animation: floatBubble 3s ease-in-out infinite; }
@keyframes floatBubble { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

.chat-panel {
  position: absolute; right: 0; bottom: 80px;
  width: min(380px, calc(100vw - 2rem)); height: min(560px, calc(100vh - 120px));
  background: var(--paper); border-radius: 10px; overflow: hidden;
  box-shadow: var(--shadow-deep); border: 1px solid var(--cloud);
  display: flex; flex-direction: column;
  opacity: 0; transform: translateY(20px) scale(.96); transform-origin: bottom right;
  pointer-events: none; transition: opacity .4s var(--ease), transform .4s var(--ease);
}
.chat-widget.open .chat-panel { opacity: 1; transform: none; pointer-events: auto; }

.chat-header { background: var(--ink); color: var(--white); padding: 1rem 1.2rem; display: flex; align-items: center; justify-content: space-between; }
.chat-header-brand { display: flex; align-items: center; gap: 0.75rem; }
.chat-avatar { width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,0.1); display: flex; align-items: center; justify-content: center; color: var(--white); }
.chat-avatar svg { width: 22px; height: 22px; }
.chat-title { display: block; font-family: var(--serif); font-size: 1.3rem; font-weight: 600; line-height: 1.1; }
.chat-status { display: flex; align-items: center; gap: 5px; font-size: 0.72rem; color: var(--silver); }
.chat-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #6fce9f; }
.chat-min { background: none; border: none; color: var(--silver); font-size: 1.6rem; cursor: pointer; line-height: 1; transition: color .3s var(--ease); }
.chat-min:hover { color: var(--white); }

.chat-messages { flex: 1; overflow-y: auto; padding: 1.2rem; display: flex; flex-direction: column; gap: 0.9rem; }
.chat-messages::-webkit-scrollbar { width: 6px; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--mist); border-radius: 3px; }
.msg { max-width: 82%; padding: 0.7rem 1rem; font-size: 0.92rem; line-height: 1.5; border-radius: 14px; animation: msgIn .4s var(--ease); }
@keyframes msgIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.msg a { color: inherit; text-decoration: underline; font-weight: 600; }
.msg-bot { align-self: flex-start; background: var(--white); color: var(--graphite); border: 1px solid var(--cloud); border-bottom-left-radius: 4px; }
.msg-user { align-self: flex-end; background: var(--ink); color: var(--white); border-bottom-right-radius: 4px; }
.msg-typing { align-self: flex-start; background: var(--white); border: 1px solid var(--cloud); display: flex; gap: 4px; padding: 0.9rem 1rem; border-bottom-left-radius: 4px; }
.msg-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--silver); animation: typing 1.2s infinite; }
.msg-typing span:nth-child(2) { animation-delay: .2s; }
.msg-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes typing { 0%,60%,100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-5px); opacity: 1; } }

.chat-input { display: flex; gap: 0.5rem; padding: 0.8rem; border-top: 1px solid var(--cloud); background: var(--white); }
.chat-input input { flex: 1; border: 1px solid var(--mist); border-radius: 20px; padding: 0.7rem 1rem; font-family: var(--sans); font-size: 0.92rem; outline: none; transition: border-color .3s var(--ease); }
.chat-input input:focus { border-color: var(--ink); }
.chat-input button { width: 44px; height: 44px; border-radius: 50%; border: none; background: var(--ink); color: var(--white); cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: transform .3s var(--ease); }
.chat-input button svg { width: 20px; height: 20px; }
.chat-input button:hover { transform: scale(1.08) rotate(8deg); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .main-nav, .header-cta { display: none; }
  .nav-toggle { display: flex; }
  .mobile-nav { display: flex; }
  .hero-grid { grid-template-columns: 1fr; min-height: auto; gap: 2.5rem; }
  .hero-media { order: -1; }
  .hero-figure { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
  .hero-badge { left: 1.5rem; }
  .service-grid { grid-template-columns: repeat(2, 1fr); }
  .service-feature { grid-template-columns: 1fr; }
  .service-feature-media { min-height: 260px; }
  .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .about-figure-2 { position: relative; right: 0; bottom: 0; width: 60%; margin: -2rem auto 0; }
  .testi-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-map { grid-column: span 2; }
}

@media (max-width: 620px) {
  :root { --gap: 1.3rem; }
  .hero-title { font-size: clamp(2.4rem, 11vw, 3.4rem); }
  .hero-meta { flex-wrap: wrap; gap: 1.2rem; }
  .service-grid { grid-template-columns: 1fr; }
  .testi-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 150px; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-map { grid-column: span 1; }
  .footer-bottom { flex-direction: column; }
  .cta-actions, .hero-actions { flex-direction: column; align-items: stretch; }
  .cta-actions .btn-ghost, .hero-actions .btn-ghost { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
