/*
  Digão Garage — regras específicas da página (além do kit oficial system.css / cards.css / motion.css / layout.css).
  Mantém tokens do sistema, sem sobrescrever transform/transition de .btn, .card, .link ou .m-zoom.
*/

:root {
  --g-alt: var(--p-surface);
  --section-space: clamp(56px, 7.5vw, 104px);
  --head-gap: clamp(24px, 3vw, 40px);
  --ly-head-gap: var(--head-gap);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav, 72px);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

::selection {
  background: var(--p-accent);
  color: var(--p-accent-ink);
}

input,
textarea {
  caret-color: var(--p-accent);
}

/* Imagens responsivas dentro de <picture> mantendo proporção e preenchimento do quadro */
.estoque-card__media > picture,
.strip-tile__media > picture,
.menu-card .panel > picture {
  display: block;
  width: 100%;
  height: 100%;
}

.estoque-card__media > picture > img,
.strip-tile__media > picture > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 420ms var(--ease);
}

.menu-card .panel {
  --p-h: 0px;
  min-height: 0;
  aspect-ratio: 4 / 3;
}

.menu-card .panel > picture {
  position: absolute;
  inset: 0;
}

.menu-card .panel > picture > img {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
}

/* Visita: remove margem padrão do <dl>, status ao vivo e borda sutil no cartão */
.hours {
  margin: 0;
}

.visit__rows > li {
  padding-block: 10px;
}

footer.ground-brand .mark {
  background: currentColor;
}

.visit-status {
  margin: 0;
  font-size: var(--t-small);
  font-weight: 500;
  color: var(--p-muted);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.visit-status[data-open="true"] {
  color: var(--p-accent);
}

.visit-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

@media (min-width: 1024px) {
  .visit--card {
    background: var(--g-alt);
    border: 1px solid color-mix(in oklab, var(--p-ink) 10%, transparent);
    padding: clamp(var(--s-5), 2.4vw, var(--s-6));
    transition: border-color 180ms var(--ease);
  }
  .visit--card:hover {
    border-color: color-mix(in oklab, var(--p-ink) 22%, transparent);
  }
}

#visita .pl-photo > picture > img {
  object-position: 50% 18%;
}

/* Estoque: cards clicáveis responsivos ao ponteiro que abrem o modal de galeria */
.estoque-grid {
  align-items: stretch;
}

.estoque-card {
  appearance: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: var(--s-3);
  margin: 0;
  background: transparent;
  color: inherit;
  border: 1px solid color-mix(in oklab, var(--p-ink) 12%, transparent);
  border-radius: var(--r-lg);
  transition:
    transform 220ms var(--ease),
    background-color 220ms var(--ease),
    border-color 220ms var(--ease),
    box-shadow 260ms var(--ease);
}

@media (hover: hover) and (pointer: fine) {
  .estoque-card:hover {
    transform: translateY(-4px);
    background: color-mix(in oklab, var(--p-surface) 70%, var(--p-bg));
    border-color: color-mix(in oklab, var(--p-accent) 45%, transparent);
    box-shadow: 0 18px 34px -20px rgb(34 38 31 / 0.28);
  }
  .estoque-card:hover .estoque-card__media > picture > img {
    transform: scale(1.045);
  }
}

.estoque-card:focus-visible {
  outline: 2px solid var(--p-action);
  outline-offset: 2px;
  border-color: var(--p-action);
}

.estoque-card:active {
  transform: translateY(-1px) scale(0.992);
}

@media (max-width: 1023px) {
  .estoque-grid > .estoque-card {
    grid-column: auto / span 6;
  }
}

.estoque-card__media {
  position: relative;
  overflow: clip;
  width: 100%;
  aspect-ratio: var(--estoque-ratio, 4 / 3);
  border-radius: var(--r-lg);
  background: var(--surface);
  margin-bottom: var(--s-4);
}

.estoque-card__head {
  margin-bottom: var(--s-2);
}

.estoque-card__head > h3 {
  font: 500 var(--t-card)/1.3 var(--font-text);
  letter-spacing: -0.01em;
  transition: color 180ms var(--ease);
}

.estoque-card:hover .estoque-card__head > h3,
.estoque-card:focus-visible .estoque-card__head > h3 {
  color: var(--action);
}

.estoque-card__desc {
  color: var(--muted);
  font-size: var(--t-body);
  line-height: 1.5;
  margin-bottom: var(--s-3);
}

.estoque-card__meta {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-1) var(--s-2);
  width: 100%;
  padding-top: var(--s-2);
  border-top: 1px solid color-mix(in oklab, var(--p-ink) 10%, transparent);
}

.estoque-card__price {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.estoque-card__cue {
  font-size: var(--t-small);
  font-weight: 500;
  color: var(--p-accent);
  white-space: nowrap;
  opacity: 0.78;
  transition: transform 180ms var(--ease), opacity 180ms var(--ease);
}

.estoque-card:hover .estoque-card__cue,
.estoque-card:focus-visible .estoque-card__cue {
  opacity: 1;
  transform: translateX(3px);
}

/* Serviços: linhas clicáveis interativas + faixa de fotos com zoom e inspeção no modal */
.service-group > .t-label {
  margin-bottom: var(--s-3);
  color: var(--ink);
}

#servicos .rows > li {
  padding-block: 8px;
}

.service-row-btn {
  grid-column: 1 / -1;
  appearance: none;
  font: inherit;
  color: inherit;
  background: transparent;
  border: 0;
  width: 100%;
  padding: 8px 10px;
  margin-inline: -10px;
  width: calc(100% + 20px);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-4);
  text-align: left;
  cursor: pointer;
  border-radius: var(--r-sm);
  transition: background-color 180ms var(--ease);
}

.service-row-btn .rows__name,
.service-row-btn .rows__value {
  transition: transform 180ms var(--ease), color 180ms var(--ease);
}

.service-row-btn .rows__value {
  color: var(--p-accent);
  font-weight: 500;
  font-size: var(--t-small);
  white-space: nowrap;
}

@media (hover: hover) and (pointer: fine) {
  .service-row-btn:hover {
    background: color-mix(in oklab, var(--p-surface) 78%, transparent);
  }
  .service-row-btn:hover .rows__name {
    transform: translateX(4px);
  }
  .service-row-btn:hover .rows__value {
    transform: translateX(-2px);
  }
}

.service-row-btn:focus-visible {
  outline: 2px solid var(--p-action);
  outline-offset: 2px;
}

.rows .rows__name small {
  display: block;
  margin-top: 2px;
  font-weight: 400;
  font-size: var(--t-body);
  line-height: 1.45;
  color: var(--muted);
}

.strip-grid {
  margin-top: var(--s-6);
}

.strip-tile {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: zoom-in;
  display: block;
  text-align: left;
  transition: transform 220ms var(--ease), box-shadow 240ms var(--ease);
}

.strip-tile__media {
  position: relative;
  overflow: clip;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid color-mix(in oklab, var(--p-ink) 10%, transparent);
}

.strip-tile__zoom {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  background: var(--p-bg);
  color: var(--p-ink);
  border: 1px solid color-mix(in oklab, var(--p-ink) 18%, transparent);
  font-size: 16px;
  line-height: 1;
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 180ms var(--ease), transform 180ms var(--ease);
}

@media (hover: hover) and (pointer: fine) {
  .strip-tile:hover {
    transform: translateY(-3px);
  }
  .strip-tile:hover .strip-tile__media {
    border-color: color-mix(in oklab, var(--p-accent) 45%, transparent);
    box-shadow: 0 14px 28px -18px rgb(34 38 31 / 0.3);
  }
  .strip-tile:hover .strip-tile__media > picture > img {
    transform: scale(1.05);
  }
  .strip-tile:hover .strip-tile__zoom,
  .strip-tile:focus-visible .strip-tile__zoom {
    opacity: 1;
    transform: scale(1);
  }
}

.strip-tile:focus-visible {
  outline: 2px solid var(--p-action);
  outline-offset: 2px;
}

@media (min-width: 640px) and (max-width: 1023px) {
  .strip-grid > .strip-tile {
    grid-column: auto / span 3;
  }
}

@media (max-width: 639px) {
  .strip-grid > .strip-tile {
    grid-column: auto / span 6;
  }
}

/* Momento word-highlight no cabeçalho do agendamento */
#agendamento .mo-wh__text {
  font-size: var(--t-lead);
  line-height: 1.5;
  max-width: 60ch;
}

/* Painel do formulário de agendamento */
@media (min-width: 1024px) {
  .booking-panel {
    background: var(--g-alt);
    border: 1px solid color-mix(in oklab, var(--p-ink) 10%, transparent);
    border-radius: var(--r-lg);
    padding: var(--s-5);
  }
}

@media (min-width: 1280px) {
  .booking-panel {
    padding: var(--s-6);
  }
}

.booking-panel .field textarea {
  min-height: 88px;
}

.cf-turnstile:empty {
  display: none;
}

/* Campo honeypot fora da tela sem display:none puro */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

/* Modal de galeria dos veículos e fotos mecânicas */
.vehicle-modal {
  margin: auto;
  padding: 0;
  width: min(1040px, calc(100vw - 32px));
  max-width: none;
  max-height: min(90svh, 780px);
  border: 1px solid color-mix(in oklab, var(--p-ink) 18%, transparent);
  border-radius: var(--r-lg);
  background: var(--p-bg);
  color: var(--p-ink);
  box-shadow: 0 28px 64px -20px rgb(34 38 31 / 0.45);
  overflow: hidden;
}

.vehicle-modal::backdrop {
  background: rgb(34 38 31 / 0.72);
  backdrop-filter: blur(4px);
}

.vehicle-modal[open] {
  animation: vm-in 200ms var(--ease);
}

@keyframes vm-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.vm-shell {
  position: relative;
  padding: var(--s-6);
  max-height: min(90svh, 780px);
  overflow-y: auto;
}

.vm-close {
  position: absolute;
  top: var(--s-4);
  right: var(--s-4);
  z-index: 3;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in oklab, var(--p-ink) 18%, transparent);
  background: var(--p-bg);
  color: var(--p-ink);
  cursor: pointer;
  transition: background-color 150ms var(--ease), border-color 150ms var(--ease);
}

.vm-close:hover {
  background: var(--p-surface);
  border-color: var(--p-ink);
}

.vm-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.95fr);
  gap: var(--s-6);
  align-items: start;
}

.vm-gallery {
  display: grid;
  gap: var(--s-3);
}

.vm-stage {
  position: relative;
  margin: 0;
  aspect-ratio: 4 / 3;
  background: var(--p-surface);
  overflow: hidden;
  border: 1px solid color-mix(in oklab, var(--p-ink) 12%, transparent);
}

.vm-stage > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.vm-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in oklab, var(--p-ink) 20%, transparent);
  background: color-mix(in oklab, var(--p-bg) 92%, transparent);
  color: var(--p-ink);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: background-color 150ms var(--ease), border-color 150ms var(--ease);
}

.vm-nav:hover {
  background: var(--p-bg);
  border-color: var(--p-ink);
}

.vm-nav--prev { left: 12px; }
.vm-nav--next { right: 12px; }

.vm-nav[hidden],
.vm-thumbs[hidden],
.vm-counter[hidden] {
  display: none;
}

.vm-counter {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 4px 10px;
  font-size: var(--t-label);
  font-variant-numeric: tabular-nums;
  background: rgb(34 38 31 / 0.86);
  color: #ffffff;
}

.vm-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}

.vm-thumb {
  padding: 0;
  width: 72px;
  height: 54px;
  border: 2px solid transparent;
  background: var(--p-surface);
  cursor: pointer;
  overflow: hidden;
  opacity: 0.65;
  transition: opacity 150ms var(--ease), border-color 150ms var(--ease);
}

.vm-thumb > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.vm-thumb[aria-current="true"],
.vm-thumb:hover {
  opacity: 1;
}

.vm-thumb[aria-current="true"] {
  border-color: var(--p-accent);
}

.vm-info {
  display: grid;
  gap: var(--s-3);
  padding-top: var(--s-2);
}

.vm-badge {
  justify-self: start;
  padding: 4px 10px;
  font-size: var(--t-label);
  font-weight: 500;
  background: var(--p-surface);
  color: var(--p-accent);
  border: 1px solid color-mix(in oklab, var(--p-accent) 30%, transparent);
}

.vm-info > h2 {
  font-size: var(--t-h2);
  line-height: 1.15;
  margin: 0;
  padding-right: 40px;
}

.vm-summary {
  margin: 0;
  font-size: var(--t-body);
  line-height: 1.55;
  color: var(--p-ink);
}

.vm-caption {
  margin: 0;
  font-size: var(--t-small);
  line-height: 1.45;
  color: var(--p-muted);
}

.vm-specs {
  margin: var(--s-1) 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid color-mix(in oklab, var(--p-ink) 12%, transparent);
}

.vm-specs > li {
  padding-block: 8px;
  font-size: var(--t-small);
  border-bottom: 1px solid color-mix(in oklab, var(--p-ink) 12%, transparent);
}

.vm-price {
  margin: var(--s-1) 0 0;
  font-size: var(--t-lead);
  font-weight: 500;
  color: var(--p-ink);
}

.vm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  margin-top: var(--s-2);
}

@media (max-width: 820px) {
  .vm-shell {
    padding: var(--s-4);
  }
  .vm-grid {
    grid-template-columns: 1fr;
    gap: var(--s-4);
  }
  .vm-info > h2 {
    padding-right: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .estoque-card,
  .estoque-card__media > picture > img,
  .estoque-card__cue,
  .service-row-btn,
  .service-row-btn .rows__name,
  .service-row-btn .rows__value,
  .strip-tile,
  .strip-tile__media > picture > img,
  .strip-tile__zoom,
  .vehicle-modal[open] {
    transition: none;
    animation: none;
  }
}

/* Ajuste do wordmark de fechamento para "Digão Garage" (12 caracteres) sem corte superior no til */
.close__word {
  margin-top: clamp(12px, 2vw, 24px);
  font-size: clamp(38px, 11vw, 158px);
  line-height: 1.05;
  overflow: visible;
}

/* Ritmo vertical dinâmico entre resoluções:
   Hero mantém presença de primeira dobra com teto confortável; seções e rodapé seguem o fluxo natural do conteúdo. */
main > .hero.hero--place {
  height: auto;
  min-height: min(100svh, 860px);
}

@media (min-width: 1024px) {
  main > .hero.hero--place {
    --photo: clamp(380px, 60svh, 580px);
    --hpadb: 48px;
  }
}

@media (max-width: 639px) {
  main > .hero.hero--place {
    height: auto;
    min-height: min(100svh, 860px);
  }
}

main > :is(section, .section):not(.hero, .section--hero) {
  display: block;
  height: auto;
  min-height: 0;
  padding-block: var(--section-space);
}

main > :is(section, .section):not(.hero, .section--hero) > :is(.wrap, .container) {
  height: auto;
}

body > footer.closing {
  display: block;
  height: auto;
  min-height: 0;
  padding-top: var(--section-space);
  padding-bottom: calc(clamp(36px, 5vw, 64px) + var(--bar));
}

body > footer.closing > .wrap {
  height: auto;
  grid-template-rows: auto auto;
  row-gap: clamp(36px, 5vw, 64px);
}

.closing__cta {
  gap: clamp(20px, 3vw, 36px);
}

/* Proporções naturais das fotografias em fluxo */
.pl-photo > picture > img {
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: cover;
}

#visita .pl-photo > picture > img {
  aspect-ratio: 5 / 4;
}

#agendamento .pl-photo > picture > img {
  aspect-ratio: 4 / 3;
}

@media (max-width: 1023px) {
  #visita .pl-photo > picture > img {
    aspect-ratio: 4 / 3;
  }
  #agendamento .pl-photo > picture > img {
    aspect-ratio: 16 / 10;
  }
}

@media (max-width: 639px) {
  [data-place="visit"] .grid > .pl-photo:last-child,
  [data-place="visit"] .grid > .pl-photo:last-child > picture {
    flex: none;
  }
  [data-place="visit"] .grid > .pl-photo:last-child > img,
  [data-place="visit"] .grid > .pl-photo:last-child > picture > img {
    flex: none;
    max-height: none;
  }
  .estoque-card {
    padding: var(--s-2);
  }
  .estoque-card__media {
    --estoque-ratio: 16 / 10;
    margin-bottom: var(--s-2);
  }
  .estoque-card__cue {
    font-size: 12px;
    opacity: 1;
  }
}

/* Páginas legais internas (Privacidade e Termos) */
.legal-main > .section {
  height: auto;
  padding-top: calc(var(--nav) + var(--section-space));
  padding-bottom: var(--section-space);
  min-height: calc(100svh - 220px);
}

.legal-prose {
  display: grid;
  gap: var(--s-5);
  max-width: 66ch;
}

.legal-prose h2 {
  margin-top: var(--s-4);
  font-size: var(--t-h3);
  line-height: 1.25;
}
