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

:root {
  --primary: #468D47;
  --primary-dark: #3b763c;
  --primary-deeper: #2e5c2f;
  --primary-light: #eaf4ea;
  --primary-mid: #c8e6c9;
  --primary-xlight: #f2faf2;
  --bg: #f4f7f4;
  --surface: #ffffff;
  --surface2: #f8fbf8;
  --border: #d6e8d6;
  --border-light: #e8f3e8;
  --accent-gold: #e8a020;
  --accent-gold-light: #fef7e8;
  --text: #1c2b1c;
  --text-muted: #5a7a5a;
  --text-light: #8aaa8a;
  --shadow-sm: 0 1px 4px rgba(59, 118, 60, 0.08);
  --shadow: 0 2px 16px rgba(59, 118, 60, 0.10);
  --shadow-lg: 0 8px 36px rgba(59, 118, 60, 0.15);
  --radius: 14px;
  --radius-sm: 9px;
  --radius-xs: 6px;
}

body {
  font-family: 'Outfit', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── HERO ── */
.hero {
  background: linear-gradient(135deg, var(--primary-deeper) 0%, var(--primary-dark) 45%, var(--primary) 100%);
  padding: 36px 24px 52px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 15% 60%, rgba(255, 255, 255, 0.07) 0%, transparent 55%),
    radial-gradient(circle at 85% 20%, rgba(255, 255, 255, 0.05) 0%, transparent 45%);
}

.hero-deco {
  position: absolute;
  right: -60px;
  top: -60px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  border: 50px solid rgba(255, 255, 255, 0.05);
  pointer-events: none;
}

.hero-deco2 {
  position: absolute;
  right: 80px;
  bottom: -80px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  border: 30px solid rgba(255, 255, 255, 0.04);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  max-width: 860px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: rgba(255, 255, 255, 0.95);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 5px 13px;
  border-radius: 20px;
  margin-bottom: 16px;
}

.hero-badge span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #7eef80;
  box-shadow: 0 0 6px #7eef80;
  animation: pulse 2s ease infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

.hero h1 {
  font-size: clamp(1.6rem, 4.5vw, 2.4rem);
  font-weight: 900;
  color: #fff;
  line-height: 1.12;
  letter-spacing: -0.025em;
  margin-bottom: 10px;
}

.hero p {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.88rem;
  line-height: 1.65;
  max-width: 460px;
}

/* ── STATS BAR ── */
.stats-bar {
  background: var(--surface);
  border-bottom: 1.5px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.stats-inner {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  padding: 0 20px;
}

.stat-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 10px;
  border-right: 1px solid var(--border-light);
  gap: 3px;
}

.stat-item:last-child {
  border-right: none;
}

.stat-number {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--primary);
  font-family: 'DM Mono', monospace;
  line-height: 1;
}

.stat-label {
  font-size: 0.67rem;
  color: var(--text-muted);
  font-weight: 500;
  text-align: center;
  line-height: 1.3;
}

/* ── MAIN ── */
.page-wrapper {
  max-width: 860px;
  margin: 0 auto;
  padding: 28px 20px 64px;
}

/* ── SEARCH ── */
.search-wrap {
  margin-bottom: 22px;
  position: relative;
}

.search-wrap input {
  width: 100%;
  padding: 13px 18px 13px 46px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  font-family: 'Outfit', sans-serif;
  font-size: 0.88rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: var(--shadow-sm);
}

.search-wrap input::placeholder {
  color: var(--text-light);
}

.search-wrap input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(70, 141, 71, 0.13);
}

.search-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  pointer-events: none;
  transition: color 0.2s;
}

.search-wrap input:focus~.search-icon,
.search-wrap:focus-within .search-icon {
  color: var(--primary);
}

/* ── SECTION LABEL ── */
.section-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── PROVINCE ── */
.province-block {
  margin-bottom: 10px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1.5px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, border-color 0.2s;
  animation: fadeUp 0.3s ease both;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.province-block:hover {
  box-shadow: var(--shadow);
  border-color: var(--primary-mid);
}

.province-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 18px;
  cursor: pointer;
  user-select: none;
  gap: 12px;
  transition: background 0.15s;
}

.province-header:hover {
  background: var(--primary-xlight);
}

.province-header.open {
  background: var(--primary-light);
  border-bottom: 1.5px solid var(--primary-mid);
}

.province-title {
  display: flex;
  align-items: center;
  gap: 11px;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
}

.prov-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(59, 118, 60, 0.28);
}

.prov-icon svg {
  color: #fff;
}

.province-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.badge-green {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--primary-light);
  color: var(--primary-dark);
  border: 1px solid var(--primary-mid);
  white-space: nowrap;
  font-family: 'DM Mono', monospace;
}

.badge-gold {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--accent-gold-light);
  color: #9a6010;
  border: 1px solid #f0d090;
  white-space: nowrap;
  font-family: 'DM Mono', monospace;
}

.chevron {
  width: 18px;
  height: 18px;
  color: var(--text-light);
  transition: transform 0.25s ease, color 0.15s;
  flex-shrink: 0;
}

.province-header.open .chevron,
.city-header.open .chevron {
  transform: rotate(180deg);
  color: var(--primary);
}

.province-body {
  display: none;
  padding: 10px 12px 12px;
  background: var(--primary-xlight);
}

.province-body.open {
  display: block;
}

/* ── CITY ── */
.city-block {
  margin-top: 8px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
}

.city-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 15px;
  cursor: pointer;
  user-select: none;
  gap: 10px;
  transition: background 0.15s;
}

.city-header:hover {
  background: var(--surface2);
}

.city-header.open {
  background: #f0f9f0;
  border-bottom: 1px solid var(--border);
}

.city-title {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.city-title svg {
  color: var(--primary);
  flex-shrink: 0;
}

.city-body {
  display: none;
  padding: 8px 10px 10px;
  background: var(--surface);
}

.city-body.open {
  display: block;
}

/* ── AGENT CARD ── */
.agent-card {
  margin-top: 8px;
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: var(--surface);
  transition: box-shadow 0.2s, transform 0.18s, border-color 0.2s;
  position: relative;
}

.agent-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  background: linear-gradient(to bottom, var(--primary), var(--primary-dark));
  border-radius: 0 3px 3px 0;
  opacity: 0;
  transition: opacity 0.2s;
}

.agent-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--primary-mid);
  transform: translateY(-1px);
}

.agent-card:hover::before {
  opacity: 1;
}

.agent-name {
  font-size: 0.97rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.agent-owner {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.agent-owner svg {
  color: var(--primary);
  flex-shrink: 0;
}

.agent-address {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 10px;
  line-height: 1.6;
  display: flex;
  gap: 7px;
  padding: 9px 11px;
  background: var(--primary-xlight);
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-light);
}

.agent-address svg {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--primary);
}

/* ── PRODUCTS ── */
.products-label {
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-light);
  margin-top: 13px;
  margin-bottom: 6px;
}

.products-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.product-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px 5px 5px;
  border-radius: var(--radius-xs);
  background: var(--primary-xlight);
  border: 1px solid var(--border);
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}

.product-chip:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary-dark);
}

.product-thumb {
  width: 26px;
  height: 26px;
  border-radius: 4px;
  object-fit: cover;
  background: var(--border);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

/* ── BUTTONS ── */
.agent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 13px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 13px;
  border-radius: var(--radius-xs);
  font-size: 0.76rem;
  font-weight: 600;
  font-family: 'Outfit', sans-serif;
  text-decoration: none;
  border: 1.5px solid transparent;
  transition: all 0.15s;
  cursor: pointer;
}

.btn-whatsapp {
  background: #22c55e;
  color: #fff;
  border-color: #22c55e;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.22);
}

.btn-whatsapp:hover {
  background: #16a34a;
  border-color: #16a34a;
}

.btn-maps {
  background: var(--primary-light);
  color: var(--primary-dark);
  border-color: var(--primary-mid);
}

.btn-maps:hover {
  background: var(--primary-mid);
  border-color: var(--primary);
}

.btn-admin {
  background: #22c55e;
  color: #fff;
  border-color: #22c55e;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.22);
}

.btn-admin:hover {
  background: #16a34a;
  border-color: #16a34a;
}

.btn-phone {
  background: #f0fdf4;
  color: #15803d;
  border-color: #bbf7d0;
}

.btn-phone:hover {
  background: #dcfce7;
  border-color: #86efac;
}

/* ── STATES ── */
.loading-state,
.empty-state,
.error-state {
  text-align: center;
  padding: 56px 20px;
  color: var(--text-muted);
}

.loading-spinner {
  width: 38px;
  height: 38px;
  border: 3px solid var(--primary-mid);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto 14px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 10px;
}

.retry-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 16px;
  padding: 9px 20px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-xs);
  font-family: 'Outfit', sans-serif;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  box-shadow: 0 2px 8px rgba(59, 118, 60, 0.25);
}

.retry-btn:hover {
  background: var(--primary-dark);
}

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
  .hero {
    padding: 28px 16px 44px;
  }

  .hero h1 {
    font-size: 1.55rem;
  }

  .stats-inner {
    padding: 0 10px;
  }

  .stat-number {
    font-size: 1.25rem;
  }

  .stat-label {
    font-size: 0.62rem;
  }

  .page-wrapper {
    padding: 18px 12px 48px;
  }

  .province-header {
    padding: 13px 14px;
  }

  .btn {
    padding: 6px 10px;
    font-size: 0.73rem;
  }
}