/* Brand interaction colors (Barreto): hover/focus/active = azul #00163D,
   texto branco, borda dourada. On dark brand surfaces (header, footer,
   bg-primary, mobile menu) the pattern is inverted at the end of this file.
   Only interaction colors are changed; resting and visited styles stay intact.
   These rules also match visited links while hovering/focusing/pressing:
   no standalone :visited color is needed or allowed to replace resting colors.
   Keyboard focus uses :focus-visible so a mouse click does not leave the
   hover colors behind after the pointer leaves. Native focus rings are kept. */
html body :is(#root, [data-radix-popper-content-wrapper], [role="dialog"], #ig-modal)
  :is(
    button:not(:has(img)):not([role="checkbox"]):not([role="switch"]):not([role="slider"]),
    input[type="submit"],
    input[type="button"],
    a[role="button"], a[class~="rounded-full"][class~="border"],
    a.inline-flex:not(.underline):not(.underline-offset-4),
    a.flex.items-center[class*="rounded-"]:is([class~="border"], [class*="bg-"]),
    a[class*="rounded-"][class*="hover:bg-"]:not(.underline):not(.underline-offset-4):not(:has(img)),
    a[class~="bg-accent"],
    a[class~="bg-primary"],
    a.footer-cta-button,
    a.leaflet-control-zoom-in,
    a.leaflet-control-zoom-out,
    a.leaflet-popup-close-button,
    [role="option"],
    [role="menuitem"],
    [cmdk-item]
  ):not(:disabled):not([aria-disabled="true"]):not([data-disabled]):not(section[aria-label="Perguntas frequentes"] button[aria-expanded][aria-controls]):is(:hover, :focus:focus-visible, :active) {
  /* Existing inline styles and PHP patches use !important for these two
     properties. Scoped specificity wins over those patches, including the
     late card-border-patch, without changing normal styles or theme tokens. */
  background-color: var(--color-primary, #00163D) !important;
  border-color: var(--color-secondary, #D2B220) !important;
  color: #fff !important;
}

/* Text inside controls has its own important colors in hero/dropdown/filter
   overrides. Inherit only while the parent control is interacting. */
html body :is(#root, [data-radix-popper-content-wrapper], [role="dialog"], #ig-modal)
  :is(button:not(:has(img)):not([role="checkbox"]):not([role="switch"]):not([role="slider"]),
      a[role="button"], a[class~="rounded-full"][class~="border"], a.inline-flex:not(.underline):not(.underline-offset-4),
      a.flex.items-center[class*="rounded-"]:is([class~="border"], [class*="bg-"]),
      a[class*="rounded-"][class*="hover:bg-"]:not(.underline):not(.underline-offset-4):not(:has(img)),
      a[class~="bg-accent"], a[class~="bg-primary"], a.footer-cta-button,
      [role="option"], [role="menuitem"], [cmdk-item]):not(:disabled):not([aria-disabled="true"]):not([data-disabled]):not(section[aria-label="Perguntas frequentes"] button[aria-expanded][aria-controls]):is(:hover, :focus:focus-visible, :active)
  :is(span, strong, em, b, small, p) {
  color: #fff !important;
}

/* Exception: the type badge in the free-search suggestions ("Imovel", "Bairro",
   "Cidade", "Loteamento") keeps its own light pill background (bg-muted), so it
   must keep its resting text color instead of inheriting the white above.
   The prefix must be copied whole — dropping the trailing :not(section ...)
   costs enough specificity that the generic rule wins again — and the badge's
   own classes then put it on top, for hover, focus and active, without
   touching the pill's background, radius, size, position or the row's hover. */
html body :is(#root, [data-radix-popper-content-wrapper], [role="dialog"], #ig-modal)
  :is(button:not(:has(img)):not([role="checkbox"]):not([role="switch"]):not([role="slider"]),
      a[role="button"], a[class~="rounded-full"][class~="border"], a.inline-flex:not(.underline):not(.underline-offset-4),
      a.flex.items-center[class*="rounded-"]:is([class~="border"], [class*="bg-"]),
      a[class*="rounded-"][class*="hover:bg-"]:not(.underline):not(.underline-offset-4):not(:has(img)),
      a[class~="bg-accent"], a[class~="bg-primary"], a.footer-cta-button,
      [role="option"], [role="menuitem"], [cmdk-item]):not(:disabled):not([aria-disabled="true"]):not([data-disabled]):not(section[aria-label="Perguntas frequentes"] button[aria-expanded][aria-controls]):is(:hover, :focus, :focus-visible, :active, :focus:focus-visible)
  span[class~="rounded-full"][class~="bg-muted"][class~="text-muted-foreground"] {
  color: hsl(var(--muted-foreground)) !important;
}
html body #root :is(header, footer, .bg-primary, div.fixed[class*="top-[56px]"])
  :is(button:not(:has(img)):not([role="checkbox"]):not([role="switch"]):not([role="slider"]), input[type="submit"], input[type="button"], a[role="button"], a[class~="rounded-full"][class~="border"], a.inline-flex:not(.underline):not(.underline-offset-4), a.flex.items-center[class*="rounded-"]:is([class~="border"], [class*="bg-"]), a[class*="rounded-"][class*="hover:bg-"]:not(.underline):not(.underline-offset-4):not(:has(img)), a[class~="bg-accent"], a[class~="bg-primary"], a.footer-cta-button, [role="option"], [role="menuitem"], [cmdk-item]):not(:disabled):not([aria-disabled="true"]):not([data-disabled]):not(section[aria-label="Perguntas frequentes"] button[aria-expanded][aria-controls]):is(:hover, :focus, :focus-visible, :active, :focus:focus-visible)
  span[class~="rounded-full"][class~="bg-muted"][class~="text-muted-foreground"] {
  color: hsl(var(--muted-foreground)) !important;
}

/* This existing floating CTA sits outside the React root and has inline colors. */
html body > a[aria-label="Falar no WhatsApp"]:is(:hover, :focus:focus-visible, :active) {
  background-color: var(--color-primary, #00163D) !important;
  border-color: var(--color-secondary, #D2B220) !important;
  color: #fff !important;
}

/* Explicit icon colors in the header/home/dropdowns override currentColor.
   Keep favorite status icons and all non-interacting icons unchanged. */
html body :is(#root, [data-radix-popper-content-wrapper], [role="dialog"], #ig-modal)
  :is(button:not(:has(img)):not([aria-label="Favoritar"]):not([role="checkbox"]):not([role="switch"]):not([role="slider"]),
      a[role="button"], a[class~="rounded-full"][class~="border"], a.inline-flex:not(.underline):not(.underline-offset-4),
      a.flex.items-center[class*="rounded-"]:is([class~="border"], [class*="bg-"]),
      a[class*="rounded-"][class*="hover:bg-"]:not(.underline):not(.underline-offset-4):not(:has(img)),
      a[class~="bg-accent"], a[class~="bg-primary"], a.footer-cta-button,
      [role="option"], [role="menuitem"], [cmdk-item]):not(:disabled):not([aria-disabled="true"]):not([data-disabled]):not(section[aria-label="Perguntas frequentes"] button[aria-expanded][aria-controls]):is(:hover, :focus:focus-visible, :active)
  svg {
  color: #fff !important;
  stroke: currentColor !important;
}

/* The share control also sets stroke directly on its paths. */
html body #root button[aria-label="Compartilhar"]:not(:disabled):not([aria-disabled="true"]):is(:hover, :focus:focus-visible, :active) svg path {
  stroke: currentColor !important;
}

/* FAQ questions keep their resting colors and native keyboard focus. */
html body #root section[aria-label="Perguntas frequentes"]
  button[aria-expanded][aria-controls]:hover {
  text-decoration-line: none;
}

/* ── Dark brand surfaces (header, footer, bg-primary bars, mobile menu) ──
   Navy-on-navy would be invisible there, so the pattern is inverted:
   hover = gold background, navy text/icons. Extra :is() raises specificity
   above the generic rules above. */
html body #root :is(header, footer, .bg-primary, div.fixed[class*="top-[56px]"])
  :is(button:not(:has(img)):not([role="checkbox"]):not([role="switch"]):not([role="slider"]), input[type="submit"], input[type="button"], a[role="button"], a[class~="rounded-full"][class~="border"], a.inline-flex:not(.underline):not(.underline-offset-4), a.flex.items-center[class*="rounded-"]:is([class~="border"], [class*="bg-"]), a[class*="rounded-"][class*="hover:bg-"]:not(.underline):not(.underline-offset-4):not(:has(img)), a[class~="bg-accent"], a[class~="bg-primary"], a.footer-cta-button, [role="option"], [role="menuitem"], [cmdk-item]):not(:disabled):not([aria-disabled="true"]):not([data-disabled]):not(section[aria-label="Perguntas frequentes"] button[aria-expanded][aria-controls]):is(:hover, :focus:focus-visible, :active) {
  background-color: var(--color-secondary, #D2B220) !important;
  border-color: var(--color-secondary, #D2B220) !important;
  color: var(--color-primary, #00163D) !important;
}
html body #root :is(header, footer, .bg-primary, div.fixed[class*="top-[56px]"])
  :is(button:not(:has(img)):not([role="checkbox"]):not([role="switch"]):not([role="slider"]), input[type="submit"], input[type="button"], a[role="button"], a[class~="rounded-full"][class~="border"], a.inline-flex:not(.underline):not(.underline-offset-4), a.flex.items-center[class*="rounded-"]:is([class~="border"], [class*="bg-"]), a[class*="rounded-"][class*="hover:bg-"]:not(.underline):not(.underline-offset-4):not(:has(img)), a[class~="bg-accent"], a[class~="bg-primary"], a.footer-cta-button, [role="option"], [role="menuitem"], [cmdk-item]):not(:disabled):not([aria-disabled="true"]):not([data-disabled]):not(section[aria-label="Perguntas frequentes"] button[aria-expanded][aria-controls]):is(:hover, :focus:focus-visible, :active)
  :is(span, strong, em, b, small, p, svg) {
  color: var(--color-primary, #00163D) !important;
  stroke: currentColor !important;
}
html body #root :is(header, footer, .bg-primary, div.fixed[class*="top-[56px]"])
  :is(button:not(:has(img)):not([role="checkbox"]):not([role="switch"]):not([role="slider"]), input[type="submit"], input[type="button"], a[role="button"], a[class~="rounded-full"][class~="border"], a.inline-flex:not(.underline):not(.underline-offset-4), a.flex.items-center[class*="rounded-"]:is([class~="border"], [class*="bg-"]), a[class*="rounded-"][class*="hover:bg-"]:not(.underline):not(.underline-offset-4):not(:has(img)), a[class~="bg-accent"], a[class~="bg-primary"], a.footer-cta-button, [role="option"], [role="menuitem"], [cmdk-item]):not(:disabled):not([aria-disabled="true"]):not([data-disabled]):not(section[aria-label="Perguntas frequentes"] button[aria-expanded][aria-controls]):is(:hover, :focus:focus-visible, :active) svg :is(path, circle, rect, line, polyline) {
  stroke: currentColor !important;
}

/* Gold-resting buttons on dark surfaces (footer CTAs, social icons): hover goes to white so it
   still responds. Chained :is() keeps it above the dark-surface rule. */
html body #root :is(header, footer, .bg-primary, div.fixed[class*="top-[56px]"])
  :is(button:not(:has(img)):not([role="checkbox"]):not([role="switch"]):not([role="slider"]), input[type="submit"], input[type="button"], a[role="button"], a[class~="rounded-full"][class~="border"], a.inline-flex:not(.underline):not(.underline-offset-4), a.flex.items-center[class*="rounded-"]:is([class~="border"], [class*="bg-"]), a[class*="rounded-"][class*="hover:bg-"]:not(.underline):not(.underline-offset-4):not(:has(img)), a[class~="bg-accent"], a[class~="bg-primary"], a.footer-cta-button, [role="option"], [role="menuitem"], [cmdk-item]):is(.footer-cta-button, a[class~="bg-accent"], a.barreto-social):not(:disabled):not([aria-disabled="true"]):not([data-disabled]):not(section[aria-label="Perguntas frequentes"] button[aria-expanded][aria-controls]):is(:hover, :focus:focus-visible, :active) {
  background-color: #fff !important;
  border-color: #fff !important;
  color: var(--color-primary, #00163D) !important;
}

/* Mobile menu rows: subtle highlight + gold text (full gold rows are too heavy). */
html body #root :is(header, footer, .bg-primary, div.fixed[class*="top-[56px]"])
  :is(button:not(:has(img)):not([role="checkbox"]):not([role="switch"]):not([role="slider"]), input[type="submit"], input[type="button"], a[role="button"], a[class~="rounded-full"][class~="border"], a.inline-flex:not(.underline):not(.underline-offset-4), a.flex.items-center[class*="rounded-"]:is([class~="border"], [class*="bg-"]), a[class*="rounded-"][class*="hover:bg-"]:not(.underline):not(.underline-offset-4):not(:has(img)), a[class~="bg-accent"], a[class~="bg-primary"], a.footer-cta-button, [role="option"], [role="menuitem"], [cmdk-item]):is(div.fixed[class*="top-[56px]"] nav a):not(:disabled):not([aria-disabled="true"]):not([data-disabled]):not(section[aria-label="Perguntas frequentes"] button[aria-expanded][aria-controls]):is(:hover, :focus:focus-visible, :active) {
  background-color: rgb(255 255 255 / .08) !important;
  border-color: transparent !important;
  color: var(--color-secondary, #D2B220) !important;
}
html body #root :is(header, footer, .bg-primary, div.fixed[class*="top-[56px]"])
  :is(button:not(:has(img)):not([role="checkbox"]):not([role="switch"]):not([role="slider"]), input[type="submit"], input[type="button"], a[role="button"], a[class~="rounded-full"][class~="border"], a.inline-flex:not(.underline):not(.underline-offset-4), a.flex.items-center[class*="rounded-"]:is([class~="border"], [class*="bg-"]), a[class*="rounded-"][class*="hover:bg-"]:not(.underline):not(.underline-offset-4):not(:has(img)), a[class~="bg-accent"], a[class~="bg-primary"], a.footer-cta-button, [role="option"], [role="menuitem"], [cmdk-item]):is(div.fixed[class*="top-[56px]"] nav a):not(:disabled):not([aria-disabled="true"]):not([data-disabled]):not(section[aria-label="Perguntas frequentes"] button[aria-expanded][aria-controls]):is(:hover, :focus:focus-visible, :active)
  :is(span, strong, em, b, small, p, svg) {
  color: var(--color-secondary, #D2B220) !important;
}