:root {
  --bg: #f4f1ea;
  --surface: #fffcf7;
  --fg: #1c2822;
  --muted: #5d6b63;
  --primary: #3d6b54;
  --primary-hover: #315846;
  --on-primary: #f7faf8;
  --soft: #e7f0ea;
  --accent: #8a6840;
  --border: #e3dbd0;
  --danger: #8d3b3b;
  --danger-soft: #f8e8e6;
  --ink: #24312b;
  --sans: "Source Sans 3", "Segoe UI", sans-serif;
  --display: Fraunces, "Times New Roman", serif;
  --header-h: 3.5rem;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  line-height: 1.55;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
a { color: inherit; }
img { display: block; max-width: 100%; }

.wrap { width: min(64rem, calc(100% - 2rem)); margin: 0 auto; }
.display { font-family: var(--display); font-weight: 520; letter-spacing: -0.02em; }
.muted { color: var(--muted); }
.kicker {
  margin: 0;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--surface) 95%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.bar, .today-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0;
}
/* Compact sticky bar: fixed height = --header-h (brand + nav only). */
.top .bar { height: var(--header-h); padding: 0; flex-wrap: nowrap; }
.brand { font-family: var(--display); font-size: 1.15rem; text-decoration: none; white-space: nowrap; }
.nav { display: flex; gap: 0.25rem; font-size: 0.95rem; font-weight: 650; }
.nav a { display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0 0.6rem; text-decoration: none; white-space: nowrap; }
.top .brand { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 480px) {
  .bar { gap: 0.25rem; }
  .brand { font-size: 0.95rem; }
  .nav { gap: 0; font-size: 0.85rem; }
  .nav a { padding: 0 0.35rem; }
}
@media (max-width: 340px) {
  .brand { font-size: 0.85rem; }
  .nav { font-size: 0.8rem; }
  .nav a { padding: 0 0.25rem; }
}
.today-bar {
  border-top: 1px solid var(--border);
  background: var(--soft);
}
.today-bar .display { margin: 0; font-size: clamp(1.25rem, 2vw, 1.6rem); }
.short { display: none; }
@media (max-width: 640px) {
  .long { display: none; }
  .short { display: inline; }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0 1.1rem;
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none;
  background: var(--primary);
  color: var(--on-primary);
}
.btn:hover { background: var(--primary-hover); }
.btn.ghost { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn:disabled { opacity: 0.55; }

/* Full-width landscape, softened into the warm page background. */
.hero {
  padding: clamp(3rem, 6vw, 5rem) 0 4rem;
  min-height: 29rem;
  display: flex;
  align-items: center;
  background-image:
    linear-gradient(to bottom, rgb(244 241 234 / 12%) 55%, var(--bg) 100%),
    linear-gradient(90deg, rgb(244 241 234 / 93%) 0%, rgb(244 241 234 / 82%) 38%, rgb(244 241 234 / 40%) 100%),
    url("cerro-chiquihuite.jpg");
  background-size: cover;
  background-position: center, center, center 45%;
  background-repeat: no-repeat;
}
.hero-content { position: relative; }
@media (max-width: 640px) {
  .hero {
    min-height: 27rem;
    background-image:
      linear-gradient(to bottom, rgb(244 241 234 / 81%) 0%, rgb(244 241 234 / 76%) 65%, var(--bg) 100%),
      url("cerro-chiquihuite.jpg");
    background-position: center, 42% center;
  }
}
.hero h1 { margin: 0.4rem 0 0; font-size: clamp(2.2rem, 5vw, 3.2rem); max-width: 16ch; }
.hero p { max-width: 38rem; font-size: 1.125rem; }

.services { padding: 1.5rem 0; }
.grid-3 { display: grid; gap: 1rem; }
@media (min-width: 800px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  overflow: hidden;
  box-shadow: 0 1px 2px rgb(36 49 43 / 4%);
}
.card img { height: 11rem; width: 100%; object-fit: cover; }
.card .pad, .pad { padding: 1.1rem 1.15rem 1.25rem; }
.card h3 { margin: 0; font-size: 1.35rem; }

.section-head, .admin-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.steps { display: flex; gap: 0.4rem; list-style: none; padding: 0; margin: 0; font-size: 0.9rem; }
.steps li { border-radius: 999px; padding: 0.25rem 0.7rem; background: var(--surface); color: var(--muted); }
.steps li.on { background: var(--primary); color: var(--on-primary); }
.steps li.done { background: var(--soft); color: var(--primary); }

.notice {
  margin: 0 0 1rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--surface);
}
.cal-grid { display: grid; gap: 1rem; }
@media (min-width: 900px) { .cal-grid { grid-template-columns: 1.1fr 0.9fr; } }
.month {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.icon-btn {
  width: 2.75rem;
  height: 2.75rem;
  border: 0;
  border-radius: 999px;
  background: var(--soft);
  color: var(--primary);
}
.week, .days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.25rem; }
.week { text-align: center; font-size: 0.75rem; font-weight: 650; color: var(--muted); }
.day {
  min-height: 2.75rem;
  border: 0;
  border-radius: 0.8rem;
  background: var(--bg);
  color: var(--fg);
}
.day small { display: block; font-size: 0.65rem; line-height: 1; color: var(--primary); }
.day.closed { color: color-mix(in srgb, var(--muted) 50%, transparent); background: transparent; }
.day.selected { background: var(--primary); color: var(--on-primary); }
.day.selected small { color: var(--on-primary); }
.day.today:not(.selected) { box-shadow: inset 0 0 0 2px var(--primary); }
.hours { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
@media (min-width: 640px) { .hours { grid-template-columns: repeat(4, 1fr); } }
.hour {
  min-height: 2.75rem;
  border-radius: 0.8rem;
  border: 1px solid var(--border);
  background: var(--surface);
}
.hour.on { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.hour.busy { color: var(--muted); text-decoration: line-through; background: var(--bg); }

.form-grid { display: grid; gap: 0.9rem; }
@media (min-width: 700px) { .form-grid { grid-template-columns: 1fr 1fr; } }
label { display: block; font-size: 0.92rem; font-weight: 650; }
input, select, textarea {
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.7rem 0.8rem;
  border-radius: 0.8rem;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg);
}
.span-2 { grid-column: 1 / -1; }
.error { color: var(--danger); font-size: 0.92rem; }
.ok { color: var(--primary); font-size: 0.92rem; }

.confirm {
  margin-top: 1rem;
  padding: 1.4rem;
  border-radius: 1.25rem;
  border: 1px solid var(--primary);
  background: var(--soft);
}
.confirm h3 { margin: 0.2rem 0; font-size: 2rem; }

.mine { display: grid; gap: 0.7rem; }
.mine li, .rows li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 0.8rem 1rem;
}
.pill {
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
  background: var(--soft);
  color: var(--primary);
  font-size: 0.9rem;
}
.pill.now { background: var(--primary); color: var(--on-primary); }

.contact {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}
@media (min-width: 700px) { .contact { grid-template-columns: 1fr 1fr; } }

.foot {
  margin-top: 2rem;
  background: var(--ink);
  color: var(--on-primary);
}
.foot .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.7rem;
  padding: 1.3rem 0;
  font-size: 0.92rem;
}
.foot a { color: inherit; opacity: 0.85; }

.admin {
  width: min(46rem, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 3rem;
}
.login {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: min(28rem, calc(100% - 2rem));
  margin: 0 auto;
}
.rows { list-style: none; padding: 0; margin: 0.6rem 0 0; }
.rows li { background: transparent; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; }
.checks { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.check {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.75rem;
  padding: 0 0.7rem;
  border: 1px solid var(--border);
  border-radius: 0.8rem;
  font-weight: 550;
}
.check input { width: auto; margin: 0; }
.stack { display: grid; gap: 0.7rem; max-width: 22rem; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

[hidden] { display: none !important; }
section, form, #horarios { scroll-margin-top: calc(var(--header-h) + 1rem); }
.hero { scroll-margin-top: 0; }
h3[tabindex="-1"]:focus { outline: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #8a6840; outline-offset: 3px; }
#reintentar { margin-bottom: 1rem; }
