/* Sirella Experience V2: ajustes progressivos para mobile/tablets.
   Preserva design original, animações e classes compiladas do Claude.
   CSS puro: nenhum listener, framework ou download adicional de JavaScript. */

@media (max-width: 1023px) {
  :root { --sirella-mobile-gutter: clamp(14px, 4vw, 28px); }

  #root .container-page {
    padding-inline: var(--sirella-mobile-gutter);
    min-width: 0;
  }
  #root .display-hero {
    font-size: clamp(2.2rem, 8.9vw, 4.6rem);
    line-height: 1.04;
    overflow-wrap: break-word;
  }
  #root .display-section {
    font-size: clamp(1.9rem, 6.8vw, 3.5rem);
    line-height: 1.06;
    overflow-wrap: break-word;
  }
  #root .title-card { overflow-wrap: break-word; }
  #root :is(img, video, iframe) { max-width: 100%; }
  #root :is(.glass, .container-page, .sc-card, .sc-form-wrapper) { min-width: 0; }
  #root :is(pre, table) { max-width: 100%; overflow-x: auto; }

  /* Botoes de icone devem continuar alcancaveis com o polegar. */
  #root header button[aria-label],
  #root nav button[aria-label] {
    min-width: 44px;
    min-height: 44px;
    touch-action: manipulation;
  }
  #root #filtros label { min-width: 0; }
  #root #filtros select {
    min-width: 0;
    max-width: 100%;
    width: 100%;
    font-size: 16px;
  }
  #root input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
  #root textarea,
  #root select {
    font-size: max(16px, 1em);
  }
  #root [role="dialog"],
  #root [aria-modal="true"] {
    max-width: calc(100vw - 20px);
    max-height: calc(100dvh - 20px);
  }

  /* Reduz a area de blur em aparelhos moveis sem alterar o efeito glass. */
  #root .glass[data-variant="frosted"] {
    -webkit-backdrop-filter: blur(16px) saturate(1.3);
    backdrop-filter: blur(16px) saturate(1.3);
  }
}
@media (max-width: 767px) {
  #root .display-hero {
    font-size: clamp(2.1rem, 9.5vw, 3.9rem);
    letter-spacing: -.04em;
  }
  #root .display-section { font-size: clamp(1.85rem, 7.6vw, 3.15rem); }

  /* Contato: formulario completo em uma coluna, sem zoom do teclado iOS. */
  #root .sc-page .sc-content-grid,
  #root .sc-page .sc-fields-grid { grid-template-columns: minmax(0, 1fr); }
  #root .sc-page .sc-choices { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  #root .sc-page .sc-choice {
    min-height: 0;
    padding: 15px 16px;
  }
  #root .sc-page .sc-choice-top { margin-bottom: 7px; }
  #root .sc-page .sc-card { padding: clamp(16px, 4vw, 24px); }
  #root .sc-page .sc-aside,
  #root .sc-page .sc-aside-content { min-height: 0; }
  #root .sc-page .sc-aside-content { padding: 26px 22px; }
  #root .sc-page .sc-aside h3 { margin-top: 20px; }
  #root .sc-page .sc-contact-points {
    padding-top: 25px;
    overflow-wrap: anywhere;
  }
  #root .sc-page .sc-input,
  #root .sc-page .sc-select { font-size: 16px; }
  #root .sc-page .sc-hero-cta a { min-height: 44px; }
  #root .sc-page .sc-last-cta a {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: break-word;
  }

  /* Detalhe do imóvel: cartao de preco nao fica preso no viewport do celular. */
  #root article aside .sticky { position: static; }

  /* Rodape glass: informacoes legiveis, links e colunas sem cortes. */
  #sirella-glass-footer { min-width: 0; }
  #sirella-glass-footer .sf-main { grid-template-columns: minmax(0, 1fr); }
  #sirella-glass-footer .sf-main > :not(:first-child) {
    min-width: 0;
    border-left: 0;
    border-top: 1px solid rgba(31, 29, 40, .13);
    padding: 12px 0 0;
  }
  #sirella-glass-footer .sf-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 12px;
  }
  #sirella-glass-footer .sf-links a {
    display: flex;
    align-items: center;
    white-space: normal;
    min-height: 36px;
  }
  #sirella-glass-footer .sf-number { white-space: normal; overflow-wrap: anywhere; }
  #sirella-glass-footer .sf-bottom { display: grid; gap: 8px; }
}
@media (max-width: 480px) {
  /* Busca: preservar input e botao na mesma faixa, sem estourar 320/360px. */
  #root form[role="search"] {
    min-width: 0;
    width: 100%;
    padding-left: 12px;
    gap: 5px;
  }
  #root form[role="search"] input {
    min-width: 0;
    font-size: 16px;
  }
  #root form[role="search"] > button:last-of-type {
    min-width: 68px;
    min-height: 44px;
    padding-inline: 11px;
    font-size: 13px;
    touch-action: manipulation;
  }
  /* Ao abrir os filtros, os seletores ocupam a largura inteira. */
  #root #filtros { grid-template-columns: minmax(0, 1fr); }
  #root #filtros > label { width: 100%; }
  #root section[aria-label="Resultados"] > .sticky > .glass { gap: 8px; padding: 10px; }
  #root section[aria-label="Resultados"] > .sticky > .glass > .ml-auto {
    margin-left: 0;
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  #root .sc-page .sc-hero-cta { flex-direction: column; align-items: stretch; }
  #root .sc-page .sc-hero-cta a { width: 100%; text-align: center; }
  #root .sc-page .sc-last-cta-inner { gap: 18px; }
  #root .sc-page .sc-submit { width: 100%; }
  #root .sc-page .sc-actions p { justify-content: center; width: 100%; }
  #sirella-glass-footer { padding-inline: 16px; }
}
@media (max-width: 359px) {
  #root .container-page { padding-inline: 12px; }
  #root .display-hero { font-size: 2.05rem; letter-spacing: -.045em; }
  #root .sc-page .sc-card { padding: 15px 12px; }
  #root .sc-page .sc-aside-content { padding: 21px 17px; }
  #root form[role="search"] > button:last-of-type {
    min-width: 62px;
    padding-inline: 9px;
  }
  #sirella-glass-footer .sf-links { gap: 2px 8px; }
}
/* Telas em paisagem curtas: elementos de apresentacao continuam acessiveis. */
@media (max-height: 550px) and (orientation: landscape) and (max-width: 1023px) {
  html.presenting #root header { padding-block: 8px; }
  html.presenting [data-jcard] {
    max-height: calc(100dvh - 92px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}
/* Mobile touch: evitar hover persistente em cards/imagens apos o toque. */
@media (hover: none) and (pointer: coarse) {
  #root .hover-lift:hover { transform: none; }
  #root .img-zoom:hover img { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  #root .filters-drawer, #root .filters-drawer > * { animation: none; }
}
