/* ============================================================
   RESET & BASE
============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --teal-900: #0d4f4a;
  --teal-700: #1a7a6e;
  --teal-500: #0d9488;
  --teal-400: #2dd4bf;
  --teal-50:  #f0fdf9;
  --slate-900: #0f172a;
  --slate-700: #334155;
  --slate-500: #64748b;
  --slate-300: #cbd5e1;
  --slate-100: #f1f5f9;
  --white: #ffffff;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 999px;
}

html { scroll-behavior: smooth; -webkit-overflow-scrolling: touch; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--slate-100);
  color: var(--slate-700);
  overflow-x: hidden;
}

/* ============================================================
   DARK MODE
============================================================ */
body.dark-mode {
  background: #121212;
  color: #e2e8f0;
}
body.dark-mode nav { background: linear-gradient(135deg, #062925 0%, #0d4f4a 100%); }
body.dark-mode .search-wrap input { background: #1e293b; border-color: #334155; color: #e2e8f0; }
body.dark-mode .section-header { color: #f1f5f9; }
body.dark-mode .blog-card { background: #1e293b; border-color: #334155; }
body.dark-mode .blog-card h3 { color: #f1f5f9; }
body.dark-mode .blog-card p  { color: #94a3b8; }
body.dark-mode footer.site-footer { background: #0a0f1a; }
body.dark-mode .toggle-wrapper { background: #1e293b; }
body.dark-mode .toggle-ball { transform: translateX(48px); background: #e2e8f0; }

/* ============================================================
   NAVBAR
============================================================ */
nav {
  background: linear-gradient(135deg, var(--teal-900) 0%, var(--teal-700) 60%, #2d9d8f 100%);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 32px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 16px rgba(0,0,0,.18);
}

/* Logo block */
.logo-block {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  text-decoration: none;
}
.logo-block img {
  width: 58px; height: 58px;
  object-fit: contain;
  border-radius: 10px;
  background: rgba(255,255,255,.1);
  padding: 4px;
}
.logo-card { line-height: 1.25; }
.logo-card .top1 {
  font-size: 8.5px; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase;
  color: rgba(255,255,255,.72);
}
.logo-card .top2 {
  font-size: 8.5px; font-weight: 900;
  letter-spacing: .16em; text-transform: uppercase;
  color: #fff;
}

/* Hamburger */
.ham-input { display: none; }
.ham-label {
  display: none;
  cursor: pointer;
  margin-left: auto;
  color: #fff;
  font-size: 22px;
}

/* Nav links */
.nav-menu {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin-left: auto;
}
.nav-menu a {
  color: rgba(255,255,255,.88);
  text-decoration: none;
  padding: 7px 11px;
  border-radius: var(--radius-sm);
  transition: background .18s, color .18s;
  white-space: nowrap;
}
.nav-menu a:hover { background: rgba(255,255,255,.12); color: var(--teal-400); }

.btn-agendar {
  background: #fff !important;
  color: var(--teal-700) !important;
  font-weight: 700 !important;
  padding: 8px 20px !important;
  border-radius: var(--radius-full) !important;
  box-shadow: 0 2px 10px rgba(0,0,0,.15);
  transition: box-shadow .2s !important;
}
.btn-agendar:hover { box-shadow: 0 4px 18px rgba(0,0,0,.22); background: #f0fdf9 !important; }

/* ============================================================
   PORTADA
============================================================ */
.portada {
  position: relative;
  width: 100%;
  height: 28rem;
  overflow: hidden;
}
.portada-imagen {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  display: block;
}
.portada-capa {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.58) 0%, rgba(0,0,0,.18) 60%, transparent 100%);
}
.portada-contenido {
  position: absolute;
  bottom: 28px; left: 36px;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.perfil {
  width: 88px; height: 88px;
  border-radius: 50%;
  border: 4px solid rgba(255,255,255,.85);
  object-fit: cover;
  box-shadow: 0 4px 18px rgba(0,0,0,.4);
  flex-shrink: 0;
  background: var(--teal-700);
}
.texto { color: #fff; }
.texto h1 { font-size: 2rem; font-weight: 800; text-shadow: 0 2px 8px rgba(0,0,0,.45); line-height: 1.2; }
.texto p  { font-size: 1rem; margin-top: 6px; color: rgba(255,255,255,.82); }

/* ============================================================
   MAIN CONTENT
============================================================ */
main { max-width: 1024px; margin: 0 auto; padding: 0 20px; }

/* Buscador */
.search-wrap {
  padding: 36px 0 0;
  display: flex;
  justify-content: center;
}
.search-wrap .search-inner { position: relative; width: 100%; max-width: 500px; }
.search-wrap input {
  width: 100%;
  padding: 13px 22px;
  border: 1.5px solid #d1fae5;
  border-radius: var(--radius-full);
  font-size: 14px; font-family: inherit;
  background: var(--white);
  color: var(--slate-700);
  outline: none;
  box-shadow: 0 2px 10px rgba(13,148,136,.08);
  transition: border-color .2s, box-shadow .2s;
}
.search-wrap input:focus {
  border-color: var(--teal-500);
  box-shadow: 0 0 0 3px rgba(13,148,136,.12);
}
#sugerencias {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: var(--white);
  border: 1px solid var(--slate-300);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0,0,0,.10);
  list-style: none;
  z-index: 50;
}
#sugerencias.hidden { display: none; }
#sugerencias li {
  padding: 10px 16px;
  font-size: 13px;
  cursor: pointer;
  color: var(--slate-700);
  transition: background .15s;
}
#sugerencias li:hover { background: var(--teal-50); color: var(--teal-500); }

/* Toggle modo oscuro */
.toggle-wrapper {
  position: fixed;
  top: 100px;
  right: 18px;
  width: 78px; height: 30px;
  background: #e2e8f0;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 6px;
  cursor: pointer;
  z-index: 200;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
  transition: background .3s;
  user-select: none;
}
.toggle-ball {
  width: 23px; height: 23px;
  background: #fbbf24;
  border-radius: 50%;
  position: absolute;
  left: 4px;
  transition: transform .3s, background .3s;
}
.toggle-wrapper .sun, .toggle-wrapper .moon { font-size: 14px; z-index: 1; }

/* Sección artículos */
.section-header {
  text-align: center;
  padding: 32px 0 20px;
  font-size: 26px;
  font-weight: 800;
  color: var(--slate-900);
}
.section-header span { color: var(--teal-500); }

/* Grid de cards */
#blog-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  padding-bottom: 12px;
}

.blog-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid #e2e8f0;
  overflow: hidden;
  cursor: pointer;
  transition: transform .22s, box-shadow .22s;
  box-shadow: 0 1px 6px rgba(0,0,0,.06);
}
.blog-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 32px rgba(0,0,0,.12);
}
.blog-card img {
  width: 100%; height: 190px;
  object-fit: cover;
  display: block;
  transition: opacity .25s;
}
.blog-card:hover img { opacity: .92; }
.blog-card-body { padding: 20px; }
.blog-card h3 {
  font-size: 16px; font-weight: 700;
  color: var(--slate-900);
  margin-bottom: 8px;
  line-height: 1.35;
  transition: color .2s;
}
.blog-card:hover h3 { color: var(--teal-500); }
.blog-card p { font-size: 13px; color: var(--slate-500); line-height: 1.6; margin-bottom: 14px; }
.blog-card .leer-mas {
  font-size: 13px; font-weight: 600;
  color: var(--teal-500);
  display: inline-flex; align-items: center; gap: 4px;
}
.blog-card .leer-mas::after { content: "→"; transition: transform .2s; }
.blog-card:hover .leer-mas::after { transform: translateX(4px); }

/* Botón Ver más */
.ver-mas-wrap {
  display: flex;
  justify-content: center;
  padding: 36px 0 48px;
}
#verMasBtn {
  background: var(--teal-500);
  color: var(--white);
  font-size: 14px; font-weight: 700; font-family: inherit;
  padding: 13px 36px;
  border: none; border-radius: var(--radius-full);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(13,148,136,.25);
  transition: background .2s, box-shadow .2s, transform .15s;
}
#verMasBtn:hover { background: var(--teal-700); box-shadow: 0 6px 20px rgba(13,148,136,.3); transform: translateY(-1px); }
#verMasBtn:active { transform: translateY(0); }

/* ============================================================
   FOOTER
============================================================ */
footer.site-footer {
  background: var(--slate-900);
  color: #fff;
  padding: 56px 0 0;
}
.footer-container {
  max-width: 1024px;
  margin: 0 auto;
  padding: 0 32px 48px;
  display: grid;
  grid-template-columns: 1.7fr 1fr 1fr 1.2fr;
  gap: 40px;
}

/* Columna About */
.footer-about .footer-logo-text {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px;
}
.logo-footer {
  width: 36px; height: 36px;
  object-fit: contain;
  border-radius: 8px;
  background: rgba(255,255,255,.08);
  padding: 3px;
}
.footer-about h3 {
  font-size: 11px; font-weight: 800;
  color: var(--teal-400);
  text-transform: uppercase;
  letter-spacing: .12em;
  line-height: 1.35;
}
.footer-about > p { font-size: 13px; color: #94a3b8; line-height: 1.7; }

/* Columna genérica */
.footer-col h4 {
  font-size: 10px; font-weight: 700;
  color: rgba(255,255,255,.5);
  text-transform: uppercase; letter-spacing: .15em;
  margin-bottom: 16px;
}
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul li a, .footer-col ul li span {
  font-size: 13px; color: #94a3b8;
  text-decoration: none;
  transition: color .2s;
  display: block;
}
.footer-col ul li a:hover { color: var(--teal-400); }

.btn-llamar {
  display: inline-flex !important;
  align-items: center; gap: 6px;
  background: rgba(45,212,191,.1) !important;
  color: var(--teal-400) !important;
  border-radius: 8px !important;
  padding: 7px 12px !important;
  font-weight: 600 !important;
  font-size: 12px !important;
  transition: background .2s !important;
  margin-top: 4px;
}
.btn-llamar:hover { background: rgba(45,212,191,.2) !important; }

/* Columna social */
.footer-social { display: flex; flex-direction: column; gap: 2px; }
.footer-social a {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: #94a3b8;
  text-decoration: none;
  padding: 9px 10px;
  border-radius: 10px;
  transition: background .18s, color .18s;
  font-weight: 500;
}
.footer-social a:hover { background: rgba(255,255,255,.06); }
.footer-social a.facebook:hover { color: #60a5fa; }
.footer-social a.instagram:hover { color: #f472b6; }
.footer-social a.whatsapp:hover { color: #4ade80; }
.social-icon {
  width: 30px; height: 30px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0;
}
.social-icon.fb { background: rgba(96,165,250,.12); color: #60a5fa; }
.social-icon.ig { background: rgba(244,114,182,.12); color: #f472b6; }
.social-icon.wa { background: rgba(74,222,128,.12); color: #4ade80; }

/* Columna ubicación */
.footer-location p { font-size: 13px; color: #94a3b8; line-height: 1.75; margin-bottom: 10px; }
.footer-location a { color: #60a5fa; text-decoration: none; transition: color .2s; }
.footer-location a:hover { color: #93c5fd; }

/* Barra inferior */
.footer-bottom {
  border-top: 1px solid #1e293b;
  max-width: 1024px;
  margin: 0 auto;
  padding: 22px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.footer-bottom p { font-size: 12px; color: #64748b; }
.footer-legal { display: flex; gap: 18px; }
.footer-legal a { font-size: 12px; color: #64748b; text-decoration: none; transition: color .2s; }
.footer-legal a:hover { color: var(--teal-400); }

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 768px) {
  nav { padding: 12px 18px; flex-wrap: wrap; }

  .ham-label { display: block; }

  .nav-menu {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 32px;
    width: 100%;
    background: rgba(0,0,0,.2);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    margin-top: 8px;
  }
  .ham-input:checked ~ .nav-menu { display: flex; }
  .nav-menu a { font-size: 14px; padding: 9px 12px; width: 100%; border-radius: 8px; }

  .portada { height: 22rem; }
  .portada-contenido { flex-direction: column; align-items: center; bottom: 16px; left: 0; right: 0; text-align: center; }
  .perfil { width: 72px; height: 72px; }
  .texto h1 { font-size: 1.4rem; }
  .texto p  { font-size: .88rem; }

  .toggle-wrapper { top: 88px; right: 12px; width: 70px; }
  body.dark-mode .toggle-ball { transform: translateX(42px); }

  .footer-container { grid-template-columns: 1fr 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
  .footer-container { grid-template-columns: 1fr; }
  #blog-container { grid-template-columns: 1fr; }
}

/* Accesibilidad */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
