/* ==========================================================================
   Ritmo Sport — Sitio de gimnasio
   Mobile-first. Variables al inicio para ajustar marca/color en un solo lugar.
   ========================================================================== */

:root {
  --color-bg: #0b0b0c;
  --color-bg-alt: #131315;
  --color-bg-raised: #1a1a1d;
  --color-text: #f5f4f2;
  --color-text-muted: #a3a1a0;
  --color-text-faint: #6e6c6b;
  --color-gold: #f0b429;
  --color-gold-soft: rgba(240, 180, 41, 0.14);
  --color-whatsapp: #25d366;
  --color-border: rgba(245, 244, 242, 0.1);
  --color-border-strong: rgba(245, 244, 242, 0.2);
  --color-overlay: rgba(6, 6, 7, 0.68);

  --font-display: "Anton", "Arial Narrow", sans-serif;
  --font-serif: "Fraunces", "Playfair Display", Georgia, serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 3.5rem;
  --space-xl: 5.5rem;
  --content-max: 1160px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --header-h: 68px;

  /* Sombra única para todas las tarjetas: les da profundidad sin agregar
     bordes, colores ni elementos nuevos — mismo look en todo el sitio. */
  --shadow-card: 0 10px 24px rgba(0, 0, 0, 0.35);
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

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

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

h1, h2, h3 {
  margin: 0;
  line-height: 1.05;
}

/* Títulos grandes: serif elegante. La condensada/bold queda solo para acentos puntuales (kickers, precios, horarios, badges). */
h1, h2 {
  font-family: var(--font-serif);
  font-weight: 600;
  letter-spacing: -0.01em;
}

h3 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

p {
  margin: 0;
}

.container {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--space-sm);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--color-gold);
  color: #0b0b0c;
  padding: 0.75rem 1.25rem;
  font-weight: 700;
  z-index: 200;
}

.skip-link:focus {
  left: var(--space-sm);
  top: var(--space-sm);
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 1.6rem;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform var(--ease-out) 200ms, background var(--ease-out) 200ms;
}

.btn:active {
  transform: scale(0.97);
}

.btn-solid {
  background: var(--color-gold);
  color: #0b0b0c;
}

.btn-solid:hover {
  background: #ffcc4d;
}

.btn-ghost {
  background: transparent;
  border-color: var(--color-border-strong);
  color: var(--color-text);
}

.btn-ghost:hover {
  border-color: var(--color-gold);
  color: var(--color-gold);
}

.btn-block {
  width: 100%;
}

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  display: flex;
  align-items: center;
  /* Sólido en vez de backdrop-filter: blur() — el blur en un header fijo es una
     causa común de scroll con tirones en celulares de gama media/baja. */
  background: rgba(11, 11, 12, 0.96);
  border-bottom: 1px solid var(--color-border);
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
}

.logo {
  display: flex;
  align-items: center;
  max-width: 60vw;
}

.logo-img {
  display: block;
  height: 30px;
  width: auto;
  object-fit: contain;
  margin-right: 0.5rem;
}

.logo-text {
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 0.03em;
  color: var(--color-gold);
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-toggle {
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid var(--color-border-strong);
  border-radius: 4px;
  position: relative;
  cursor: pointer;
}

/* El <span> también es absolute, así que para sus ::before/::after ÉL es el
   contenedor: left/right deben ir en 0 aquí (y el inset real, en .nav-toggle span)
   para que las 3 líneas midan lo mismo en vez de que before/after salgan a la mitad. */
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  border-radius: 1px;
  background: var(--color-gold);
  transition: transform var(--ease-out) 200ms, opacity var(--ease-out) 200ms;
}

.nav-toggle span {
  top: 19px;
  left: 8px;
  right: 8px;
}

.nav-toggle span::before {
  top: -6px;
}

.nav-toggle span::after {
  top: 6px;
}

.nav-toggle[aria-expanded="true"] span {
  background: transparent;
}

.nav-toggle[aria-expanded="true"] span::before {
  top: 0;
  transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span::after {
  top: 0;
  transform: rotate(-45deg);
}

.main-nav {
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--color-bg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: var(--space-lg);
  transform: translateX(100%);
  transition: transform var(--ease-out) 350ms;
  overflow-y: auto;
}

.main-nav.is-open {
  transform: translateX(0);
}

.nav-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
}

.nav-links a {
  font-family: var(--font-display);
  font-size: 1.5rem;
  text-transform: uppercase;
  color: var(--color-text);
  padding: 0.6rem 1.4rem;
  border-radius: 999px;
  transition: background var(--ease-out) 200ms, color var(--ease-out) 200ms;
}

.nav-links a:hover {
  color: var(--color-gold);
}

/* Resalta la sección visible mientras se hace scroll (ver js/main.js) */
.nav-links a.is-active {
  background: var(--color-bg-raised);
  color: var(--color-gold);
}

.nav-cta {
  display: none;
}

/* ---------- WhatsApp flotante retráctil ---------- */
/* Anclado al borde derecho: en reposo solo asoma el ícono; al tocar, se despliega la etiqueta. */
.whatsapp-float {
  position: fixed;
  right: 0;
  bottom: calc(var(--space-lg) + var(--space-sm));
  display: flex;
  align-items: center;
  background: var(--color-whatsapp);
  border-radius: 999px 0 0 999px;
  box-shadow: -2px 4px 14px rgba(0, 0, 0, 0.3);
  z-index: 150;
  overflow: hidden;
  max-width: 50px;
  transition: max-width var(--ease-out) 320ms;
}

.whatsapp-float.is-expanded {
  max-width: 260px;
}

.wa-icon {
  position: relative;
  flex: none;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.whatsapp-float svg {
  width: 28px;
  height: 28px;
  fill: #ffffff;
  position: relative;
  z-index: 1;
}

.wa-ping {
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: #ffffff;
  opacity: 0.35;
  /* Pulsa unas cuantas veces para avisar que está ahí y luego se queda quieto — no anima para siempre */
  animation: wa-pulse 2.2s ease-out 3;
}

.whatsapp-float.is-expanded .wa-ping {
  animation: none;
  opacity: 0;
}

@keyframes wa-pulse {
  0% { transform: scale(0.6); opacity: 0.35; }
  100% { transform: scale(1.8); opacity: 0; }
}

.wa-label {
  white-space: nowrap;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.88rem;
  padding-left: 0.2rem;
  padding-right: 1.1rem;
  opacity: 0;
  transition: opacity var(--ease-out) 200ms;
}

.whatsapp-float.is-expanded .wa-label {
  opacity: 1;
  transition-delay: 120ms;
}

/* Evita que el header fijo tape el contenido al saltar a una sección desde el menú */
.hero,
.section {
  scroll-margin-top: var(--header-h);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding-top: var(--header-h);
  background: var(--color-bg);
}

.hero-photo-frame {
  width: 100%;
  line-height: 0;
  border-bottom: 3px solid var(--color-gold);
}

.hero-photo-frame img {
  width: 100%;
  height: auto;
  display: block;
}

.hero-content {
  padding: var(--space-lg) 0 var(--space-md);
  width: 100%;
}

.eyebrow {
  color: var(--color-gold);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: var(--space-xs);
}

.hero h1 {
  font-size: clamp(2.6rem, 11vw, 4.5rem);
  color: var(--color-text);
}

.hero-tagline {
  margin-top: var(--space-sm);
  font-size: 1.05rem;
  color: var(--color-text-muted);
  max-width: 32ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-top: var(--space-md);
}


/* Permite reordenar Servicios/Horarios/Precios/Galería/Contacto sin mover el
   HTML: cada <section> recibe su "order" desde site_sections (ver
   js/site-content.js). El orden por default (sin JS) es el del HTML. */
#main {
  display: flex;
  flex-direction: column;
}

/* ---------- Secciones genéricas ---------- */
.section {
  padding: var(--space-xl) 0;
}

.section-alt {
  background: var(--color-bg-alt);
}

.kicker {
  color: var(--color-gold);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: var(--space-xs);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* Flechas para reordenar la sección completa (solo visibles en modo edición) */
.section-reorder {
  display: inline-flex;
  gap: 0.3rem;
}

.section-reorder button {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  border: 1px solid var(--color-border-strong);
  background: var(--color-bg);
  color: var(--color-text-muted);
  font-size: 0.7rem;
  line-height: 1;
  cursor: pointer;
}

.section-reorder button:hover:not(:disabled) {
  border-color: var(--color-gold);
  color: var(--color-gold);
}

.section-reorder button:disabled {
  opacity: 0.3;
  cursor: default;
}

.section-title {
  font-size: clamp(1.9rem, 7vw, 2.8rem);
  margin-bottom: var(--space-lg);
}

/* ---------- Servicios ---------- */
.services-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-sm);
}

.service-card {
  background: var(--color-bg-raised);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: var(--space-md);
  box-shadow: var(--shadow-card);
}

.service-num {
  display: block;
  font-family: var(--font-display);
  color: var(--color-gold);
  font-size: 1.1rem;
  margin-bottom: 0.4rem;
}

.service-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
}

.service-card p {
  color: var(--color-text-muted);
  font-size: 0.92rem;
}

/* ---------- Horarios ---------- */
.schedule-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-sm);
}

.schedule-card {
  background: var(--color-bg-raised);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: var(--space-md);
  text-align: center;
  box-shadow: var(--shadow-card);
}

.schedule-days {
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-bottom: 0.4rem;
}

.schedule-hours {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--color-gold);
}

.schedule-note {
  margin-top: var(--space-md);
  color: var(--color-text-muted);
  text-align: center;
}

/* ---------- Precios ---------- */
.pricing-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-sm);
}

.price-card {
  background: var(--color-bg-raised);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: var(--space-md);
  position: relative;
  box-shadow: var(--shadow-card);
}

.price-card--highlight {
  border-color: var(--color-gold);
  background: var(--color-gold-soft);
}

.price-badge {
  position: absolute;
  top: -12px;
  left: var(--space-md);
  background: var(--color-gold);
  color: #0b0b0c;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
}

.price-name {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
}

.price-amount {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.2rem;
  font-family: var(--font-display);
  font-size: 2.6rem;
  color: var(--color-gold);
  margin-bottom: 0.4rem;
}

.price-currency {
  font-size: 0.5em;
  align-self: flex-start;
  margin-top: 0.35em;
}

.price-period {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-text-muted);
  text-transform: none;
  margin-left: 0.15rem;
}

.price-note {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin-bottom: var(--space-sm);
  line-height: 1.4;
}

.price-features li {
  padding: 0.4rem 0;
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 0.92rem;
}

.price-features li:first-child {
  border-top: none;
}

.price-features li::before {
  content: "✓ ";
  color: var(--color-gold);
  font-weight: 700;
}

.promo-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

.promo-card {
  background: var(--color-bg-raised);
  border: 1px dashed var(--color-border-strong);
  border-radius: 8px;
  padding: var(--space-md);
  box-shadow: var(--shadow-card);
}

.promo-title {
  font-family: var(--font-display);
  color: var(--color-gold);
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}

.promo-card p:not(.promo-title) {
  color: var(--color-text-muted);
}

.payment-info {
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-border);
  display: grid;
  gap: 0.6rem;
  color: var(--color-text-muted);
  font-size: 0.92rem;
}

.payment-info strong {
  color: var(--color-text);
}

/* ---------- Galería ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-sm);
  align-items: start;
}

/* Fotos completas, sin recortar: cada tarjeta respeta la relación de aspecto real de la imagen. */
.gallery-item {
  position: relative;
  margin: 0;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--color-bg-raised);
  line-height: 0;
  box-shadow: var(--shadow-card);
}

.gallery-item figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1.4rem 1rem 0.9rem;
  background: linear-gradient(180deg, rgba(11, 11, 12, 0) 0%, rgba(11, 11, 12, 0.85) 65%, rgba(11, 11, 12, 0.92) 100%);
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 1.05rem;
  line-height: 1.25;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}

.gallery-grid img {
  width: 100%;
  height: auto;
  display: block;
}

.gallery-cta {
  margin-top: var(--space-lg);
  text-align: center;
  display: grid;
  gap: var(--space-sm);
  justify-items: center;
}

/* Franja de frases motivacionales: texto en movimiento continuo, sin fotos. */
.phrase-marquee {
  overflow: hidden;
  background: var(--color-bg-alt);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-sm) 0;
}

.phrase-marquee__track {
  display: flex;
  width: max-content;
  animation: phrase-marquee-scroll 50s linear infinite;
}

.phrase-marquee--reverse .phrase-marquee__track {
  animation-direction: reverse;
}

.phrase-marquee__item {
  flex: none;
  display: flex;
  align-items: center;
  padding: 0 var(--space-md);
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--color-gold);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.phrase-marquee__item::after {
  content: "\2022";
  margin-left: var(--space-md);
  color: var(--color-border-strong);
}

@keyframes phrase-marquee-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .phrase-marquee__track {
    animation: none;
    overflow-x: auto;
  }
}

.gallery-cta p {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--color-text);
  text-transform: uppercase;
}

/* ---------- Contacto ---------- */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
}

.contact-details {
  display: grid;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.contact-details li {
  display: grid;
  gap: 0.2rem;
}

.contact-label {
  color: var(--color-gold);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.contact-details a {
  color: var(--color-text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--color-text);
  text-decoration: none;
}

.social-link:hover {
  color: var(--color-gold);
}

.social-icon {
  width: 18px;
  height: 18px;
  flex: none;
  color: inherit;
}

.social-icon path {
  fill: currentColor;
}

.admin-social-edit-btn {
  font-size: 0.72rem;
  padding: 0.35rem 0.7rem;
  margin-right: var(--space-sm);
}

/* Estos 3 botones ("Editar enlace de Maps/Instagram/Facebook") solo pueden
   verse si el body tiene la clase "is-edit-mode" — esto manda SIEMPRE,
   sin importar lo que haga o deje de hacer el JS (ej. si la sesión expira
   de forma rara sin que se detecte, esto los sigue ocultando igual). */
.admin-edit-link-btn {
  display: none !important;
}

body.is-edit-mode .admin-edit-link-btn {
  display: inline-flex !important;
}

.map-embed {
  width: 100%;
  height: 260px;
  border: 0;
  border-radius: 6px;
  margin-top: var(--space-md);
}

.admin-maps-link {
  margin-top: var(--space-md);
}

.contact-form {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: var(--space-md);
  display: grid;
  gap: var(--space-sm);
}

.contact-form label {
  display: grid;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.contact-form input,
.contact-form textarea {
  background: var(--color-bg);
  border: 1px solid var(--color-border-strong);
  border-radius: 4px;
  padding: 0.75rem;
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--color-gold);
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: var(--space-lg) 0;
  text-align: center;
}

.footer-inner {
  display: grid;
  gap: var(--space-xs);
}

.footer-logo {
  font-family: var(--font-display);
  color: var(--color-gold);
  font-size: 1.2rem;
  text-transform: uppercase;
}

.footer-copy,
.footer-social {
  color: var(--color-text-faint);
  font-size: 0.85rem;
}

.footer-social a {
  color: var(--color-text-muted);
}

.footer-social a:hover {
  color: var(--color-gold);
}

/* ==========================================================================
   Breakpoints
   ========================================================================== */

@media (min-width: 640px) {
  .services-grid {
    grid-template-columns: 1fr 1fr;
  }

  .schedule-grid {
    grid-template-columns: 1fr 1fr;
  }

  .pricing-grid {
    grid-template-columns: repeat(3, 1fr);
    align-items: start;
  }

  .promo-grid {
    grid-template-columns: 1fr 1fr;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  :root {
    --header-h: 84px;
  }

  .header-inner {
    padding: 0 var(--space-md);
  }

  .nav-toggle {
    display: none;
  }

  .main-nav {
    position: static;
    flex-direction: row;
    transform: none;
    background: transparent;
    gap: var(--space-md);
    overflow: visible;
  }

  .nav-links {
    flex-direction: row;
    gap: 0.35rem;
  }

  .nav-links a {
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: none;
    padding: 0.5rem 0.9rem;
  }

  .nav-cta {
    display: inline-flex;
    white-space: nowrap;
    padding: 0.6rem 1.2rem;
    font-size: 0.8rem;
  }

  .services-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .contact-layout {
    grid-template-columns: 1.1fr 0.9fr;
    align-items: start;
  }
}

@media (min-width: 1100px) {
  .services-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Respeta la preferencia de "reducir movimiento" del sistema operativo */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .wa-ping {
    animation: none;
    display: none;
  }

  .btn,
  .whatsapp-float,
  .main-nav,
  .nav-toggle span,
  .nav-toggle span::before,
  .nav-toggle span::after {
    transition: none;
  }
}

/* ==========================================================================
   Modo edición inline (admin logueado) — ver js/edit-mode.js
   Nada de esto aparece para un visitante normal.
   ========================================================================== */

/* El acceso al admin ahora es un triple clic sobre el logo (ver js/edit-mode.js) —
   sin ningún botón visible de por medio. */

/* ---------- Modal de login / cambiar contraseña ---------- */
.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(6, 6, 7, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-sm);
}

.admin-modal[hidden] {
  display: none;
}

.admin-modal-box {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: var(--space-md);
}

.admin-modal-box h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  text-transform: none;
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}

.admin-hint {
  color: var(--color-text-muted);
  font-size: 0.88rem;
  line-height: 1.5;
  margin-bottom: var(--space-sm);
}

.admin-hint--tight {
  margin: 0.3rem 0 0.8rem;
  font-size: 0.8rem;
  color: var(--color-text-faint);
}

.admin-close {
  position: absolute;
  top: 0.9rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.admin-close:hover {
  color: var(--color-text);
}

.admin-field-label {
  display: block;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-bottom: 0.35rem;
}

.admin-input {
  width: 100%;
  background: var(--color-bg);
  border: 1px solid var(--color-border-strong);
  border-radius: 8px;
  padding: 0.75rem;
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  margin-bottom: 0.9rem;
}

.admin-input:focus {
  outline: none;
  border-color: var(--color-gold);
}

.admin-pwd-wrap {
  position: relative;
}

.admin-pwd-wrap .admin-input {
  padding-right: 68px;
}

.admin-pwd-toggle {
  position: absolute;
  right: 6px;
  top: 12px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  padding: 0.4rem 0.5rem;
}

.admin-pwd-toggle:hover {
  color: var(--color-gold);
}

.admin-error {
  color: #ff9a90;
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

.admin-error[hidden] {
  display: none;
}

/* ---------- Barra de modo edición ---------- */
.admin-toolbar {
  position: fixed;
  bottom: var(--space-sm);
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: center;
  justify-content: center;
  width: max-content;
  max-width: min(92vw, 560px);
  background: var(--color-bg-alt);
  border: 1px solid var(--color-gold);
  border-radius: 16px;
  padding: 0.9rem 1.2rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

.admin-toolbar[hidden] {
  display: none;
}

.admin-toolbar-label {
  flex-basis: 100%;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.admin-toolbar-btn {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}

.admin-toolbar-save {
  background: var(--color-gold);
  color: #0b0b0c;
  border: none;
}

.admin-toolbar-cancel {
  background: none;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border-strong);
}

.admin-toolbar-cancel:hover {
  color: var(--color-text);
  border-color: var(--color-text-muted);
}

.admin-msg {
  flex-basis: 100%;
  text-align: center;
  font-size: 0.8rem;
  color: var(--color-gold);
}

@media (max-width: 480px) {
  .admin-toolbar-label {
    font-size: 0.64rem;
  }
}

/* Texto editable directamente en la página (contenteditable) */
body.is-edit-mode [data-edit-table] {
  outline: 1px dashed rgba(240, 180, 41, 0.45);
  outline-offset: 4px;
  border-radius: 4px;
  cursor: text;
  transition: outline-color var(--ease-out) 150ms, background-color var(--ease-out) 150ms;
}

body.is-edit-mode [data-edit-table]:hover {
  outline-color: var(--color-gold);
}

body.is-edit-mode [data-edit-table]:focus {
  outline: 2px solid var(--color-gold);
  background: var(--color-gold-soft);
}

/* Fotos editables: marco punteado dorado + lápiz centrado al pasar el mouse */
.is-edit-mode [data-edit-photo] {
  position: relative;
  cursor: pointer;
}

.is-edit-mode [data-edit-photo]::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 2px dashed transparent;
  border-radius: 6px;
  transition: border-color var(--ease-out) 150ms, background-color var(--ease-out) 150ms;
  z-index: 2;
  pointer-events: none;
}

.is-edit-mode [data-edit-photo]::after {
  content: "✏️ Cambiar foto";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #ffffff;
  background: rgba(11, 11, 12, 0.75);
  border: 1px solid var(--color-gold);
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  opacity: 0;
  transition: opacity var(--ease-out) 150ms;
  z-index: 3;
  pointer-events: none;
}

.is-edit-mode [data-edit-photo]:hover::before {
  border-color: var(--color-gold);
  background: rgba(11, 11, 12, 0.35);
}

.is-edit-mode [data-edit-photo]:hover::after {
  opacity: 1;
}

/* Banner de bienvenida al modo edición */
.edit-welcome {
  position: fixed;
  top: var(--space-sm);
  left: 50%;
  transform: translateX(-50%);
  z-index: 250;
  max-width: 92vw;
  width: 460px;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-gold);
  border-radius: 10px;
  padding: var(--space-sm) var(--space-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  display: flex;
  gap: var(--space-sm);
  align-items: flex-start;
}

.edit-welcome p {
  font-size: 0.88rem;
  color: var(--color-text);
  line-height: 1.5;
}

.edit-welcome strong {
  color: var(--color-gold);
}

.edit-welcome-close {
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  flex: none;
}

/* Toast de confirmación */
.edit-toast {
  position: fixed;
  bottom: var(--space-sm);
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  z-index: 300;
  background: var(--color-gold);
  color: #0b0b0c;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.7rem 1.2rem;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--ease-out) 200ms, transform var(--ease-out) 200ms;
}

.edit-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.edit-toast.is-error {
  background: #d64a3c;
  color: #ffffff;
}

/* Agregar / borrar servicios */
.service-card {
  position: relative;
}

.is-edit-mode .service-card-delete {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--color-border-strong);
  background: var(--color-bg);
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
  z-index: 4;
}

.is-edit-mode .service-card-delete:hover {
  border-color: #d64a3c;
  color: #ff9a90;
}

.service-card-add {
  border: 1px dashed var(--color-border-strong);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.95rem;
}

.service-card-add:hover {
  border-color: var(--color-gold);
  color: var(--color-gold);
}

/* Agregar / borrar fotos de la galería (mismo patrón que los servicios) */
.gallery-item-add {
  border: 1px dashed var(--color-border-strong);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.95rem;
  width: 100%;
}

.gallery-item-add:hover {
  border-color: var(--color-gold);
  color: var(--color-gold);
}

.is-edit-mode .gallery-item-delete {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--color-border-strong);
  background: rgba(11, 11, 12, 0.7);
  color: #ffffff;
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
  z-index: 5;
}

.is-edit-mode .gallery-item-delete:hover {
  border-color: #d64a3c;
  color: #ff9a90;
}

/* Ventana simple para subir/reemplazar foto */
.edit-photo-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 6, 7, 0.8);
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-sm);
}

.edit-photo-modal {
  width: 100%;
  max-width: 420px;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-gold);
  border-radius: 10px;
  padding: var(--space-md);
  display: grid;
  gap: var(--space-sm);
}

.edit-photo-modal h3 {
  font-family: var(--font-sans);
  text-transform: none;
  font-size: 1.05rem;
}

.edit-photo-preview {
  width: 100%;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  display: block;
}

.edit-photo-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}
