/*
  Lead widgets ("Herramientas"): the owner's diagnostics, forms, estimators and
  appointment requests, written into the page by the demo router and run by the
  OH Cloud widget runtime (which brings its own stylesheet).

  This file gives the runtime THIS template's look through the shared --ohw-*
  tokens, and fits the router's markup into this layout (a hero button a widget
  took over, the launcher in the mobile sticky bar). The token names are the
  same in every template and the runtime reads nothing else: keep the block
  complete. Only the values are this template's own; they follow its palette,
  because every value is one of its own custom properties.
*/

:root {
  --ohw-font: var(--font-sans);
  --ohw-font-display: var(--font-display);
  --ohw-ink: var(--ink);
  --ohw-ink-soft: var(--ink-soft);
  --ohw-surface: var(--surface);
  --ohw-paper: var(--paper-2);
  --ohw-rule: var(--line-strong);
  --ohw-primary: var(--primary);
  --ohw-on-primary: #FFFFFF;
  --ohw-accent: var(--accent);
  --ohw-accent-hover: var(--accent-hover);
  --ohw-accent-ink: var(--accent-contrast);
  --ohw-radius: var(--radius);
  --ohw-radius-lg: var(--radius-lg);
  --ohw-container: var(--container);
  --ohw-section-space: var(--space-section);
  /* The floating launcher clears the sticky bar, which phones show up to 768px. */
  --ohw-float-bottom: calc(5rem + env(safe-area-inset-bottom, 0px));
}

@media (min-width: 769px) {
  :root {
    --ohw-float-bottom: 1.5rem;
  }
}

/* A hero button a widget took over is no longer a WhatsApp button (the router removed its icon). */
.hero-actions [data-ohw-open] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
}

.hero-actions [data-ohw-open]:hover,
.hero-actions [data-ohw-open]:focus-visible {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

/* In the sticky bar a floating widget's launcher is one more button of the bar. */
.sticky-bar:has(.ohw-launcher--sticky) {
  grid-template-columns: none;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
}

.sticky-bar .ohw-launcher--sticky {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 0.5rem;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-contrast);
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  text-decoration: none;
}

/* Where the bar carries the launcher, phones do not need the floating one too. */
@media (max-width: 768px) {
  .sticky-bar:has(.ohw-launcher--sticky) ~ .ohw-launcher--floating {
    display: none;
  }
}
