:root {
  --teal-deep: #0F5C4E;
  --teal-mid: #16785F;
  --mint-bg: #F1F7F3;
  --cream: #FBFAF6;
  --coral: #E15B3F;
  --coral-soft: #FCE6DF;
  --ink: #1D2B26;
  --ink-soft: #52655D;
  --line: #DCE7E0;
  --radius: 10px;
  --shadow: 0 4px 16px rgba(15,92,78,0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--ink);
  background: var(--cream);
  line-height: 1.55;
}
h1, h2, h3, h4 {
  font-family: 'Bitter', Georgia, serif;
  color: var(--teal-deep);
  margin: 0 0 0.5em;
  line-height: 1.25;
}
a { color: var(--teal-mid); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
.container { max-width: 1160px; margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
  background: var(--teal-deep);
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}
.header-inner {
  max-width: 1160px; margin: 0 auto; padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between;
}
.logo { display: flex; align-items: center; gap: 10px; color: #fff; font-family: 'Bitter', serif; font-weight: 700; font-size: 1.3rem; }
.logo:hover { text-decoration: none; }
.logo-mark { color: var(--coral); display: inline-flex; }
.logo-text em { font-style: normal; color: var(--coral); }
.main-nav { display: flex; gap: 26px; }
.main-nav a { color: #EAF3EF; font-weight: 600; font-size: 0.95rem; }
.main-nav a:hover { color: #fff; text-decoration: none; }
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 6px; }
.nav-toggle span { width: 24px; height: 2.5px; background: #fff; border-radius: 2px; transition: 0.25s; }

/* Hero */
.hero {
  background: linear-gradient(160deg, var(--teal-deep) 0%, var(--teal-mid) 100%);
  color: #fff; padding: 56px 20px 64px; text-align: center;
}
.hero h1 { color: #fff; font-size: clamp(1.7rem, 4vw, 2.6rem); margin-bottom: 0.4em; }
.hero p { color: #DCEFE7; max-width: 640px; margin: 0 auto 28px; font-size: 1.05rem; }
.search-box {
  max-width: 560px; margin: 0 auto; display: flex; background: #fff; border-radius: 50px; padding: 6px; box-shadow: var(--shadow);
}
.search-box input {
  flex: 1; border: none; outline: none; padding: 12px 18px; font-size: 1rem; border-radius: 50px; font-family: inherit;
}
.search-box button {
  background: var(--coral); color: #fff; border: none; padding: 0 26px; border-radius: 50px; font-weight: 700; cursor: pointer; font-family: inherit;
}
.search-box button:hover { background: #C74A31; }

/* Turno ticker */
.turno-ticker {
  background: var(--coral-soft); border-bottom: 1px solid #F3C9BA; padding: 10px 20px; text-align: center; font-size: 0.9rem; color: #8A3520; font-weight: 600;
}

/* Sections */
.section { padding: 48px 0; }
.section-title { text-align: center; margin-bottom: 34px; }
.section-title p { color: var(--ink-soft); max-width: 560px; margin: 8px auto 0; }

/* Region grid */
.grid-regions {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px,1fr)); gap: 20px;
}
.region-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; text-align: center;
  transition: transform 0.18s, box-shadow 0.18s;
}
.region-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); text-decoration: none; }
.region-card .cross-icon { color: var(--coral); margin-bottom: 10px; }
.region-card h3 { margin-bottom: 4px; font-size: 1.15rem; }
.region-card span { color: var(--ink-soft); font-size: 0.88rem; }

/* Region detail */
.region-hero { display: flex; gap: 34px; align-items: center; flex-wrap: wrap; padding: 40px 0; }
.region-hero img { width: 220px; border-radius: var(--radius); border: 1px solid var(--line); }
.region-hero .region-text { flex: 1; min-width: 260px; }

.grid-cities { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 16px; }
.city-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; align-items: center; justify-content: space-between;
}
.city-card:hover { border-color: var(--teal-mid); text-decoration: none; box-shadow: var(--shadow); }
.city-card h4 { margin: 0; font-size: 1.05rem; color: var(--ink); }
.city-card .count { color: var(--ink-soft); font-size: 0.85rem; }

/* City page: filter bar */
.filter-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 26px; }
.filter-toggle {
  display: inline-flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); padding: 10px 16px; border-radius: 50px; cursor: pointer; font-weight: 600; font-size: 0.9rem; font-family: inherit;
}
.filter-toggle.active { background: var(--coral); border-color: var(--coral); color: #fff; }

/* Pharmacy list */
.grid-pharmacies { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px,1fr)); gap: 20px; }
.pharmacy-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; position: relative; box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}
.pharmacy-card:hover { box-shadow: var(--shadow); text-decoration: none; }
.pharmacy-card h3 { font-size: 1.08rem; margin-bottom: 6px; }
.pharmacy-card .addr { color: var(--ink-soft); font-size: 0.88rem; margin-bottom: 10px; }
.pharmacy-card .rating { color: var(--teal-mid); font-weight: 700; font-size: 0.9rem; }
.badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: 0.72rem; font-weight: 700; padding: 4px 10px; border-radius: 50px; margin-bottom: 8px; letter-spacing: 0.02em;
}
.badge-24h { background: var(--teal-deep); color: #fff; }
.badge-turno { background: var(--coral); color: #fff; }
.badge::before { content: ''; width: 6px; height: 6px; background: #fff; border-radius: 50%; display: inline-block; }

/* Pharmacy detail */
.detail-header { padding: 40px 0 20px; }
.detail-header h1 { font-size: 1.9rem; }
.detail-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 32px; padding-bottom: 50px; }
.detail-main { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; }
.detail-main h2 { font-size: 1.15rem; margin-top: 1.3em; }
.services-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; }
.services-list li { padding-left: 22px; position: relative; font-size: 0.92rem; }
.services-list li::before {
  content: ''; position: absolute; left: 0; top: 6px; width: 10px; height: 10px;
  background: var(--teal-mid); border-radius: 2px;
}
.detail-side { display: flex; flex-direction: column; gap: 18px; }
.info-box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.info-box h4 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft); margin-bottom: 10px; }
.info-box p { margin: 0 0 8px; font-size: 0.94rem; }
.info-box iframe { width: 100%; border: none; border-radius: 8px; margin-top: 8px; }
.btn-map {
  display: block; text-align: center; background: var(--teal-deep); color: #fff; padding: 12px; border-radius: 50px; font-weight: 700; margin-top: 10px;
}
.btn-map:hover { background: var(--teal-mid); text-decoration: none; }

/* Static pages */
.static-page { padding: 50px 0; max-width: 760px; margin: 0 auto; }
.static-page h2 { font-size: 1.5rem; }

/* Footer */
.site-footer { background: #10241E; color: #C9D9D2; margin-top: 40px; }
.footer-inner { max-width: 1160px; margin: 0 auto; padding: 40px 20px 20px; display: flex; justify-content: space-between; gap: 30px; flex-wrap: wrap; }
.footer-brand { max-width: 320px; }
.footer-brand span { display: inline-flex; align-items: center; gap: 8px; font-family: 'Bitter', serif; font-weight: 700; color: #fff; font-size: 1.15rem; }
.footer-brand em { font-style: normal; color: var(--coral); }
.footer-brand p { font-size: 0.88rem; margin-top: 10px; color: #9FB5AC; }
.footer-links { display: flex; flex-direction: column; gap: 10px; }
.footer-links a { color: #C9D9D2; font-size: 0.92rem; }
.footer-links a:hover { color: #fff; }
.footer-bottom { text-align: center; padding: 16px 20px; border-top: 1px solid #1D3A32; font-size: 0.8rem; color: #7C9389; }

/* Admin */
.admin-body { background: var(--mint-bg); }
.admin-shell { max-width: 1100px; margin: 30px auto; padding: 0 20px; }
.admin-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; margin-bottom: 22px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.admin-table th, .admin-table td { text-align: left; padding: 10px; border-bottom: 1px solid var(--line); }
.admin-table th { color: var(--ink-soft); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 700; margin-bottom: 6px; font-size: 0.88rem; }
.form-group input[type=text], .form-group input[type=tel], .form-group input[type=number], .form-group textarea, .form-group select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; font-family: inherit; font-size: 0.95rem;
}
.form-group textarea { min-height: 80px; }
.btn {
  display: inline-block; background: var(--teal-deep); color: #fff; border: none; padding: 11px 22px; border-radius: 6px; font-weight: 700; cursor: pointer; font-family: inherit; font-size: 0.92rem;
}
.btn:hover { background: var(--teal-mid); text-decoration: none; }
.btn-outline { background: none; border: 1px solid var(--teal-deep); color: var(--teal-deep); }
.btn-danger { background: var(--coral); }
.btn-danger:hover { background: #C74A31; }
.tag-status { padding: 3px 10px; border-radius: 50px; font-size: 0.75rem; font-weight: 700; }
.tag-published { background: #DFF3E8; color: #1B7A4D; }
.tag-draft { background: #F0E9D8; color: #8A6B1E; }
.login-box { max-width: 380px; margin: 90px auto; background: #fff; border-radius: var(--radius); padding: 34px; box-shadow: var(--shadow); }
.alert { padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; font-size: 0.9rem; }
.alert-success { background: #DFF3E8; color: #1B7A4D; }
.alert-error { background: var(--coral-soft); color: #8A3520; }

/* Responsive */
@media (max-width: 860px) {
  .detail-grid { grid-template-columns: 1fr; }
  .region-hero { flex-direction: column; text-align: center; }
}
@media (max-width: 720px) {
  .main-nav {
    position: absolute; top: 100%; left: 0; right: 0; background: var(--teal-deep);
    flex-direction: column; padding: 0; max-height: 0; overflow: hidden; transition: max-height 0.25s ease;
  }
  .main-nav.open { max-height: 300px; padding: 10px 0; }
  .main-nav a { padding: 12px 24px; }
  .nav-toggle { display: flex; }
  .services-list { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; }
}
@media (max-width: 480px) {
  .hero { padding: 40px 16px 48px; }
  .search-box { flex-direction: column; border-radius: 14px; gap: 6px; }
  .search-box button { padding: 12px; border-radius: 10px; }
  .search-box input { border-radius: 10px; }
}
