/* Página de realidade aumentada (ar.html). Usa o layout e as peças do visualizador (app.css) e acrescenta o botão que
   abre a câmera, o aviso de suporte, os passos e a interface por cima da câmera (#ar-overlay). */
.ar-intro { margin-top: 0; }

.ar-enter { min-width: 250px; padding: 17px 20px; font-size: 12.5px; }
.ar-enter svg { width: 22px; height: 22px; }
.ar-enter:disabled { cursor: default; opacity: .4; }
.ar-enter:disabled:hover { background: var(--cor-principal); border-color: var(--cor-principal); }

.ar-status { max-width: 34ch; margin-top: 14px; font-size: 13px; line-height: 1.5; color: var(--texto-suave); }
.ar-status:empty { display: none; }
#app[data-ar="unsupported"] .ar-status { padding-left: 12px; border-left: 2px solid var(--cor-secundaria); color: var(--cor-principal); }

.ar-steps { margin-top: 28px; }
.ar-steps h2 { font-size: 10.5px; font-weight: 400; letter-spacing: .2em; color: var(--texto-suave); }
.ar-steps ol { display: grid; gap: 8px; margin-top: 12px; list-style: none; counter-reset: step; }
.ar-steps li { position: relative; max-width: 36ch; padding-left: 26px; font-size: 13px; line-height: 1.45; counter-increment: step; }
.ar-steps li::before {
    content: counter(step, decimal-leading-zero); position: absolute; left: 0; top: .1em;
    font-size: 11px; font-weight: 700; color: var(--cor-secundaria);
}

/* O nome é menor que no visualizador, como em vr.html; em telas baixas os passos saem. */
@media (min-width: 900px) {
    #name { font-size: clamp(44px, 4.2vw, 76px); }
}
@media (min-width: 900px) and (max-height: 820px) {
    .ar-steps { display: none; }
}

/* Celular (onde a realidade aumentada funciona): o texto, o botão em toda a largura, o aviso e os passos. */
@media (max-width: 899px) {
    .ar-intro { display: block; margin-top: 10px; max-width: none; font-size: 13.5px; }
    .actions:has(.ar-enter) { grid-template-columns: 1fr; }
    .ar-enter { min-width: 0; }
    .ar-status { max-width: none; margin-top: 10px; }
    .ar-steps { margin-top: 16px; }
    .ar-steps ol { gap: 4px; margin-top: 8px; }
    .ar-steps li { max-width: none; font-size: 12.5px; }
}

@media (orientation: landscape) and (max-height: 520px) {
    .ar-intro, .ar-steps, .ar-status { display: none; }
    .actions:has(.ar-enter) { grid-template-columns: 1fr; }
    .ar-enter { padding: 12px 14px; }
}

/* ---------- interface por cima da câmera ---------- */
/* Na sessão o Chrome mostra #ar-overlay em tela cheia, sobre a imagem da câmera: o fundo fica transparente e o próprio
   elemento recebe os toques (arrastar gira, a pinça muda o tamanho). */
#ar-overlay {
    position: fixed; inset: 0; z-index: 20; overflow: hidden; background: transparent; touch-action: none;
    font-family: 'Alfa Laval', 'Helvetica Neue', Arial, sans-serif; color: var(--cor-principal);
    -webkit-user-select: none; user-select: none;
}
#ar-overlay:xr-overlay { background: transparent; }
#ar-overlay #hotspots { z-index: 1; }

/* A faixa de cima deixa os toques chegarem à cena; só o botão de fechar os recebe. */
.ar-top {
    position: absolute; inset: 0 0 auto; z-index: 2; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
    padding: max(14px, env(safe-area-inset-top)) 16px 28px; pointer-events: none;
    background: linear-gradient(rgba(17, 56, 127, .55), rgba(17, 56, 127, 0)); color: var(--branco);
}
.ar-title { display: grid; gap: 4px; min-width: 0; }
.ar-title span { font-size: 10.5px; font-weight: 700; letter-spacing: .24em; text-transform: uppercase; opacity: .9; }
.ar-title b { font-size: 22px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.ar-close {
    flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; pointer-events: auto;
    color: var(--cor-principal); background: rgba(255, 255, 255, .92);
}
.ar-close svg { width: 20px; height: 20px; stroke-width: 2; }

.ar-hint {
    position: absolute; left: 50%; top: calc(max(14px, env(safe-area-inset-top)) + 72px); z-index: 2; transform: translateX(-50%);
    width: max-content; max-width: calc(100% - 32px); padding: 9px 16px; border-radius: 20px; text-align: center;
    font-size: 12.5px; font-weight: 700; letter-spacing: .04em; line-height: 1.35;
    color: var(--cor-principal); background: rgba(255, 255, 255, .9); pointer-events: none;
}
.ar-hint:empty { display: none; }

.ar-loading {
    position: absolute; left: 50%; top: 45%; z-index: 2; transform: translate(-50%, -50%); display: grid; justify-items: center; gap: 6px;
    padding: 14px 20px; border-radius: 12px; background: rgba(255, 255, 255, .92); pointer-events: none;
    font-size: 11px; font-weight: 700; letter-spacing: .18em;
}
.ar-loading b { font-size: 24px; letter-spacing: .02em; }

.ar-panel {
    position: absolute; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); z-index: 2;
    display: grid; gap: 6px; padding: 10px 12px 12px; border-radius: 14px;
    background: rgba(250, 250, 250, .93); box-shadow: 0 10px 30px rgba(17, 56, 127, .18);
}
.ar-label { font-size: 9.5px; font-weight: 400; letter-spacing: .2em; color: var(--texto-suave); }
.ar-label b { font-weight: 700; color: var(--cor-secundaria); }
.ar-chips { position: relative; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.ar-chips button {
    flex: none; min-height: 36px; padding: 0 12px; border: 1px solid var(--linha); border-radius: 18px;
    font-size: 11px; font-weight: 700; letter-spacing: .1em; white-space: nowrap; background: var(--branco);
}
.ar-chips button[aria-pressed="true"] { color: var(--branco); background: var(--cor-principal); border-color: var(--cor-principal); }
.ar-actions { display: flex; gap: 8px; margin-top: 4px; }
.ar-actions:not(:has(.ar-action:not([hidden]))) { display: none; }
.ar-action {
    flex: 1; min-height: 40px; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0 12px;
    border: 1px solid var(--cor-principal); border-radius: 20px; font-size: 11px; font-weight: 700; letter-spacing: .12em;
}
.ar-action svg { width: 18px; height: 18px; flex: none; }
.ar-action[aria-pressed="true"] { color: var(--branco); background: var(--cor-principal); }
