/* =============================================
   PEDE UMA FAXINA – Global Stylesheet
   ============================================= */

/* ---------- CSS VARIABLES ---------- */
:root {
  --primary: #3A7D3E;
  --primary-dark: #2D6130;
  --primary-light: #EEF7EE;
  --secondary: #C9A04A;
  --secondary-dark: #A07C30;
  --accent: #C9A04A;
  --danger: #EF4444;
  --dark: #111827;
  --gray-100: #F3F4F6;
  --gray-300: #D1D5DB;
  --gray-500: #6B7280;
  --gray-700: #374151;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow: 0 4px 6px rgba(0,0,0,0.1), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
  --transition: all 0.2s ease;
  --radius: 10px;
}

/* ---------- RESET ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  color: var(--dark);
  background: var(--gray-100);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
button { cursor: pointer; font-family: var(--font); }

/* ---------- PAGE CONTAINER ---------- */
.page-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-top: 64px;
}

/* ---------- HEADER ---------- */
#header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 68px;
  background: linear-gradient(135deg, #2D6130 0%, #3A7D3E 50%, #2D6130 100%);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
  z-index: 1000;
  box-shadow: 0 2px 12px rgba(42, 90, 46, 0.5);
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  flex-shrink: 0;
}

.header-logo-icon {
  font-size: 1.3rem;
}

.header-logo-img {
  height: 52px;
  width: auto;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.4));
}

.header-logo-text {
  color: white;
  font-weight: 800;
  font-size: 1.15rem;
  white-space: nowrap;
  line-height: 1.2;
  font-family: Georgia, 'Times New Roman', serif;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

.header-logo-text span {
  color: #E8C46A;
  font-weight: 900;
  font-style: italic;
}

.header-search {
  flex: 1;
  max-width: 420px;
  position: relative;
  display: flex;
  align-items: center;
}

.header-search input {
  width: 100%;
  height: 40px;
  border-radius: 10px;
  border: 2px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.15);
  color: white;
  padding: 0 44px 0 14px;
  font-size: 0.875rem;
  font-family: var(--font);
  transition: var(--transition);
  outline: none;
}

.header-search input::placeholder { color: rgba(255,255,255,0.65); }
.header-search input:focus {
  background: rgba(255,255,255,0.25);
  border-color: rgba(255,255,255,0.5);
}

.header-search-btn {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  color: rgba(255,255,255,0.8);
  font-size: 0.9rem;
  padding: 4px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

/* Header Buttons */
.btn-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: var(--font);
  transition: var(--transition);
  border: none;
  cursor: pointer;
  white-space: nowrap;
}

.btn-header-outline {
  background: rgba(255,255,255,0.15);
  color: white;
  border: 1.5px solid rgba(255,255,255,0.3);
}
.btn-header-outline:hover {
  background: rgba(255,255,255,0.25);
  border-color: rgba(255,255,255,0.5);
}

.btn-header-solid {
  background: white;
  color: var(--primary);
}
.btn-header-solid:hover { background: #EFF6FF; }

.btn-header-accent {
  background: linear-gradient(135deg, #C9A04A, #A07C30);
  color: white;
  border: none;
}
.btn-header-accent:hover { background: linear-gradient(135deg, #A07C30, #8A6820); }

/* User Avatar Dropdown */
.user-avatar {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  border: 2px solid rgba(255,255,255,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
}
.user-avatar:hover { background: rgba(255,255,255,0.3); }

.user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: white;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  min-width: 200px;
  overflow: hidden;
  z-index: 2000;
  border: 1px solid var(--gray-300);
}
.user-dropdown.open { display: block; animation: fadeIn 0.15s ease; }

.user-dropdown-header {
  background: linear-gradient(135deg, var(--primary-light), white);
  padding: 14px 16px;
  border-bottom: 1px solid var(--gray-100);
}

.user-dropdown-name { font-weight: 700; font-size: 0.9rem; color: var(--dark); }
.user-dropdown-type { font-size: 0.75rem; color: var(--gray-500); margin-top: 2px; }

.user-dropdown a,
.user-dropdown button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 0.85rem;
  color: var(--gray-700);
  text-decoration: none;
  transition: background 0.15s;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-family: var(--font);
  cursor: pointer;
}
.user-dropdown a:hover, .user-dropdown button:hover { background: var(--gray-100); }
.user-dropdown .logout { color: var(--danger); }

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--font);
  transition: var(--transition);
  border: none;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }

.btn-secondary {
  background: linear-gradient(135deg, #C9A04A, #A07C30);
  color: white;
}
.btn-secondary:hover { background: linear-gradient(135deg, #A07C30, #8A6820); transform: translateY(-1px); }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-outline:hover { background: var(--primary-light); }

.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-danger:hover { background: #DC2626; }

.btn-whatsapp {
  background: #25D366;
  color: white;
}
.btn-whatsapp:hover { background: #22C55E; }

.btn-full { width: 100%; display: flex; }
.btn-lg { padding: 14px 24px; font-size: 1rem; border-radius: 12px; }
.btn-sm { padding: 6px 12px; font-size: 0.78rem; border-radius: 7px; }

/* ---------- FORMS ---------- */
.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
}

.required { color: var(--danger); }

.form-control {
  width: 100%;
  height: 44px;
  border: 2px solid var(--gray-300);
  border-radius: var(--radius);
  padding: 0 14px;
  font-size: 0.875rem;
  font-family: var(--font);
  color: var(--dark);
  background: white;
  transition: var(--transition);
  outline: none;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.form-control::placeholder { color: var(--gray-500); }

.form-control-textarea {
  height: auto;
  min-height: 100px;
  padding: 12px 14px;
  resize: vertical;
}

select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; padding-right: 36px; }

.form-error {
  color: var(--danger);
  font-size: 0.82rem;
  font-weight: 500;
  display: none;
}
.form-error.show { display: block; }

.divider {
  height: 1px;
  background: var(--gray-100);
  margin: 20px 0;
}

.divider-text {
  text-align: center;
  position: relative;
  color: var(--gray-500);
  font-size: 0.8rem;
  margin: 16px 0;
}
.divider-text::before, .divider-text::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 40%;
  height: 1px;
  background: var(--gray-300);
}
.divider-text::before { left: 0; }
.divider-text::after { right: 0; }

/* ---------- MODALS ---------- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 3000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(2px);
}
.modal-overlay.open { display: flex; animation: fadeIn 0.2s ease; }

.modal {
  background: white;
  border-radius: 18px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  animation: slideUp 0.25s ease;
}

.modal-header {
  padding: 20px 24px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--gray-100);
  position: sticky;
  top: 0;
  background: white;
  z-index: 1;
}

.modal-title {
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--dark);
}

.modal-close {
  background: var(--gray-100);
  border: none;
  border-radius: 8px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-500);
  font-size: 0.9rem;
  transition: var(--transition);
}
.modal-close:hover { background: var(--gray-300); color: var(--dark); }

.modal-body { padding: 24px; }

/* ---------- TABS ---------- */
.tabs {
  display: flex;
  background: var(--gray-100);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 20px;
}

.tab-btn {
  flex: 1;
  padding: 8px 12px;
  border: none;
  border-radius: 7px;
  background: none;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-500);
  transition: var(--transition);
  font-family: var(--font);
}
.tab-btn.active { background: white; color: var(--primary); box-shadow: var(--shadow-sm); }

/* ---------- BADGES ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: #ECFDF5; color: var(--secondary); }
.badge-gray { background: var(--gray-100); color: var(--gray-500); }
.badge-accent { background: #FFFBEB; color: var(--accent); }

/* ---------- STARS ---------- */
.stars { display: inline-flex; gap: 1px; }
.star { color: var(--gray-300); font-size: 0.9rem; }
.star.filled { color: #F59E0B; }

/* ---------- LOADING ---------- */
.loading-spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
  flex-shrink: 0;
}

.loading-spinner.dark {
  border-color: rgba(37,99,235,0.2);
  border-top-color: var(--primary);
}

/* ---------- TOAST ---------- */
#toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: slideInRight 0.3s ease, fadeOut 0.3s ease 3.2s forwards;
  min-width: 280px;
  max-width: 380px;
  color: white;
}

.toast-success { background: #059669; }
.toast-error { background: #DC2626; }
.toast-info { background: var(--primary); }
.toast-warning { background: var(--accent); color: #111; }

/* ---------- FOOTER ---------- */
#footer {
  background: #111827;
  color: white;
  padding: 50px 20px 20px;
  margin-top: auto;
}

.footer-grid {
  max-width: 1100px;
  margin: 0 auto 30px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
}

.footer-brand .footer-logo {
  font-size: 1.1rem;
  font-weight: 800;
  display: block;
  margin-bottom: 12px;
}

.footer-brand p {
  font-size: 0.85rem;
  color: #9CA3AF;
  line-height: 1.7;
  margin-bottom: 16px;
}

.footer-social {
  display: flex;
  gap: 10px;
}

.footer-social a {
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.1);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9CA3AF;
  transition: var(--transition);
}
.footer-social a:hover { background: var(--primary); color: white; }

.footer-col h4 {
  font-size: 0.875rem;
  font-weight: 700;
  margin-bottom: 14px;
  color: white;
}

.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col ul li a {
  color: #9CA3AF;
  font-size: 0.85rem;
  text-decoration: none;
  transition: color 0.15s;
}
.footer-col ul li a:hover { color: #93C5FD; }

.footer-bottom {
  max-width: 1100px;
  margin: 0 auto;
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 20px;
  text-align: center;
  font-size: 0.8rem;
  color: #6B7280;
}

/* ---------- SECTION TITLE ---------- */
.section-title { text-align: center; margin-bottom: 40px; }
.section-title h2 { font-size: 1.8rem; font-weight: 800; color: var(--dark); margin-bottom: 8px; }
.section-title p { color: var(--gray-500); font-size: 1rem; }

/* ---------- ANIMATIONS ---------- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 768px) {
  .header-search { display: flex; max-width: 100%; }
  .header-search input { font-size: 0.82rem; }
  .btn-header span { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .footer-brand { grid-column: 1/-1; }
  #header { flex-wrap: wrap; height: auto; min-height: 68px; padding: 8px 12px; gap: 8px; }
  .header-logo { flex-shrink: 0; }
  .header-search { flex: 1; min-width: 0; order: 3; width: 100%; }
  #map-wrapper { margin-top: 112px; }
}

@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* ===== COOKIE BANNER ===== */
#cookie-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #2D6130;
  color: white;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  z-index: 9999;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.3);
  font-size: 0.85rem;
  flex-wrap: wrap;
}
#cookie-banner p { margin: 0; flex: 1; min-width: 200px; }
#cookie-banner a { color: #C9A04A; text-decoration: underline; }
#cookie-accept-btn {
  background: #C9A04A;
  color: white;
  border: none;
  padding: 8px 22px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.85rem;
  white-space: nowrap;
  transition: background 0.2s;
}
#cookie-accept-btn:hover { background: #8A6820; }

/* ===== ASAAS PAYMENT MODAL ===== */
#asaasPayModal .modal-box {
  max-width: 480px;
  width: 95%;
}
#asaasPayFrame {
  width: 100%;
  min-height: 520px;
  border: none;
  border-radius: 10px;
}
.asaas-plan-info {
  background: var(--primary-light);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.asaas-plan-icon { font-size: 2rem; }
.asaas-plan-name { font-weight: 700; font-size: 1rem; color: var(--primary); }
.asaas-plan-price { font-size: 1.4rem; font-weight: 800; color: var(--secondary); }
.asaas-plan-desc { font-size: 0.8rem; color: var(--gray-500); }
.asaas-loading { text-align: center; padding: 40px; color: var(--gray-500); }
.asaas-loading .loading-spinner { margin: 0 auto 12px; }

/* ===== CLUSTER CIRCLE (mapa sem login) ===== */
.cluster-marker {
  background: rgba(31,67,38,0.85);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  border: 3px solid #C39A44;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* ===== BOTÕES COM CORES DA MARCA ===== */
.btn-primary {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
}
.btn-primary:hover { background: var(--primary-dark) !important; }
.btn-accent {
  background: var(--secondary) !important;
  color: white !important;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}
.btn-accent:hover { background: var(--secondary-dark) !important; }

/* FOOTER MINI */
#footer-mini { background: #2D6130; }
