/* ============================================================
   REGENERA — ESPACIO DE SALUD & BIENESTAR
   Brand Design System
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400&family=Jost:wght@300;400;500;600&family=Cormorant:ital,wght@1,300&display=swap');

/* ── CSS Variables (Brand Colors) ─────────────────────────── */
:root {
  --blanco-calido:  #F4F1EE;
  --verde-oceano:   #326364;
  --verde-agua:     #579898;
  --gris-calido:    #CFCDCA;
  --warm-taupe:     #AE9A88;
  --marron-oscuro:  #3B2E27;

  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'Jost', sans-serif;

  --nav-h: 80px;
  --max-w: 1240px;
  --radius: 2px;
  --transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-body);
  background: var(--blanco-calido);
  color: var(--marron-oscuro);
  line-height: 1.7;
  overflow-x: hidden;
}

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

/* ── Typography ───────────────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.8rem, 6vw, 5.5rem); }
h2 { font-size: clamp(2rem,  4vw, 3.5rem); }
h3 { font-size: clamp(1.4rem, 2.5vw, 2rem); }
h4 { font-size: 1.25rem; }

p {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 1rem;
  line-height: 1.8;
}

.eyebrow {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--verde-agua);
}

/* ── Layout ───────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: clamp(1.5rem, 5vw, 4rem);
}

section { padding-block: clamp(4rem, 8vw, 8rem); }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 2.2rem;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: currentColor;
  opacity: 0;
  transition: opacity 0.2s;
}
.btn:hover::after { opacity: 0.06; }

.btn-primary {
  background: var(--warm-taupe);
  color: #fff;
  border-color: var(--warm-taupe);
}
.btn-primary:hover {
  background: #9a8878;
  border-color: #9a8878;
}

.btn-outline {
  background: transparent;
  color: #fff;
  border-color: rgba(255,255,255,0.6);
}
.btn-outline:hover {
  background: rgba(255,255,255,0.1);
  border-color: #fff;
}

.btn-teal {
  background: var(--verde-oceano);
  color: #fff;
  border-color: var(--verde-oceano);
}
.btn-teal:hover { background: #265051; }

.btn-ghost {
  background: transparent;
  color: var(--verde-oceano);
  border-color: var(--verde-oceano);
}
.btn-ghost:hover {
  background: var(--verde-oceano);
  color: #fff;
}

/* ── Navigation ───────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 900;
  transition: background var(--transition), box-shadow var(--transition);
}

.nav.scrolled {
  background: var(--verde-oceano);
  box-shadow: 0 2px 30px rgba(50,99,100,0.25);
}

.nav-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-logo svg { width: 36px; height: 36px; }

.nav-logo-text {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: #fff;
}

.nav-logo-sub {
  font-family: var(--font-body);
  font-size: 0.55rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  display: block;
  margin-top: -2px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  list-style: none;
}

.nav-links a {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
  transition: color var(--transition);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0;
  width: 0; height: 1px;
  background: var(--warm-taupe);
  transition: width var(--transition);
}

.nav-links a:hover,
.nav-links a.active { color: #fff; }
.nav-links a:hover::after,
.nav-links a.active::after { width: 100%; }

.nav-cta {
  background: var(--warm-taupe);
  color: #fff !important;
  padding: 0.5rem 1.2rem;
  font-size: 0.7rem !important;
  letter-spacing: 0.15em !important;
  transition: background var(--transition) !important;
}
.nav-cta:hover { background: #9a8878 !important; }
.nav-cta::after { display: none !important; }

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 24px; height: 1.5px;
  background: #fff;
  transition: var(--transition);
}

/* ── Footer ───────────────────────────────────────────────── */
footer {
  background: var(--verde-oceano);
  color: #fff;
  padding-block: 4rem 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-brand-logo {
  margin-bottom: 1rem;
}

.footer-brand p {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.65);
  max-width: 260px;
  line-height: 1.7;
}

.footer-title {
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--warm-taupe);
  margin-bottom: 1.25rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-links a {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.7);
  transition: color var(--transition);
}
.footer-links a:hover { color: #fff; }

.footer-contact p {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.7);
  margin-bottom: 0.4rem;
}

.footer-social {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.footer-social a {
  width: 36px; height: 36px;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  color: rgba(255,255,255,0.7);
  transition: var(--transition);
}
.footer-social a:hover {
  border-color: var(--warm-taupe);
  color: var(--warm-taupe);
  background: rgba(174,154,136,0.1);
}

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

.footer-bottom p {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.45);
}

/* ── WhatsApp float ───────────────────────────────────────── */
.whatsapp-float {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 56px; height: 56px;
  background: #25D366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 800;
  box-shadow: 0 4px 20px rgba(37,211,102,0.4);
  transition: transform var(--transition), box-shadow var(--transition);
}
.whatsapp-float:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(37,211,102,0.5);
}
.whatsapp-float svg { width: 28px; height: 28px; fill: #fff; }

/* ── Chatbot ──────────────────────────────────────────────── */
.chatbot-toggle {
  position: fixed;
  bottom: 5.5rem;
  right: 2rem;
  width: 56px; height: 56px;
  background: var(--verde-oceano);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 800;
  box-shadow: 0 4px 20px rgba(50,99,100,0.4);
  cursor: pointer;
  border: none;
  transition: transform var(--transition), box-shadow var(--transition);
}
.chatbot-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(50,99,100,0.5);
}
.chatbot-toggle svg { width: 26px; height: 26px; fill: #fff; }

.chatbot-window {
  position: fixed;
  bottom: 10rem;
  right: 2rem;
  width: 360px;
  max-height: 520px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(50,99,100,0.2);
  display: flex;
  flex-direction: column;
  z-index: 850;
  overflow: hidden;
  transform: scale(0.9) translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.chatbot-window.open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: all;
}

.chatbot-header {
  background: var(--verde-oceano);
  color: #fff;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.chatbot-avatar {
  width: 36px; height: 36px;
  background: var(--warm-taupe);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.chatbot-header-info h4 {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
}

.chatbot-header-info p {
  font-size: 0.7rem;
  opacity: 0.7;
  margin-top: 1px;
}

.chatbot-close {
  margin-left: auto;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  opacity: 0.8;
  transition: opacity 0.2s;
}
.chatbot-close:hover { opacity: 1; }

.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 300px;
}

.chat-msg {
  max-width: 85%;
  padding: 0.65rem 0.9rem;
  border-radius: 12px;
  font-size: 0.82rem;
  line-height: 1.5;
}

.chat-msg.bot {
  background: var(--blanco-calido);
  color: var(--marron-oscuro);
  align-self: flex-start;
  border-bottom-left-radius: 3px;
}

.chat-msg.user {
  background: var(--verde-oceano);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 3px;
}

.chat-msg.typing {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 0.75rem 1rem;
}

.chat-msg.typing span {
  width: 6px; height: 6px;
  background: var(--verde-agua);
  border-radius: 50%;
  animation: bounce 1.2s infinite;
}
.chat-msg.typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-msg.typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
  0%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-6px); }
}

.chatbot-input {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid var(--gris-calido);
}

.chatbot-input input {
  flex: 1;
  border: 1px solid var(--gris-calido);
  border-radius: 8px;
  padding: 0.55rem 0.85rem;
  font-family: var(--font-body);
  font-size: 0.82rem;
  outline: none;
  transition: border-color 0.2s;
}
.chatbot-input input:focus { border-color: var(--verde-agua); }

.chatbot-input button {
  background: var(--verde-oceano);
  color: #fff;
  border: none;
  border-radius: 8px;
  width: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}
.chatbot-input button:hover { background: #265051; }
.chatbot-input button svg { width: 16px; height: 16px; fill: #fff; }

/* ── Utility ──────────────────────────────────────────────── */
.text-center { text-align: center; }
.text-teal   { color: var(--verde-oceano); }
.text-taupe  { color: var(--warm-taupe); }

.divider {
  width: 48px; height: 1px;
  background: var(--warm-taupe);
  margin-block: 1.5rem;
}
.divider.center { margin-inline: auto; }

/* ── Animations ───────────────────────────────────────────── */
.fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-toggle { display: flex; }

  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--nav-h);
    left: 0; right: 0;
    background: var(--verde-oceano);
    padding: 1.5rem 2rem 2rem;
    gap: 1.25rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
}

@media (max-width: 600px) {
  .footer-grid { grid-template-columns: 1fr; }
  .chatbot-window { right: 1rem; left: 1rem; width: auto; }
}
