/*
 * PetFans Maps — identidade visual nova (mesma paleta do site e da gestão).
 * Carregado DEPOIS de style.css (mapa) e details.css (detalhes): só sobrescreve tokens e alguns detalhes,
 * sem alterar a estrutura nem o comportamento do mapa.
 * Turquesa (gato) = estrutura e navegação · Laranja (cachorro) = ações principais · Lilás/âmbar = apoio.
 */

:root {
    --ink: #26322a;
    --muted: #5f6f6c;
    --line: #d7ebe6;
    --surface: #fff;
    --soft: #e6f4f1;
    --green: #14A0A4;       /* turquesa da marca (versão com contraste para texto e ícones) */
    --green-dark: #1B7889;  /* contorno do gato */
    --lime: #86DFDF;
    --orange: #FB8F2B;      /* laranja do cachorro */
    --orange-dark: #E67A16;
    --lilac: #8C74F7;
    --amber: #F7B21B;
    --shadow: 0 20px 60px rgba(27, 120, 137, .14);
}

body { font-family: "Poppins", "Inter", sans-serif; background: #eef6f4; }

/* ---------- Painel lateral ---------- */
.eyebrow { color: var(--orange-dark); }
.eyebrow i { background: var(--orange); box-shadow: 0 0 0 5px rgba(251, 143, 43, .2); }
.intro h1 { position: relative; padding-bottom: 12px; color: var(--ink); }
.intro h1::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 48px;
    height: 4px;
    border-radius: 4px;
    background: linear-gradient(90deg, #55BFBF 0 50%, var(--orange) 50% 100%);
}

/* Ação principal em laranja (mesmo padrão dos botões principais do site) */
.location-button { background: linear-gradient(115deg, var(--orange-dark), var(--orange)); box-shadow: 0 9px 22px rgba(251, 143, 43, .28); }
.location-button:hover { box-shadow: 0 13px 27px rgba(251, 143, 43, .35); }

.site-nav a.active { background: var(--green-dark); }
.filter-chip:has(input:checked) { color: var(--green-dark); border-color: rgba(20, 160, 164, .45); background: var(--soft); }
.filter-icon.emergency { color: var(--orange-dark); background: #fff1e3; }
.more-count, .service-chip:has(input:checked) { background: var(--green); border-color: var(--green); }
.result-count { color: var(--orange-dark); background: #fff1e3; }

/* Cards da lista */
.card:hover { border-color: rgba(20, 160, 164, .35); box-shadow: 0 10px 24px rgba(27, 120, 137, .12); }
.card.is-active { border-color: var(--green); box-shadow: 0 0 0 3px rgba(20, 160, 164, .18), 0 10px 24px rgba(27, 120, 137, .12); }
.verMapa { border-radius: 50rem; padding: 7px 13px; }
.verDetalhes { border-radius: 50rem; padding: 7px 12px; }

/* Botões flutuantes do mapa */
.mobile-menu-button, .expand-sidebar-button { border-radius: 50rem; }
.address-search button { border-radius: 50%; }
.address-pin span { background: var(--orange); }

/* ---------- Cores dos tipos de estabelecimento (pinos, avatares e legenda) ---------- */
.type-clinica { --pin-a: #55BFBF; --pin-b: #1B7889; }
.type-petshop { --pin-a: #FCA95C; --pin-b: #E67A16; }
.type-banho { --pin-a: #A897FA; --pin-b: #7357E6; }
.type-farmacia { --pin-a: #F9C850; --pin-b: #D08E00; }

/* Tutorial */
.tour-next { background: var(--orange-dark); }
.tour-next:hover { background: var(--orange); }
.tour-dots span.on { background: var(--orange); }

.precision.estimated, .popup-note.estimated { color: var(--green-dark) !important; }

/* ---------- Página de detalhes ---------- */
.topbar { border-bottom-color: var(--line); }
.hero { box-shadow: 0 18px 50px rgba(27, 120, 137, .12); }
.hero h1 { color: var(--ink); }
.badges .verified { background: var(--green); }
.panel { border-color: var(--line); box-shadow: 0 8px 24px rgba(27, 120, 137, .06); }
.panel h2 { position: relative; padding-bottom: 8px; }
.panel h2::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 32px;
    height: 3px;
    border-radius: 3px;
    background: linear-gradient(90deg, #55BFBF 0 50%, var(--orange) 50% 100%);
}
.highlight { color: var(--green-dark); }
.available { color: var(--green-dark); background: var(--soft); }
.tag-list small { color: var(--orange-dark); }
.route-button { background: linear-gradient(115deg, var(--orange-dark), var(--orange)); }
.route-button:hover { background: var(--orange-dark); }
.contact-panel .primary-action, .not-found a { border-radius: 50rem; }


/* ==========================================================================
   Modo claro / escuro (mesmo switch e mesma preferência do site e da gestão)
   ========================================================================== */
:root {
    /* tokens usados pelo switch (iguais aos do site) */
    --pf-primary: #55BFBF;
    --pf-primary-700: #1B7889;
    --pf-primary-rgb: 85, 191, 191;
    --pf-ink: #1B7889;
    --pf-orange: #FB8F2B;
    --pf-orange-ink: #C25E00;
    --pf-orange-tint: #FFF1E3;
    --pf-text-3: #8a9896;
    --teal-text: var(--green-dark);   /* texto turquesa (fica claro no modo escuro) */
    --page-bg: #eef6f4;
    --field-bg: #fafcfb;
}

/* Switch no topo do painel e no topo da página de detalhes */
.brand-area .pf-switch { margin-left: auto; margin-right: 8px; }
.topbar .pf-switch { margin-left: 14px; flex: 0 0 auto; }

/* Switch de modo claro / escuro */
.pf-switch {
  display: inline-flex;
  align-items: center;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.pf-switch__track {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 64px;
  height: 32px;
  padding: 0 8px;
  border-radius: 50rem;
  background: var(--pf-orange-tint);
  border: 1px solid rgba(251, 143, 43, .35);
}
.pf-switch__icon {
  position: relative;
  z-index: 0;
  font-size: .95rem;
  line-height: 1;
}
.pf-switch__icon.is-sun { color: var(--pf-orange-ink); }
.pf-switch__icon.is-moon { color: var(--pf-text-3); opacity: .7; }
.pf-switch__thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  z-index: 1;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--pf-orange);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
}
/* Só anima depois de posicionado (evita deslizar a cada carregamento) */
.pf-switch.is-ready .pf-switch__track { transition: background-color .25s ease, border-color .25s ease; }
.pf-switch.is-ready .pf-switch__icon { transition: color .25s ease, opacity .25s ease; }
.pf-switch.is-ready .pf-switch__thumb { transition: transform .25s cubic-bezier(.4, 0, .2, 1), background-color .25s ease; }
/* Ícone sobre o "botão" que desliza */
.pf-switch__thumb::before {
  content: "\f1bc"; /* ri-sun-fill */
  font-family: 'remixicon';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: .85rem;
  color: #fff;
}
.pf-switch.is-on .pf-switch__track {
  background: rgba(var(--pf-primary-rgb), .18);
  border-color: rgba(var(--pf-primary-rgb), .45);
}
.pf-switch.is-on .pf-switch__thumb {
  transform: translateX(32px);
  background: var(--pf-primary-700);
}
.pf-switch.is-on .pf-switch__thumb::before { content: "\ef6e"; } /* ri-moon-clear-fill */
.pf-switch.is-on .pf-switch__icon.is-sun { color: var(--pf-text-3); opacity: .7; }
.pf-switch.is-on .pf-switch__icon.is-moon { color: var(--pf-ink); opacity: 1; }
.pf-switch:hover .pf-switch__track { border-color: var(--pf-orange); }
.pf-switch.is-on:hover .pf-switch__track { border-color: var(--pf-primary); }
.pf-switch:focus-visible { outline: none; }
.pf-switch:focus-visible .pf-switch__track { box-shadow: 0 0 0 .2rem rgba(var(--pf-primary-rgb), .3); }

/* Transição suave das cores ao trocar de tema (aplicada só durante a troca) */
html.pf-theme-anim,
html.pf-theme-anim *,
html.pf-theme-anim *::before,
html.pf-theme-anim *::after {
  transition: background-color .3s ease, color .3s ease, border-color .3s ease, box-shadow .3s ease !important;
}
html.pf-theme-anim .pf-switch__thumb {
  transition: transform .25s cubic-bezier(.4, 0, .2, 1), background-color .25s ease !important;
}


/* ---------- Tema escuro ---------- */
html.dark-style {
    --ink: #e7e7ef;
    --muted: #b6bccb;
    --line: rgba(255, 255, 255, .1);
    --surface: #30334e;
    --soft: rgba(86, 191, 191, .12);
    --shadow: 0 20px 60px rgba(0, 0, 0, .35);
    --pf-ink: #86DFDF;
    --pf-orange-ink: #FFB067;
    --pf-orange-tint: rgba(251, 143, 43, .14);
    --pf-text-3: #8d93a6;
    --teal-text: #7FE0E0;
    --page-bg: #25263a;
    --field-bg: #2b2c40;
    color-scheme: dark;
}
html.dark-style body { background: var(--page-bg); }

/* Superfícies */
html.dark-style .sidebar { background: rgba(48, 51, 78, .97); border-color: rgba(255, 255, 255, .06); }
html.dark-style .card,
html.dark-style .filter-chip,
html.dark-style .service-chip,
html.dark-style .loading-card,
html.dark-style .address-suggestions,
html.dark-style .tour-box,
html.dark-style .tour-box::before,
html.dark-style .radius-step,
html.dark-style #btnRemoverLocalizacao,
html.dark-style .verDetalhes,
html.dark-style .tour-back,
html.dark-style .popup-remove,
html.dark-style .empty-clear { background: var(--surface); border-color: var(--line); }
html.dark-style .search-box,
html.dark-style .radius-control,
html.dark-style .more-services-toggle,
html.dark-style .contact-link,
html.dark-style .missing-clinic { background: var(--field-bg); border-color: var(--line); }
html.dark-style .search-box:focus-within { background: var(--surface); }
html.dark-style .loading-card span { background: linear-gradient(90deg, #3a3d5c 25%, #44476a 50%, #3a3d5c 75%); background-size: 200% 100%; }
html.dark-style .site-nav a:hover { background: var(--surface); }

/* Elementos flutuantes sobre o mapa */
html.dark-style .map-status,
html.dark-style .reset-map-button,
html.dark-style .map-tip,
html.dark-style .address-search,
html.dark-style .map-legend { background: rgba(48, 51, 78, .94); border-color: rgba(255, 255, 255, .08); color: var(--ink); }
html.dark-style .address-search input,
html.dark-style .search-box input { color: var(--ink); }
html.dark-style .legend-toggle-all,
html.dark-style .map-legend .legend-item { color: var(--ink); }
html.dark-style .leaflet-popup-content-wrapper,
html.dark-style .leaflet-popup-tip { background: var(--surface); color: var(--ink); }
html.dark-style .leaflet-control-zoom a { background: var(--surface) !important; border-color: var(--line) !important; }
html.dark-style .leaflet-control-attribution { background: rgba(48, 51, 78, .8) !important; color: var(--muted); }
html.dark-style .leaflet-control-attribution a { color: var(--teal-text); }

/* Base do mapa (ruas) escurecida; pinos, grupos e popups ficam em outras camadas e não são afetados */
html.dark-style .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.88) saturate(.75); }
html.dark-style #map { background: #1f2133; }

/* Textos em turquesa escuro -> turquesa claro (legível no fundo escuro) */
html.dark-style .verDetalhes,
html.dark-style .radius-step,
html.dark-style #btnRemoverLocalizacao,
html.dark-style .more-services-toggle,
html.dark-style .filter-chip:has(input:checked),
html.dark-style .contact-link,
html.dark-style .reset-map-button,
html.dark-style .collapse-sidebar,
html.dark-style .legend-count,
html.dark-style .suggestion-icon,
html.dark-style .missing-clinic-text b,
html.dark-style .tour-back,
html.dark-style .empty-clear,
html.dark-style .site-nav a:hover,
html.dark-style .pet-popup h4,
html.dark-style .back-link,
html.dark-style .highlight,
html.dark-style .available,
html.dark-style .simple-tags span,
html.dark-style .badges span:not(.verified),
html.dark-style .contact-panel a,
html.dark-style .precision.estimated,
html.dark-style .popup-note.estimated { color: var(--teal-text) !important; }
html.dark-style .contact-link.whatsapp { color: #6fdc9b; border-color: rgba(37, 165, 90, .35); background: rgba(37, 165, 90, .12); }
html.dark-style .popup-note { color: #FFD27A !important; background: rgba(247, 178, 27, .14); }
html.dark-style .suggestion:hover,
html.dark-style .suggestion[aria-selected="true"] { background: var(--soft); }
html.dark-style .tour-box p { color: var(--muted); }

/* Página de detalhes */
html.dark-style .topbar { background: rgba(43, 44, 64, .94); }
html.dark-style .hero,
html.dark-style .panel,
html.dark-style .not-found { background: var(--surface); }
html.dark-style .description { color: var(--muted); }
html.dark-style .unavailable { color: #7d8396; background: rgba(255, 255, 255, .04); }
html.dark-style .tag-list span { border-color: var(--line); }
html.dark-style .google-map iframe { filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.88) saturate(.75); }

/* Detalhes: botões do topo e situação de funcionamento */
.hero-action { border-radius: 50rem; font-family: "Poppins", "Inter", sans-serif; }
html.dark-style .hero-action:not(.whatsapp) { color: var(--teal-text); background: var(--field-bg); border-color: var(--line); }
html.dark-style .hero-action:not(.whatsapp):hover { background: var(--soft); border-color: var(--green); }
html.dark-style .open-now.open { color: #6fdc9b; background: rgba(47, 158, 98, .16); }
html.dark-style .open-now.closing { color: #FFB067; background: rgba(251, 143, 43, .14); }
html.dark-style .open-now.closed { color: #EF7A6F; background: rgba(196, 75, 64, .16); }
html.dark-style .open-now.unknown { background: rgba(255, 255, 255, .06); }
/* O botão principal do contato mantém texto branco (a regra de texto turquesa acima não vale para ele) */
html.dark-style .contact-panel a.primary-action { color: #fff !important; }
