
/* ================================
   RESET / BASE
================================ */
* { box-sizing: border-box; }
html,body { height:100%; margin:0; scroll-behavior:smooth; }
:root{
  --bg-dark: #111822;
  --bg-mid: #1c2635;
  --muted: #9aa4b2;
  --accent: #0a58ca;
  --white: #ffffff;
}

/* ================================
   BODY / BACKGROUND
================================ */
body {
  background: linear-gradient(180deg, var(--bg-dark) 0%, #222d3f 50%, var(--bg-dark) 100%);
  color: var(--white);
  font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  overflow-x: hidden;
}

/* ================================
   HEADER
================================ */
header {
  transition: background-color 0.24s ease, box-shadow 0.24s ease;
  z-index: 50;
}
header.scrolled {
  background-color: rgba(17, 24, 34, 0.95);
  box-shadow: 0 6px 22px rgba(2,6,23,0.25);
}
header h1 { letter-spacing: 1px; }

/* ================================
   MOBILE MENU BASE (hidden/active helpers)
   Use .hidden initially in HTML to hide; JS toggles .active
================================ */
/* default hidden (keeps Tailwind .hidden safe) */
#mobile-menu.hidden { display: none !important; opacity: 0; transform: translateY(-6px); pointer-events: none; }
/* shown state */
#mobile-menu.active { display: flex !important; opacity: 1; transform: translateY(0); pointer-events: auto; transition: opacity 180ms ease, transform 180ms ease; }

@media (min-width: 768px) {
  header nav {
    width: 100%;
  }

  header nav button {
    margin-left: auto;
  }
}



/* ================================
   HERO
================================ */
section.h-screen {
  background: linear-gradient(
    180deg,
    var(--bg-dark) 0%,
    #222d3f 50%,
    var(--bg-dark) 100%
  );
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2.5rem 1rem;
}

/* ================================
   HERO ICON
================================ */
.hero-icon {
  filter: drop-shadow(0 4px 14px rgba(0,0,0,0.28));
  opacity: 0;
  transform: translateY(18px);
  animation: fadeInUp 0.85s ease forwards;
}

/* ================================
   HANDWRITING WRAPPER
================================ */
.hero-handwriting-wrapper {
  position: relative;
  display: inline-block;
  font-size: 2.0rem;
  line-height: 1.25;
  margin-top: -16px;
}

/* ================================
   TEXTO BASE
================================ */
.hero-handwriting-base {
  display: block;
  color: rgba(255,255,255,0.95);
  opacity: 0;
  transform: translateY(18px);
}

/* ================================
   TEXTO TRAZO
================================ */
.hero-handwriting-stroke {
  position: absolute;
  inset: 0;
  display: block;

  color: transparent;
  -webkit-text-stroke: 1px rgba(255,255,255,0.9);

  white-space: nowrap;
  overflow: hidden;
  border-right: 2px solid rgba(255,255,255,0.8);

  width: 0;
  opacity: 0;
}

/* ================================
   ACTIVACIÓN DE ANIMACIÓN
================================ */
.hero-handwriting-wrapper.is-visible .hero-handwriting-base {
  animation: fadeInUp 1s ease forwards 0.3s;
}

.hero-handwriting-wrapper.is-visible .hero-handwriting-stroke {
  opacity: 1;
  animation:
    handwritingDraw 2.8s ease forwards 0.9s,
    handwritingBlink 0.7s step-end infinite 3.8s;
}

/* ================================
   KEYFRAMES
================================ */
@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes handwritingDraw {
  from { width: 0; }
  to   { width: 100%; }
}

@keyframes handwritingBlink {
  from { border-color: rgba(255,255,255,0.9); }
  to   { border-color: transparent; }
}

/* ================================
   MOBILE AJUSTES
================================ */
@media (max-width: 768px) {
  .hero-handwriting-wrapper {
    font-size: 1.9rem;
    line-height: 1.3;
    margin-top: -12px;
  }
}


/* ================================
   SERVICIOS — NUEVO COMPONENTE
================================ */

.service-item {
  background: var(--bg-mid);
  color: #fff;
  padding: 26px;
  border-radius: 14px;
  text-align: center;
  box-shadow: 0 6px 16px rgba(0,0,0,0.06);
  transition: transform 0.25s, box-shadow 0.25s;
  position: relative;
  cursor: pointer;
}

.service-item:hover {
  transform: translateY(-6px);
  box-shadow: 0 14px 30px rgba(2,6,23,0.08);
}

.service-name {
  font-size: 1.25rem;
  font-weight: 600;
}

.btn-ver-mas {
  margin-top: 14px;
  padding: 8px 16px;
  background: var(--bg-dark);
  color: #fff;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
}

/* =======================================================
   MODAL AMA DENT — VERSIÓN PROFESIONAL UX
   ======================================================= */

/* Fondo general */
#service-modal {
  position: fixed;
  inset: 0;
  background: rgba(3, 6, 23, 0.65); /* Más elegante */
  backdrop-filter: blur(4px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 70;
  opacity: 0;
  transition: opacity 0.28s ease;
}

#service-modal.show {
  opacity: 1;
}

/* Caja modal */
.modal-content {
  background: linear-gradient(180deg, #1c2635, #0f172a);
  border-radius: 22px;
  width: 88%;
  max-width: 540px;
  padding: 26px 26px 32px;
  text-align: center;
  position: relative;
  color: white;
  box-shadow: 0 18px 50px rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.04);
  transform: scale(0.92);
  transition: transform 0.25s ease;
}

#service-modal.show .modal-content {
  transform: scale(1);
}

/* Botón cerrar */
#modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background 0.25s ease;
}

#modal-close:hover {
  background: rgba(255,255,255,0.15);
}

/* Título */
#modal-title {
  font-size: 1.45rem;
  font-weight: 600;
  margin-bottom: 10px;
  letter-spacing: 0.3px;
}

/* Divider elegante */
.modal-divider {
  width: 60%;
  height: 2px;
  background: rgba(255,255,255,0.08);
  margin: 10px auto 18px;
  border-radius: 20px;
}

/* Descripción */
#modal-desc {
  font-size: 0.95rem;
  line-height: 1.55;
  margin-bottom: 18px;
  opacity: 0.9;
}

/* Carrusel */
.modal-carousel {
  position: relative;
  margin-top: 12px;
}

.modal-carousel img {
  width: 100%;
  border-radius: 14px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.25);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

/* Flechas */
.modal-carousel button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.12);
  color: #fff;
  border: none;
  padding: 8px 12px;
  border-radius: 10px;
  backdrop-filter: blur(4px);
  cursor: pointer;
  transition: background 0.2s ease;
}

.modal-carousel button:hover {
  background: rgba(255,255,255,0.22);
}

.modal-carousel .prev-img { left: -12px; }
.modal-carousel .next-img { right: -12px; }

/* Desktop mejora flechas + espaciado */
@media (min-width: 768px) {
  .modal-carousel button {
    padding: 10px 14px;
    border-radius: 12px;
  }

  #modal-title {
    font-size: 1.55rem;
  }

  #modal-desc {
    font-size: 1rem;
    line-height: 1.6;
  }
}

/* ===== Ajuste de layout para móviles ===== */
@media (max-width: 768px) {
  .service-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .btn-ver-mas {
    margin-top: 16px;
    display: inline-block;
  }
}


/* ================================
   ANIMACIONES PREMIUM AMA DENT
================================ */

/* Fade + slide para preview */
#service-preview {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

#service-preview.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Modal fade */
#service-modal {
  opacity: 0;
  transition: opacity 0.28s ease;
}

#service-modal.show {
  opacity: 1;
}

/* Modal content escala suave */
#service-modal .modal-content {
  transform: scale(0.92);
  transition: transform 0.25s ease;
}
#service-modal.show .modal-content {
  transform: scale(1);
}

/* Carrusel animación suave */
.preview-carousel img,
.modal-carousel img {
  transition: opacity 0.25s ease;
}

/* ================================
   CONTACTO
================================ */
#contacto iframe { border:0; border-radius: 0.75rem; }
#contacto a { transition: color 0.2s ease; }
#contacto a:hover { color: var(--accent); }


/* ================================
   RESEÑAS – SCROLLABLE HORIZONTAL
================================ */
#reviews {
  position: relative;
  z-index: 10;
}

#reviews-list {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;

  /* iOS FIXES */
  -webkit-overflow-scrolling: touch;
  scroll-behavior: auto;
  touch-action: pan-x;
  overscroll-behavior-x: contain;

  padding-bottom: 1rem;
}

/* Scroll snap SOLO desktop */
@media (hover: hover) {
  #reviews-list {
    scroll-snap-type: x mandatory;
  }
}

#reviews-list::-webkit-scrollbar {
  display: none;
}


.review-card {
  flex: 0 0 auto;            /* que no se encoja */
  min-width: 280px;
  max-width: 280px;
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(10px);
  border-radius: 1rem;
  padding: 1.5rem;
  scroll-snap-align: start;  /* snap a inicio de card */
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
  color: #fff;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.review-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 25px rgba(0,0,0,0.3);
}

.review-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 0.75rem;
  margin-bottom: 0.75rem;
}

.review-card p {
  margin: 0;
}

.review-card p.text-gray-700 {
  color: #d4d4d4 !important;
}

#success-modal {
  animation: fadeIn 0.3s ease forwards;
}

#success-modal a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  transition: all 0.3s ease;
}

#success-modal a:hover {
  transform: scale(1.2);
  background: rgba(255,255,255,0.2);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

#reviews-list {
  -webkit-overflow-scrolling: touch; /* iOS momentum scroll */
  scroll-behavior: auto; /* Safari ODIA smooth + JS */
  touch-action: pan-x;   /* permite swipe horizontal */
}

#reviews-list::-webkit-scrollbar {
  display: none;
}

/* ================================
   FOOTER
================================ */
footer {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  border-top: 1px solid rgba(255,255,255,0.04);
  font-size: .95rem;
  padding: 1.25rem 0;
  text-align: center;
  color: rgba(255,255,255,0.72);
  background: #0b1220; /* importante para que se note igual */
}




/* ================================
   BUTTON / LINKS
================================ */
button, a { transition: all 0.18s ease; }
button:hover, a:hover { transform: translateY(-1px); }

/* ================================
   RESPONSIVE TWEAKS
================================ */
@media (max-width: 768px) {
  header h1 { font-size: 1rem; }
  section.h-screen h2 { font-size: 2rem; }
  section.h-screen p { font-size: 0.95rem; }
  #servicios .grid { grid-template-columns: 1fr; }
  #contacto .grid { grid-template-columns: 1fr; }
}

/* small helper hidden (keeps Tailwind .hidden compatible) */
/* Mantener compatibilidad con Tailwind */
.hidden { display: none; }


/* ================================
   MOBILE MENU — fondo elegante + cierre visible
================================ */
#mobile-menu {
  /* cover the screen */
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  padding: 2.5rem;
  z-index: 60;

  /* elegant gradient + blur */
  background: linear-gradient(180deg, rgba(17,24,34,0.98) 0%, rgba(28,38,53,0.96) 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);

  /* initial hidden state (kept for semantics) */
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 220ms ease, transform 220ms ease;
}

/* visible state */
#mobile-menu.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ensure .hidden doesn't conflict when we toggle via JS:
   keep rule but JS will remove .hidden when showing */
#mobile-menu.hidden { display: none !important; }

/* close button styling (visible, large, accessible) */
#cerrar-menu {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 2.25rem;
  line-height: 1;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  z-index: 70;
  transition: transform 0.15s ease;
}
#cerrar-menu:hover { transform: scale(1.05); }

/* links inside mobile menu */
#mobile-menu a {
  color: #fff;
  font-weight: 600;
  font-size: 1.125rem;
  text-decoration: none;
}
#mobile-menu a:hover { opacity: 0.9; transform: translateY(-2px); }

/* small safety on stacking */
header { z-index: 50; }

/* ================================
   BOTÓN "INICIAR SESIÓN" EN NAVBAR
================================ */
header nav button,
#mobile-menu button {
  background: #ffffff;
  color: #111822;
  padding: 0.6rem 1.5rem;
  border-radius: 9999px;
  font-weight: 600;
  transition: all 0.25s ease;
  cursor: pointer;
  box-shadow: 0 0 0 transparent;
  
}

header nav button:hover,
#mobile-menu button:hover {
  background: #f1f1f1;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(255, 255, 255, 0.1);
}

/* ================================
   LOGIN MODAL ESTILO
================================ */
#login-modal {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background: rgba(0, 0, 0, 0.65);
  transition: opacity 0.3s ease, visibility 0.3s ease;
  opacity: 0;
  visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

#login-modal.active {
  opacity: 1;
  visibility: visible;
}

#login-modal .bg-white {
  border-radius: 1rem;
  box-shadow: 0 15px 35px rgba(0,0,0,0.4);
  animation: modalFadeIn 0.3s ease forwards;
  max-height: 90vh;
  overflow-y: auto;
}

#login-modal button#close-login {
  background: none;
  border: none;
  font-size: 2rem;
  color: #555;
  cursor: pointer;
  transition: transform 0.2s ease;
}
#login-modal button#close-login:hover {
  transform: scale(1.1);
  color: #000;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* Ajustes responsivos */
@media (max-width: 640px) {
  #login-modal .bg-white {
    width: 95%;
    padding: 1.5rem;
  }
}

/* ================================
   SERVICIOS – PREMIUM
================================ */


/* GRID */
.services-grid {
  display: grid;
  gap: 2rem;
}

/* DESKTOP */
@media (min-width: 768px) {
  .services-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ================================
   SERVICE CARD – AMA DENT (PRO)
================================ */
.service-body::before {
  content: "";
  display: block;
  width: 40px;
  height: 2px;
  background: linear-gradient(
    to right,
    rgba(255,255,255,0.4),
    rgba(255,255,255,0)
  );
  margin-bottom: 0.75rem;
}


.service-card {
  background: #1c2635; /* mismo mid-bg del sitio */
  color: #ffffff;

  border-radius: 1.5rem;
  padding: 2rem;

  box-shadow:
    0 20px 40px rgba(0,0,0,.35),
    inset 0 1px 0 rgba(255,255,255,.04);

  transition:
    transform .35s ease,
    box-shadow .35s ease;

  will-change: transform;
}

/* Hover desktop */
@media (hover: hover) {
  .service-card:hover {
    transform: translateY(-4px);
    box-shadow:
      0 30px 60px rgba(0,0,0,.45);
  }
}

/* HEADER */
.service-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.service-header h4 {
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -.01em;
}

.toggle {
  font-size: 1.6rem;
  font-weight: 300;
  transition: transform .45s cubic-bezier(.4,0,.2,1);
}

.service-card.open .toggle {
  transform: rotate(45deg);
}

/* BODY (ACCORDION PREMIUM) */
.service-body {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-8px);
  transition:
    max-height .6s cubic-bezier(.4,0,.2,1),
    opacity .35s ease,
    transform .35s ease;
}

.service-card.open .service-body {
  margin-top: 1.25rem;
  max-height: 1200px;
  opacity: 1;
  transform: translateY(0);
}

/* TEXTO */
.service-desc {
  color: #e5e7eb;
  font-size: 0.95rem;
  line-height: 1.75;
  letter-spacing: 0.01em;

  /* micro profundidad */
  text-shadow: 0 1px 1px rgba(0,0,0,0.35);
}

.service-body {
  border-left: 2px solid rgba(255,255,255,0.08);
  padding-left: 1rem;
}

.service-desc strong {
  color: #ffffff;
  font-weight: 500;
}


/* CARRUSEL */
.service-carousel {
  position: relative;
  display: flex;
  align-items: center;
  gap: .75rem;
}

.service-carousel img {
  width: 100%;
  border-radius: .85rem;
  object-fit: cover;
  transition: opacity .35s ease;
}

.service-carousel img.fade {
  opacity: 0;
}

/* BOTONES */
.service-carousel button {
  background: none;
  border: none;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  color: #222;
  opacity: .65;
  transition: opacity .25s ease, transform .25s ease;
}

.service-carousel button:hover {
  opacity: 1;
  transform: scale(1.1);
}

/* MOBILE FINESSE */
@media (max-width: 767px) {
  .service-card {
    padding: 1.5rem;
  }

  .service-header h4 {
    font-size: 1.1rem;
  }
}
