/* ==========================================================================
   Página de modelo (portfólio) — usa os tokens e componentes de style.css
   ========================================================================== */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Botões extras ---------- */
.btn--outline {
  --bg: var(--white);
  --bg-hover: var(--card-bg);
  --fg: var(--navy);
  --ic-bg: var(--navy);
  --ic-fg: var(--white);
  --shadow: transparent;
  box-shadow: inset 0 0 0 1.5px var(--border);
}
.btn--outline:hover { box-shadow: inset 0 0 0 1.5px var(--navy); }
.btn--block { width: 100%; justify-content: space-between; }

/* ---------- Topo do modelo ---------- */
.m-hero {
  position: relative;
  padding: 32px 0 clamp(72px, 6vw, 112px);
  background:
    radial-gradient(1200px 500px at 85% 0%, rgba(239, 124, 26, .08), transparent 60%),
    linear-gradient(180deg, var(--card-bg) 0%, var(--white) 100%);
}

.breadcrumb ol { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; font-family: var(--font-body); font-size: 13px; color: var(--muted); }
.breadcrumb li + li::before { content: "/"; margin-right: 8px; color: var(--border); }
.breadcrumb a { transition: color .3s var(--ease); }
.breadcrumb a:hover { color: var(--orange); }
.breadcrumb [aria-current] { color: var(--navy); font-weight: 700; }

.m-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 5vw, 80px);
  align-items: center;
  margin-top: clamp(28px, 3vw, 48px);
}

.m-hero__info { container-type: inline-size; } /* o título e os destaques medem a largura da coluna */
.m-model {
  font-size: clamp(76px, 3rem + 6vw, 168px);
  font-size: min(clamp(76px, 3rem + 6vw, 168px), calc(100cqi / (var(--chars, 4) * .7)));
  font-weight: 900;
  line-height: .86;
  letter-spacing: -0.045em;
  color: var(--navy);
}
.m-hero__lead {
  max-width: 500px;
  margin-top: 24px;
  font-size: clamp(17px, 1rem + .3vw, 20px);
  line-height: 1.55;
  color: #2c4670;
}

.m-keyspecs {
  display: grid;
  grid-template-columns: repeat(var(--n, 3), auto);
  justify-content: start;
  gap: 0;
  margin: 32px 0 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--white);
  overflow: hidden;
}
.m-keyspecs > div { padding: 18px min(26px, 5cqi) 18px min(22px, 4.2cqi); } /* tudo encolhe junto com a coluna */
.m-keyspecs > div + div { border-left: 1px solid var(--line); }
.m-keyspecs dt { font-family: var(--font-body); font-size: min(12px, 2.29cqi); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.m-keyspecs dd {
  margin: 6px 0 0;
  font-size: clamp(24px, 1.2rem + .8vw, 32px);
  font-size: min(clamp(24px, 1.2rem + .8vw, 32px), calc(var(--fs, 32) * 1px), calc(var(--fs, 32) * 100cqi / 524)); /* --fs vem do gerador */
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--navy);
  white-space: nowrap; /* o tamanho já é calculado para caber; quem quebra linha é o rótulo */
}
.m-keyspecs .nw { white-space: nowrap; }
.m-keyspecs--wrap dd { white-space: normal; } /* faixas longas quebram depois do traço */
.m-keyspecs small { font-size: .55em; font-weight: 700; letter-spacing: 0; color: var(--orange); }

.m-hero__actions { margin-top: 32px; }

/* ---------- Galeria ---------- */
.m-gallery__stage { position: relative; }
.m-gallery__main {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 28px;
  background: var(--card-bg);
  box-shadow: 0 40px 80px -48px rgba(18, 50, 110, .55);
  cursor: zoom-in;
}
.m-gallery__main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.1s var(--ease), opacity .35s var(--ease);
}
.m-gallery__main img.is-fading { opacity: 0; }
.m-gallery__main:hover img { transform: scale(1.04); }
.m-gallery__count {
  position: absolute;
  top: 18px;
  left: 18px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(12, 37, 84, .72);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.m-gallery__zoom {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  color: var(--navy);
  opacity: 0;
  transform: scale(.8);
  transition: opacity .4s var(--ease), transform .5s var(--ease);
}
.m-gallery__zoom svg { width: 20px; height: 20px; }
.m-gallery__main:hover .m-gallery__zoom,
.m-gallery__main:focus-visible .m-gallery__zoom { opacity: 1; transform: none; }
.m-gallery__nav {
  position: absolute;
  right: 18px;
  bottom: 18px;
  display: flex;
  gap: 10px;
}
.m-gallery__nav .arrow { background: rgba(255, 255, 255, .92); border-color: transparent; }
.m-gallery__nav .arrow:hover { background: var(--navy); }

.m-gallery__thumbs {
  display: grid;
  grid-template-columns: repeat(var(--cols, 5), minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.m-gallery__thumbs button {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 14px;
  background: var(--card-bg);
  opacity: .55;
  cursor: pointer;
  box-shadow: inset 0 0 0 0 var(--orange);
  transition: opacity .3s var(--ease), box-shadow .3s var(--ease), transform .3s var(--ease);
}
.m-gallery__thumbs img { width: 100%; height: 100%; object-fit: cover; }
.m-gallery__thumbs button:hover { opacity: .9; transform: translateY(-2px); }
.m-gallery__thumbs button.is-active { opacity: 1; box-shadow: 0 0 0 3px var(--orange); }

/* ---------- Cabeçalhos de seção ---------- */
.m-head { margin-bottom: clamp(36px, 3.5vw, 56px); }
.m-head--split { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.m-head__link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: none;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
  transition: color .3s var(--ease), gap .3s var(--ease);
}
.m-head__link svg { width: 18px; height: 18px; color: var(--orange); }
.m-head__link:hover { color: var(--orange); gap: 14px; }

/* ---------- Características ---------- */
.m-features { padding-top: clamp(56px, 5vw, 96px); }
.m-features__grid {
  display: grid;
  grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr));
  gap: var(--gutter);
}
.m-feature {
  padding: 30px 28px 32px;
  border-radius: 24px;
  background: var(--card-bg);
  transition: translate .45s var(--ease), background-color .45s var(--ease), box-shadow .45s var(--ease);
}
.m-feature:hover { translate: 0 -6px; background: var(--white); box-shadow: 0 30px 60px -36px rgba(18, 50, 110, .45); }
.m-feature__icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--navy);
  color: var(--orange);
}
.m-feature__icon svg { width: 26px; height: 26px; }
.m-feature h3 { margin-top: 24px; font-size: 20px; font-weight: 800; line-height: 1.2; color: var(--navy); }
.m-feature p { margin-top: 10px; font-family: var(--font-body); font-size: 15px; line-height: 1.6; color: var(--muted); }

/* ---------- Especificações ---------- */
.m-specs { padding-top: 0; }
.m-specs__grid {
  display: grid;
  grid-template-columns: minmax(0, 8fr) minmax(0, 4fr);
  gap: clamp(32px, 4vw, 64px);
  align-items: start;
}
.m-specs__main .title { margin-bottom: 28px; }

.m-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px;
  border-radius: 999px;
  background: var(--card-bg);
}
.m-tabs button {
  height: 44px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--navy);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color .35s var(--ease), color .35s var(--ease), box-shadow .35s var(--ease);
}
.m-tabs button:hover { color: var(--orange); }
.m-tabs button[aria-selected="true"] { background: var(--white); color: var(--navy); box-shadow: 0 6px 18px -10px rgba(18, 50, 110, .5); }

.m-panel { margin-top: 24px; }
.m-panel[hidden] { display: none; }
.m-panel.is-entering { animation: panel-in .5s var(--ease-expo); }
@keyframes panel-in { from { opacity: 0; transform: translateY(10px); } }

.m-table { margin: 0; border-top: 1px solid var(--line); }
.m-table > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: baseline;
  padding: 16px 4px;
  border-bottom: 1px solid var(--line);
  transition: background-color .25s var(--ease);
}
.m-table > div:hover { background: var(--card-bg); }
.m-table dt { font-family: var(--font-body); font-size: 15px; color: var(--muted); }
.m-table dd { margin: 0; font-size: 16px; font-weight: 700; color: var(--navy); text-align: right; }
.m-note--top { margin: -12px 0 18px; }
.m-empty { max-width: 620px; padding: 28px; border-radius: 20px; background: var(--card-bg); font-family: var(--font-body); font-size: 16px; line-height: 1.6; color: #2c4670; }
.m-note { margin-top: 18px; font-family: var(--font-body); font-size: 13px; line-height: 1.6; color: var(--muted); }

.m-aside { position: sticky; top: calc(var(--header-h) + 24px); }
.m-card {
  padding: 32px 28px 28px;
  border-radius: 28px;
  background: var(--navy);
  color: var(--white);
  box-shadow: 0 40px 80px -50px rgba(18, 50, 110, .8);
}
.m-card__icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .1);
  color: var(--orange);
}
.m-card__icon svg { width: 28px; height: 28px; }
.m-card h3 { margin-top: 22px; font-size: 22px; font-weight: 800; line-height: 1.2; }
.m-card p { margin-top: 10px; font-family: var(--font-body); font-size: 15px; line-height: 1.6; color: rgba(255, 255, 255, .75); }
.m-card .btn { margin-top: 22px; }
.m-card .btn--block { height: auto; min-height: 56px; padding-block: 8px; white-space: normal; line-height: 1.25; text-align: left; } /* códigos longos de modelo quebram linha */
.m-card .btn--wa { margin-top: 14px; }
.m-card__divider { height: 1px; margin: 26px 0 0; background: rgba(255, 255, 255, .14); }
.m-card__small { font-size: 14px !important; }

/* ---------- Outros modelos ---------- */
.m-others { padding-top: 0; }
.m-others__track { grid-auto-columns: calc((100% - 3 * var(--gutter)) / 4); }

.m-model-card { scroll-snap-align: start; }
.carousel__track.is-dragging .m-model-card a { pointer-events: none; }
.carousel.is-static .carousel__bar { display: none; }
.carousel.is-static .carousel__track { cursor: auto; }
.m-model-card a {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--white);
  transition: translate .45s var(--ease), box-shadow .45s var(--ease), border-color .45s var(--ease);
}
.m-model-card a:hover { translate: 0 -6px; border-color: transparent; box-shadow: 0 34px 60px -36px rgba(18, 50, 110, .5); }
.m-model-card__img { aspect-ratio: 4 / 3; overflow: hidden; background: var(--card-bg); }
.m-model-card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.1s var(--ease); }
.m-model-card a:hover .m-model-card__img img { transform: scale(1.06); }
.m-model-card__body { display: flex; flex-direction: column; flex: 1; padding: 22px 22px 24px; }
.m-model-card__type { overflow: hidden; font-family: var(--font-body); font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--orange); white-space: nowrap; text-overflow: ellipsis; } /* sempre numa linha */
.m-model-card h3 { margin-top: 6px; font-size: 34px; font-weight: 900; letter-spacing: -0.03em; line-height: 1; color: var(--navy); }
.m-model-card dl { margin: 18px 0 0; }
.m-model-card dl > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
  font-family: var(--font-body);
  font-size: 14px;
}
.m-model-card dt { color: var(--muted); }
.m-model-card dd { margin: 0; font-weight: 700; color: var(--navy); text-align: right; }
.m-model-card__go {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 18px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
}
.m-model-card__go svg { width: 18px; height: 18px; color: var(--orange); transition: transform .45s var(--ease); }
.m-model-card a:hover .m-model-card__go svg { transform: translateX(6px); }
/* botão do card no padrão da home: o preenchimento nasce quando o mouse entra no card */
.m-model-card dl { margin-bottom: 22px; }
.m-model-card__btn { align-self: flex-start; margin-top: auto; }
.m-model-card a:hover .m-model-card__btn::before { transform: translate(50%, -50%) scale(55); }
.m-model-card a:hover .m-model-card__btn .btn__icon svg { transform: rotate(-45deg); }

/* ---------- Chamada ---------- */
.m-cta__text {
  max-width: 560px;
  margin: 20px auto 0;
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.6;
  color: rgba(255, 255, 255, .92);
}

/* ==========================================================================
   Responsivo
   ========================================================================== */
@media (max-width: 1240px) {
  .m-features__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .m-others__track { grid-auto-columns: calc((100% - 2 * var(--gutter)) / 3); }
}

@media (max-width: 1024px) {
  .m-hero__grid { grid-template-columns: minmax(0, 1fr); }
  .m-gallery { order: -1; }
  .m-specs__grid { grid-template-columns: minmax(0, 1fr); }
  .m-aside { position: static; }
  .m-others__track { grid-auto-columns: calc((100% - var(--gutter)) / 2.3); }
}

@media (max-width: 600px) {
  .m-hero { padding-top: 20px; }
  .m-gallery__main { border-radius: 20px; }
  .m-gallery__nav { display: none; }
  .m-gallery__thumbs { gap: 8px; margin-top: 10px; }
  .m-gallery__thumbs:has(> li:nth-child(6)) { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 22%; overflow-x: auto; scrollbar-width: none; }
  .m-gallery__thumbs button { border-radius: 10px; }

  .m-keyspecs { grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); width: 100%; }
  .m-keyspecs > div { padding: 14px 12px; }
  .m-keyspecs dt { font-size: 10.5px; letter-spacing: .08em; }
  .m-keyspecs dd { font-size: clamp(18px, 5.2vw, 22px); white-space: normal; }

  .m-features__grid { grid-template-columns: 1fr; }
  .m-head--split { flex-direction: column; align-items: flex-start; }

  .m-tabs { display: flex; width: 100%; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .m-tabs::-webkit-scrollbar { display: none; }
  .m-tabs button { flex: none; padding: 0 16px; font-size: 14px; }
  .m-table > div { grid-template-columns: 1fr; gap: 4px; padding: 14px 2px; }
  .m-table dd { text-align: left; }

  .m-others__track { grid-auto-columns: 82%; }

}
