/* =====================
   VARIABLES & RESET
   ===================== */
:root {
  --green:        #3a6b4a;
  --green-dark:   #274d35;
  --green-light:  #eaf2ec;
  --accent:       #c8873a;
  --success:      #2d6a4f;
  --success-bg:   #d8f3dc;
  --error:        #b91c1c;
  --error-bg:     #fef2f2;
  --text:         #1c1c1e;
  --text-soft:    #3d3d3f;
  --text-muted:   #6b7280;
  --border:       #e4e8e2;
  --bg:           #f5f4f0;
  --white:        #ffffff;
  --radius:       14px;
  --radius-sm:    8px;
  --shadow:       0 1px 3px rgba(0,0,0,.05), 0 4px 14px rgba(0,0,0,.07);
  --shadow-hover: 0 2px 6px rgba(0,0,0,.07), 0 14px 40px rgba(0,0,0,.12);

  --serif: 'Fraunces', Georgia, serif;
  --sans:  'Inter', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--green); }

/* =====================
   LAYOUT
   ===================== */
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

main.container { flex: 1; padding-top: calc(var(--header-h, 85px) + var(--filters-h, 53px)); padding-bottom: 5rem; transition: padding-right 100ms ease-out; }
body.panel-open:not(.map-view) main.container { max-width: none; margin-left: max(0px, calc((100vw - 1080px) / 2)); margin-right: 460px; padding-right: 40px; }

/* =====================
   HEADER — fixed, 2 rows
   ===================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1100;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 8px rgba(0,0,0,.06);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .5rem 0;
}

.header-right {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.site-header .logo-capao { color: var(--text); }
.site-header .logo-vivo  { color: var(--green); }

/* =====================
   LOGO — Capão Vivo
   ===================== */
.logo {
  text-decoration: none;
  display: inline-flex;
  align-items: baseline;
  gap: 0;
  line-height: 1;
}

.logo-capao {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.5rem;
  font-style: normal;
  color: rgba(255,255,255,.95);
  letter-spacing: -.02em;
}

.logo-vivo {
  font-family: var(--serif);
  font-weight: 600;
  font-style: italic;
  font-size: 1.5rem;
  color: #cde9a4;
  letter-spacing: -.02em;
  margin-left: .22em;
}

.logo:hover .logo-vivo { color: #e0f5bc; }
.site-header .logo:hover .logo-vivo { color: var(--green-dark); }

/* Nav CTA */
.nav-cta {
  font-family: var(--sans);
  font-style: normal;
  font-weight: 500;
  font-size: .82rem;
  color: var(--white);
  text-decoration: none;
  background: var(--green);
  border: none;
  border-radius: 50px;
  padding: .45rem 1rem;
  white-space: nowrap;
  transition: background .18s, box-shadow .18s;
}

.nav-cta:hover { background: var(--green-dark); }


.search-bar {
  position: relative;
  max-width: 380px;
  flex: 1;
}

.search-icon {
  position: absolute;
  left: .9rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  color: #9ca3af;
  pointer-events: none;
  line-height: 1;
}

.search-bar input {
  width: 100%;
  padding: .45rem 1rem .45rem 2.4rem;
  border: 1px solid var(--border);
  border-radius: 50px;
  font-size: .85rem;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}

.search-bar input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(58,107,74,.1);
  background: var(--white);
}

.search-bar input::placeholder { color: #9ca3af; }


/* =====================
   FILTERS — sticky
   ===================== */
.filters {
  background: rgba(245,244,240,.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: .65rem 0;
  position: fixed;
  top: var(--header-h, 85px);
  left: 0;
  right: 0;
  z-index: 1000;
}

.filter-buttons {
  display: flex;
  gap: .35rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  flex: 1;
  min-width: 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 2px; /* espacio para el foco visible */
}

.filter-buttons::-webkit-scrollbar { display: none; }

.filter-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .38rem .6rem;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 50px;
  cursor: pointer;
  font-family: var(--sans);
  font-style: normal;
  font-weight: 500;
  font-size: .8rem;
  color: var(--text-soft);
  transition: all .15s;
  letter-spacing: 0;
  white-space: nowrap;
}

.filter-btn svg { flex-shrink: 0; }
.filter-btn:hover  { color: var(--green); border-color: var(--green); }
.filter-btn.active {
  background: var(--green);
  border-color: var(--green);
  color: var(--white);
  font-weight: 500;
}

/* =====================
   SECTION HEADER
   ===================== */
.section-header {
  padding: .75rem 0 0 1.1rem;
  border-left: 3px solid var(--green);
  margin-bottom: 0;
  scroll-margin-top: calc(var(--header-h, 85px) + var(--filters-h, 53px));
}

.section-eyebrow {
  font-family: var(--sans);
  font-size: .63rem;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0;
}

.section-title {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(1.5rem, 4vw, 2.4rem);
  line-height: 1.1;
  color: var(--text);
  letter-spacing: -.025em;
  margin-bottom: 0;
}

.section-meta {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: .875rem;
  color: var(--text-muted);
  letter-spacing: .01em;
}

/* =====================
   SERVICES GRID
   ===================== */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.1rem;
  margin-top: 1.5rem;
}

@media (max-width: 960px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); }
}

.service-card {
  background: rgba(255,255,255,.78);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border: 1px solid rgba(255,255,255,.8);
  border-radius: var(--radius);
  padding: 1.4rem;
  box-shadow: var(--shadow);
  transition: box-shadow .22s, transform .22s, background .22s;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
  .service-card:hover {
    background: rgba(255,255,255,.97);
    box-shadow: var(--shadow-hover);
    transform: translateY(-3px);
  }
}

.card-category {
  font-family: var(--serif);
  font-style: italic;
  font-size: .78rem;
  font-weight: 300;
  color: var(--green);
  opacity: .9;
  width: fit-content;
  letter-spacing: .01em;
}

.card-title {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--text);
  line-height: 1.2;
  letter-spacing: -.01em;
}

.card-description {
  font-family: var(--sans);
  font-size: .82rem;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.65;
}

.card-contacts {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: .45rem;
  padding-top: .75rem;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.contact-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  transition: opacity .15s, transform .15s;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
  .contact-btn:hover { opacity: .85; transform: translateY(-1px); }
}

.contact-wa {
  background: #25d366;
  color: #fff;
}

.contact-wa::before {
  content: '';
  display: block;
  width: 16px;
  height: 16px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347z'/%3E%3Cpath d='M12 0C5.373 0 0 5.373 0 12c0 2.127.558 4.126 1.534 5.857L.057 23.428a.75.75 0 00.916.916l5.57-1.477A11.95 11.95 0 0012 24c6.627 0 12-5.373 12-12S18.627 0 12 0zm0 22c-1.853 0-3.587-.5-5.084-1.375l-.361-.214-3.743.992.992-3.742-.215-.362A9.938 9.938 0 012 12C2 6.477 6.477 2 12 2s10 4.477 10 10-4.477 10-10 10z'/%3E%3C/svg%3E") no-repeat center / contain;
}

.contact-ig {
  background: linear-gradient(135deg, #f58529 0%, #dd2a7b 50%, #8134af 100%);
  color: #fff;
}

.contact-ig::before {
  content: '';
  display: block;
  width: 16px;
  height: 16px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zm0-2.163c-3.259 0-3.667.014-4.947.072-4.358.2-6.78 2.618-6.98 6.98-.059 1.281-.073 1.689-.073 4.948 0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98 1.281.058 1.689.072 4.948.072 3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98-1.281-.059-1.69-.073-4.949-.073zm0 5.838a6.162 6.162 0 100 12.324 6.162 6.162 0 000-12.324zM12 16a4 4 0 110-8 4 4 0 010 8zm6.406-11.845a1.44 1.44 0 100 2.881 1.44 1.44 0 000-2.881z'/%3E%3C/svg%3E") no-repeat center / contain;
}

/* =====================
   STATES
   ===================== */
.loading-state, .empty-state {
  text-align: center;
  padding: 5rem 1rem;
  color: var(--text-muted);
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.05rem;
}

.empty-state { display: flex; flex-direction: column; align-items: center; gap: 1.25rem; }

/* =====================
   BUTTONS
   ===================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .65rem 1.4rem;
  border-radius: var(--radius-sm);
  font-family: var(--sans);
  font-size: .85rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  border: 1.5px solid transparent;
  transition: all .18s;
  white-space: nowrap;
}

.btn-primary {
  background: var(--green);
  color: var(--white);
  border-color: var(--green);
}
.btn-primary:hover { background: var(--green-dark); border-color: var(--green-dark); }

.btn-outline {
  background: transparent;
  color: var(--green);
  border-color: var(--green);
}
.btn-outline:hover { background: var(--green-light); }

.btn-success {
  background: var(--success);
  color: var(--white);
  border-color: var(--success);
  padding: .38rem .85rem;
  font-size: .78rem;
}

.btn-danger {
  background: var(--error);
  color: var(--white);
  border-color: var(--error);
  padding: .38rem .85rem;
  font-size: .78rem;
}

.btn-full { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* =====================
   PAGE HEADER (registro/admin)
   ===================== */
.page-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.page-header .logo-capao { color: var(--text); }
.page-header .logo-vivo  { color: var(--green); }
.page-header .header-inner { justify-content: space-between; }

/* =====================
   FORMS
   ===================== */
.form-page { padding-top: 2.5rem; padding-bottom: 3rem; }

.form-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.25rem;
  max-width: 660px;
  margin: 0 auto;
  box-shadow: var(--shadow);
}

.form-card h2 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: 2rem;
  line-height: 1.15;
  margin-bottom: .4rem;
  color: var(--text);
}

.form-card h2 em {
  font-style: italic;
  color: var(--green);
}

.form-subtitle {
  color: var(--text-muted);
  margin-bottom: 2rem;
  font-size: .875rem;
  line-height: 1.6;
}

.form-section { margin-bottom: 1.75rem; }

.form-section h3 {
  font-family: var(--sans);
  font-size: .7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  padding-bottom: .5rem;
  margin-bottom: 1.1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  margin-bottom: 1rem;
  position: relative;
}

.form-group label {
  font-size: .8rem;
  font-weight: 500;
  color: var(--text-soft);
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

input, select, textarea {
  padding: .7rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-family: var(--sans);
  color: var(--text);
  background: var(--white);
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(58,107,74,.1);
}

input.invalid, select.invalid, textarea.invalid { border-color: var(--error); }
textarea { resize: vertical; min-height: 110px; }
.char-count { font-size: .72rem; color: var(--text-muted); text-align: right; }

/* =====================
   ALERTS
   ===================== */
.alert {
  padding: .9rem 1.1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.1rem;
  font-size: .875rem;
  line-height: 1.5;
}

.alert-success { background: var(--success-bg); color: var(--success); border: 1px solid #b7e4c7; }
.alert-error   { background: var(--error-bg); color: var(--error); border: 1px solid #fecaca; }

/* =====================
   ADMIN PANEL
   ===================== */
.admin-tabs {
  display: flex;
  gap: 0;
  margin: 2rem 0 1.5rem;
  border-bottom: 1px solid var(--border);
}

.tab-btn {
  padding: .6rem 1.2rem;
  background: none;
  border: none;
  font-family: var(--serif);
  font-style: italic;
  font-size: .95rem;
  font-weight: 300;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  display: flex;
  align-items: center;
  gap: .45rem;
  transition: color .15s;
}

.tab-btn.active {
  color: var(--green);
  border-bottom-color: var(--green);
  font-style: normal;
  font-weight: 400;
}

.tab-btn:hover { color: var(--green); }

.badge {
  background: var(--accent);
  color: var(--white);
  font-family: var(--sans);
  font-style: normal;
  font-size: .65rem;
  font-weight: 600;
  padding: .1rem .45rem;
  border-radius: 50px;
  min-width: 18px;
  text-align: center;
}

.admin-list { display: flex; flex-direction: column; gap: .9rem; padding-bottom: 4rem; }

.admin-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
  box-shadow: var(--shadow);
}

.admin-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.admin-card-meta { display: flex; flex-direction: column; gap: .2rem; }

.admin-card-meta h3 {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 400;
  line-height: 1.25;
}

.admin-card-meta .meta-row {
  font-size: .78rem;
  color: var(--text-muted);
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.admin-card-actions { display: flex; gap: .45rem; flex-shrink: 0; }

.admin-card-body {
  margin-top: .9rem;
  padding-top: .9rem;
  border-top: 1px solid var(--border);
  font-size: .875rem;
  color: var(--text-muted);
  white-space: pre-wrap;
  line-height: 1.6;
}

.status-badge { font-size: .7rem; font-weight: 500; padding: .2rem .65rem; border-radius: 50px; }
.status-pending  { background: #fff7ed; color: #c2410c; }
.status-approved { background: var(--success-bg); color: var(--success); }
.status-rejected { background: var(--error-bg); color: var(--error); }

.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
  margin-bottom: 4rem;
}
.stats-table th,
.stats-table td {
  padding: .6rem .9rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.stats-table th {
  font-weight: 500;
  font-size: .78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  background: var(--bg);
}
.stats-table tr:last-child td { border-bottom: none; }
.stats-table td:nth-child(3),
.stats-table td:nth-child(4),
.stats-table td:nth-child(5),
.stats-table th:nth-child(3),
.stats-table th:nth-child(4),
.stats-table th:nth-child(5) { text-align: right; }
.stats-table strong { color: var(--text); }

/* =====================
   DASHBOARD
   ===================== */
.dash-overview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}
.dash-stat {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .3rem;
  box-shadow: var(--shadow);
}
.dash-stat-num {
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 600;
  color: var(--green);
  line-height: 1;
}
.dash-stat-label {
  font-size: .8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.dash-section {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}
.dash-section-title {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1rem;
}
.dash-section .stats-table { margin-bottom: 0; }
.dash-chart { display: flex; flex-direction: column; gap: .35rem; }
.dash-bar-row {
  display: grid;
  grid-template-columns: 70px 1fr 36px;
  align-items: center;
  gap: .6rem;
  font-size: .78rem;
}
.dash-bar-date { color: var(--text-muted); white-space: nowrap; }
.dash-bar-track {
  background: var(--green-light);
  border-radius: 4px;
  height: 14px;
  overflow: hidden;
}
.dash-bar-fill {
  height: 100%;
  background: var(--green);
  border-radius: 4px;
  transition: width .3s ease;
}
.dash-bar-count { color: var(--text-soft); text-align: right; }
.dash-contact-yes {
  display: inline-block;
  background: var(--success-bg);
  color: var(--success);
  font-size: .7rem;
  font-weight: 500;
  padding: .15rem .5rem;
  border-radius: 50px;
}
@media (max-width: 600px) {
  .dash-overview { grid-template-columns: 1fr; }
}

/* =====================
   FOOTER
   ===================== */
.site-footer {
  background: var(--text);
  padding: 2rem 1.5rem;
  margin-top: auto;
}

.footer-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-brand {
  font-family: var(--serif);
  font-weight: 300;
  font-size: .95rem;
  color: rgba(255,255,255,.7);
}

.footer-brand em {
  font-style: italic;
  font-weight: 400;
  color: #cde9a4;
  margin-left: .2em;
}

.footer-tagline {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: .85rem;
  color: rgba(255,255,255,.4);
  flex: 1;
}

.admin-link {
  font-size: .72rem;
  font-family: var(--sans);
  color: rgba(255,255,255,.2);
  text-decoration: none;
  letter-spacing: .06em;
}
.admin-link:hover { color: rgba(255,255,255,.5); }

/* =====================
   RESPONSIVE
   ===================== */
@media (max-width: 640px) {
  .form-row  { grid-template-columns: 1fr; }
  .form-card { padding: 1.5rem; }
  .services-grid { grid-template-columns: 1fr; }
  .hero-body h2 br { display: none; }
  .footer-tagline { display: none; }
}

/* =====================
   HEADER NAV
   ===================== */
.site-header nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.page-header nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

/* =====================
   LANGUAGE TOGGLE
   ===================== */
.lang-toggle {
  display: flex;
  background: var(--green-light);
  border-radius: 50px;
  padding: 2px;
}

.lang-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--sans);
  font-size: .65rem;
  font-weight: 500;
  letter-spacing: .08em;
  padding: .28rem .55rem;
  border-radius: 50px;
  cursor: pointer;
  transition: all .15s;
  line-height: 1;
}

.lang-btn.active {
  background: var(--green);
  color: var(--white);
}

.lang-btn:hover:not(.active) { color: var(--green); }

/* page-header variant (light bg) */
.page-header .lang-toggle { background: var(--green-light); }
.page-header .lang-btn    { color: var(--text-muted); }
.page-header .lang-btn.active { background: var(--green); color: var(--white); }
.page-header .lang-btn:hover:not(.active) { color: var(--green); }

/* =====================
   FILTER SCROLL ARROWS
   ===================== */
.filter-scroll-wrap { display: contents; } /* transparente en desktop */
.filter-arrow       { display: none; }     /* ocultas siempre salvo táctil */

@media (hover: none) and (pointer: coarse) {
  .filter-scroll-wrap {
    display: flex;
    position: relative;
    flex: 1;
    min-width: 0;
    align-items: center;
    align-self: stretch;
    overflow: hidden;
  }
  .filter-buttons { overflow-x: auto; flex: 1; min-width: 0; padding-left: 8px; padding-right: 8px; }

  .filter-arrow {
    display: flex;
    position: absolute;
    top: 0;
    bottom: 0;
    width: 40px;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    z-index: 2;
    font-size: 2.8rem;
    line-height: 1;
    color: var(--text-soft);
    padding: 0;
    transition: color .15s;
    flex-shrink: 0;
  }
  .filter-arrow-left {
    left: 0;
    background: linear-gradient(to right, rgba(245,244,240,1) 55%, transparent);
    display: none; /* oculta hasta que haya scroll */
  }
  .filter-arrow-right {
    right: 0;
    background: linear-gradient(to left, rgba(245,244,240,1) 55%, transparent);
  }
}

/* =====================
   FILTERS INNER
   ===================== */
.filters-inner {
  display: flex;
  align-items: center;
  gap: .75rem;
  justify-content: space-between;
  flex-wrap: nowrap;
}

/* =====================
   VIEW TOGGLE (Lista / Mapa)
   ===================== */
.view-toggle.view-toggle-hdr { display: none; } /* oculto em desktop; mobile-media ativa */

.view-toggle {
  display: flex;
  background: var(--green-light);
  border-radius: 50px;
  padding: 2px;
  flex-shrink: 0;
}

.view-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--sans);
  font-size: .72rem;
  font-weight: 500;
  padding: .3rem .82rem;
  border-radius: 50px;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}

.view-btn.active  { background: var(--green); color: var(--white); }
.view-btn:hover:not(.active) { color: var(--green); }

/* =====================
   CARD PHOTO
   ===================== */
.card-photo {
  margin: -1.4rem -1.4rem .9rem;
  overflow: hidden;
  border-radius: var(--radius) var(--radius) 0 0;
  height: 140px;
  background: var(--green-light);
}

.card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* =====================
   MAP VIEW
   ===================== */
/* Wrapper handles visual styling; never apply overflow:hidden or clip-path
   directly to the Leaflet container or it breaks tile/layer rendering.     */
#map-wrapper {
  display: none;
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 1.5rem;
  box-shadow: var(--shadow);
}

#map-view {
  height: 520px;
  width: 100%;
  min-width: 0;
}

.map-marker {
  width: 36px;
  height: 36px;
  background: var(--green);
  border: 2.5px solid var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(0,0,0,.3);
  cursor: pointer;
  transition: transform .15s;
}

.map-marker:hover { transform: scale(1.14); }

.map-marker--active {
  width: 44px;
  height: 44px;
  font-size: 17px;
  box-shadow: 0 0 0 3px #fff, 0 3px 12px rgba(0,0,0,.45);
  transform: scale(1);
  animation: marker-pop .2s cubic-bezier(.34,1.56,.64,1) both;
}

@keyframes marker-pop {
  from { transform: scale(.7); }
  to   { transform: scale(1); }
}

.map-popup {
  font-family: var(--sans);
  min-width: 155px;
  max-width: 200px;
}

.popup-photo {
  width: 100%;
  height: 86px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 6px;
  display: block;
}

.popup-title {
  display: block;
  font-family: var(--serif);
  font-size: .95rem;
  color: var(--text);
  margin-bottom: 2px;
}

.popup-cat {
  display: block;
  font-size: .72rem;
  color: var(--green);
  font-style: italic;
  margin-bottom: 6px;
}

.popup-wa {
  display: inline-block;
  background: #25d366;
  color: var(--white);
  font-size: .72rem;
  font-weight: 500;
  padding: .28rem .7rem;
  border-radius: 50px;
  text-decoration: none;
}

/* Leaflet overrides */
.leaflet-popup-content-wrapper {
  border-radius: var(--radius-sm) !important;
  box-shadow: var(--shadow-hover) !important;
}

.leaflet-popup-content { margin: 10px 12px !important; }

/* =====================
   PHOTO UPLOAD & GEOLOCATION (registro)
   ===================== */
.photo-status,
.location-status {
  font-size: .78rem;
  margin-top: .35rem;
  display: block;
  min-height: 1.2em;
}

.photo-status.success,
.location-status.success { color: var(--success); }

.photo-status.error,
.location-status.error   { color: var(--error); }

.photo-status.uploading,
.location-status.uploading { color: var(--text-muted); }

.photo-preview {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-top: .5rem;
  border: 1px solid var(--border);
  display: block;
}

.extra-photos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .75rem;
}

.form-note {
  font-size: .78rem;
  color: var(--text-muted);
  margin-bottom: .75rem;
  line-height: 1.5;
}

/* =====================
   RESPONSIVE (additions)
   ===================== */
@media (max-width: 640px) {
  .nav-cta        { font-size: .82rem; }
  #map-view       { height: 380px; }  /* inner Leaflet container */
  .section-eyebrow { display: none; }
  .section-title  { font-size: 1.1rem; }
  .section-header { padding-top: .4rem; padding-bottom: .1rem; }

  /* Header: garantir padding mínimo de 16px */
  .site-header .header-inner { padding-left: 1rem; padding-right: 1rem; }

  /* Panel aberto: cancelar el padding-right e margin-right de desktop y bloquear scroll */
  body.panel-open main.container { padding-right: 1.5rem; margin-right: 0; }
  body.panel-open { overflow: hidden; }

  /* Filters: só os botões de categoria, sem view-toggle */
  .filters .container { padding-left: .75rem; padding-right: .75rem; }
  .filters-inner { gap: .5rem; }
  .filters-inner .view-toggle:not(.view-toggle-hdr) { display: none; }

  /* View-toggle no header: visível só em mobile */
  .view-toggle.view-toggle-hdr { display: flex; }

  /* Botões de filtro menores para mostrar 2-3 parcialmente */
  .filter-btn { padding: .3rem .5rem; font-size: .73rem; gap: .28rem; }
  .filter-btn svg { width: 12px; height: 12px; }
}

@media (max-width: 420px) {
  .nav-cta { display: none; }
  .lang-btn { padding: .25rem .45rem; }
}

/* =====================
   FAB — Adicionar serviço (mobile only)
   ===================== */
.mobile-fab {
  display: none;
}

@media (max-width: 420px) {
  .mobile-fab {
    display: flex;
    position: fixed;
    bottom: 1.5rem;
    right: 1.25rem;
    align-items: center;
    gap: .45rem;
    background: var(--green);
    color: var(--white);
    text-decoration: none;
    border-radius: 50px;
    padding: .6rem 1rem .6rem .85rem;
    font-family: var(--sans);
    font-size: .78rem;
    font-weight: 500;
    box-shadow: 0 4px 20px rgba(0,0,0,.22);
    z-index: 990;
    white-space: nowrap;
    transition: background .18s, box-shadow .18s;
  }
  .mobile-fab:hover { background: var(--green-dark); }
  .mobile-fab-icon {
    font-size: 1.3rem;
    font-weight: 300;
    line-height: 1;
    color: var(--white);
  }
}

/* FAB oculto quando o painel de detalhe está aberto */
body.panel-open .mobile-fab { display: none !important; }

/* =====================
   MAP TOOLTIP
   ===================== */
.map-tooltip-wrap.leaflet-tooltip {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

.map-tooltip-wrap.leaflet-tooltip::before { display: none; }

.map-tooltip {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .38rem .65rem;
  box-shadow: 0 2px 10px rgba(0,0,0,.12);
  white-space: nowrap;
  pointer-events: none;
}

.map-tooltip strong {
  display: block;
  font-family: var(--serif);
  font-size: .85rem;
  font-weight: 400;
  color: var(--text);
  line-height: 1.3;
}

.map-tooltip span {
  display: block;
  font-family: var(--serif);
  font-style: italic;
  font-size: .72rem;
  color: var(--text-muted);
  margin-top: 1px;
}

/* =====================
   MAP SIDE PANEL
   ===================== */
.map-panel {
  position: fixed;
  top: calc(var(--header-h, 85px) + var(--filters-h, 0px));
  right: 0;
  bottom: 0;
  width: 460px;
  background: var(--white);
  box-shadow: -4px 0 32px rgba(0,0,0,.14);
  z-index: 1200;
  transform: translateX(100%);
  visibility: hidden;
  display: flex;
  flex-direction: row;
  overflow: hidden;
}

.map-panel.panel-ready { transition: transform .3s cubic-bezier(.4,0,.2,1), visibility .3s; }
.map-panel.is-open { transform: translateX(0); visibility: visible; }

.map-panel-close {
  width: 36px;
  flex-shrink: 0;
  background: rgba(0,0,0,.035);
  border: none;
  border-right: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 2.8rem;
  line-height: 1;
  transition: background .15s, color .15s;
}

.map-panel-close:hover { background: rgba(0,0,0,.08); color: var(--text); }

.map-panel-body {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.panel-photo {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
}

.panel-info {
  padding: 1.1rem 1.25rem 1.75rem;
}

.panel-cat {
  font-family: var(--serif);
  font-style: italic;
  font-size: .78rem;
  font-weight: 300;
  display: block;
  margin-bottom: .3rem;
  letter-spacing: .01em;
}

.panel-title {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 400;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: .8rem;
  letter-spacing: -.02em;
}

.panel-desc {
  font-size: .84rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 1.25rem;
}

.panel-gallery {
  display: flex;
  gap: .4rem;
  margin-bottom: 1.25rem;
}

.panel-gallery img {
  flex: 1;
  min-width: 0;
  height: 140px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  display: block;
}

.panel-desc-long {
  white-space: pre-line;
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
}

.panel-ver-mapa,
.card-ver-mapa {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .45rem .9rem;
  border: 1.5px solid var(--green);
  border-radius: 999px;
  background: transparent;
  color: var(--green);
  font: 600 .78rem/1 var(--sans);
  cursor: pointer;
  transition: background .15s, color .15s;
  white-space: nowrap;
}

@media (hover: hover) {
  .panel-ver-mapa:hover,
  .card-ver-mapa:hover {
    background: var(--green);
    color: #fff;
  }
}

.map-panel-overlay { display: none; }
.map-panel-peek    { display: none; }

/* Mobile: panel ocupa a tela inteira (modal full-screen) */
@media (max-width: 640px) {
  .panel-gallery img { height: 90px; }

  .map-panel {
    position: fixed;
    top: calc(var(--header-h, 85px) + var(--filters-h, 53px));
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    transform: translateY(100%);
    border-radius: 0;
    box-shadow: none;
    z-index: 1200;          /* acima do overlay (1199) para capturar os cliques */
    flex-direction: column;
  }

  .map-panel.is-open { transform: translateY(0); }
  .map-panel.is-open.map-panel--collapsed { transform: translateY(calc(100% - 72px)); }

  /* Contenido interno: scroll vertical, sin desborde horizontal */
  .map-panel .map-panel-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
    width: 100%;
  }

  .map-panel .panel-photo {
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
  }

  .map-panel .panel-info,
  .map-panel .panel-title,
  .map-panel .panel-desc,
  .map-panel .panel-cat,
  .map-panel .panel-actions {
    max-width: 100%;
    box-sizing: border-box;
    word-break: break-word;
  }

  /* Botón cerrar: flecha hacia abajo, mismo estilo que desktop */
  .map-panel-close {
    width: 100%;
    height: 48px;
    flex-shrink: 0;
    background: var(--text);
    border-right: none;
    border-bottom: none;
    font-size: 0;
    justify-content: center;
  }
  .map-panel-close::before { content: none; }
  .map-panel-close::after {
    content: '›';
    display: inline-block;
    font-size: 3.6rem;
    line-height: 1;
    color: var(--white);
    transform: rotate(90deg);
  }
  .map-panel-close:hover { background: var(--text-soft); }
  .map-panel-close:hover::after { color: var(--white); }

  /* Peek bar: visible solo en estado colapsado */
  .map-panel-peek {
    display: none;
    flex-shrink: 0;
  }
  .map-panel--collapsed .map-panel-peek {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
    padding: 0 1.25rem;
    background: var(--text);
    cursor: pointer;
  }
  .peek-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
    min-width: 0;
    gap: .18rem;
  }
  .peek-name {
    color: var(--white);
    font: 600 .95rem/1.2 var(--sans);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .peek-cat {
    color: rgba(255,255,255,.65);
    font: 400 .78rem/1.2 var(--sans);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .peek-arrow {
    color: var(--white);
    font-size: 3.6rem;
    line-height: 1;
    display: inline-block;
    transform: rotate(-90deg);
    flex-shrink: 0;
  }
  /* Ocultar close y body mientras está colapsado */
  .map-panel--collapsed .map-panel-close { display: none; }
  .map-panel--collapsed .map-panel-body  { visibility: hidden; pointer-events: none; }

  /* Overlay innecesario en mobile: el panel cubre todo y el body tiene overflow:hidden */
  .map-panel-overlay,
  .map-panel-overlay.is-open { display: none !important; }
}

/* =====================
   WELCOME BANNER
   ===================== */
.welcome-banner {
  position: fixed;
  top: calc(var(--header-h, 85px) + var(--filters-h, 53px));
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .85s ease;
}

.welcome-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('/img/preview.webp') center / cover no-repeat;
  z-index: 0;
}

.welcome-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(10, 30, 15, .28) 0%,
    rgba(10, 30, 15, .52) 100%
  );
  z-index: 1;
}

.welcome-phrase {
  position: relative;
  z-index: 2;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.9rem, 5.5vw, 3.8rem);
  color: rgba(255, 255, 255, .96);
  text-align: center;
  line-height: 1.25;
  letter-spacing: -.015em;
  text-shadow: 0 2px 28px rgba(0, 0, 0, .38);
  max-width: 720px;
  padding: 0 2rem;
}

.welcome-highlight {
  color: #cde9a4;
  font-weight: 300;
}

.welcome-banner.is-fading {
  opacity: 0;
  pointer-events: none;
}

/* =====================
   PWA INSTALL BANNER
   ===================== */
.pwa-banner {
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  right: 1rem;
  z-index: 1300;
  background: #1a1a1a;
  color: #fff;
  border-radius: 14px;
  padding: .75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  box-shadow: 0 4px 24px rgba(0,0,0,.28);
  animation: pwa-slide-up .3s cubic-bezier(.4,0,.2,1);
}

.pwa-banner[hidden] { display: none; }

@keyframes pwa-slide-up {
  from { transform: translateY(120%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.pwa-banner-content {
  display: flex;
  align-items: center;
  gap: .65rem;
  flex: 1;
  min-width: 0;
}

.pwa-banner-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  flex-shrink: 0;
}

.pwa-banner-text {
  font: 500 .88rem/1.3 var(--sans);
  color: rgba(255,255,255,.92);
}

.pwa-banner-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-shrink: 0;
}

.pwa-install-btn {
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: .45rem .9rem;
  font: 600 .84rem/1 var(--sans);
  cursor: pointer;
  white-space: nowrap;
}

.pwa-dismiss-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,.55);
  font-size: 1rem;
  cursor: pointer;
  padding: .25rem;
  line-height: 1;
}

