/* =========================================================
   Rízia — Landing page
   Medidas de referência: frame Desktop do Figma (1920px),
   container de conteúdo de 1216px (x 352 → 1568).
   ========================================================= */

:root {
  --blue: #104b85;
  --green: #87bd38;
  --green-hover: #79ab2f;
  --text: #515151;
  --text-strong: #383838;
  --muted: #838383;
  --soft: #f3f6f9;
  --line: #cdcdcd;
  --dot: #d9d9d9;
  --input-border: #1f71c2;
  --placeholder: #9b9b9b;
  --form-muted: #9ca1a3;

  --container: 1216px;
  --gutter: 24px;
  --radius: 16px;
}

@media (min-width: 768px) {
  :root { --gutter: 40px; }
}

/* ---------- Base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 22px;
  color: var(--text);
  background: #fff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, figure, address { margin: 0; }
address { font-style: normal; }
ul { margin: 0; padding: 0; list-style: none; }
a { color: inherit; }

.container {
  width: min(var(--container), 100% - 2 * var(--gutter));
  margin-inline: auto;
}

.nowrap { white-space: nowrap; }
.strong { font-weight: 700; color: var(--text-strong); }

/* H2 do Figma: Archivo Condensed Bold 60/68 */
.title {
  font-stretch: 75%;
  font-weight: 700;
  font-size: clamp(2.25rem, 1.25rem + 2.1vw, 3.75rem);
  line-height: 1.1334;
  color: var(--blue);
}

.eyebrow {
  font-size: 20px;
  line-height: 28px;
  color: var(--muted);
}
.eyebrow + .title { margin-top: 8px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 32px;
  border: 0;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  font: inherit;
  font-weight: 700;
  line-height: 22px;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .2s ease, transform .2s ease;
}
.btn:hover { background: var(--green-hover); }
.btn:active { transform: translateY(1px); }
.btn--sm { padding-block: 10px; }

:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }

/* ---------- Header ---------- */
.header {
  position: relative;
  z-index: 20;
  background: #fff;
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 136px;
}

.header__logo img { width: 176px; }

.header__nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

.header__links {
  display: flex;
  gap: 32px;
}

.header__links a {
  font-weight: 700;
  color: var(--blue);
  text-decoration: none;
  white-space: nowrap;
}
.header__links a:hover { color: var(--green); }

.header__social {
  display: flex;
  align-items: center;
  gap: 15px;
}
.header__social a { display: block; transition: opacity .2s ease; }
.header__social a:hover { opacity: .65; }

.header__toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  color: var(--blue);
}
.header__toggle span,
.header__toggle span::before,
.header__toggle span::after {
  display: block;
  width: 26px;
  height: 2px;
  margin-inline: auto;
  border-radius: 2px;
  background: currentColor;
  transition: transform .25s ease, opacity .25s ease;
}
.header__toggle span { position: relative; }
.header__toggle span::before,
.header__toggle span::after { content: ""; position: absolute; left: 0; }
.header__toggle span::before { top: -8px; }
.header__toggle span::after { top: 8px; }
.header__toggle[aria-expanded="true"] span { background: transparent; }
.header__toggle[aria-expanded="true"] span::before { transform: translateY(8px) rotate(45deg); background: var(--blue); }
.header__toggle[aria-expanded="true"] span::after { transform: translateY(-8px) rotate(-45deg); background: var(--blue); }

@media (max-width: 1139px) {
  .header__inner { min-height: 88px; }
  .header__logo img { width: 120px; }
  .header__toggle { display: block; }

  .header__nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
    padding: 24px var(--gutter) 32px;
    background: #fff;
    box-shadow: 0 12px 24px rgba(16, 75, 133, .12);
  }
  .header__nav.is-open { display: flex; }
  .header__links { flex-direction: column; gap: 20px; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 60px 60px 60px;
  background: var(--green);
}

/* card 664px com faixa branca de 148px no rodapé (516/664 = 77.71%) */
.hero__card {
  overflow: hidden;
  border-radius: 24px;
  background: linear-gradient(to bottom, var(--blue) 77.71%, #fff 77.71%);
}

.hero__inner {
  display: flex;
  align-items: flex-start;
}

/* imagem 779x682: x 271 → 1050 (81px antes do container), começa 18px acima do card */
.hero__media {
  flex: 0 0 64.06%;
  margin-left: -6.66%;
  margin-top: -1.48%;
}
.hero__media img { width: 100%; }

/* texto: x 1067, 181px abaixo do topo do card */
.hero__content {
  flex: 0 1 38.49%;
  margin-left: 1.4%;
  padding-top: 14.885%;
  color: #fff;
}
.hero__title { color: #fff; }
.hero__lead { margin-top: 24px; }

.hero__scroll {
  position: absolute;
  left: 50%;
  bottom: 11px;
  display: block;
  width: 40px;
  height: 40px;
  color: var(--blue);
  transform: translateX(-50%);
  animation: nudge 2.4s ease-in-out infinite;
}

@keyframes nudge {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 5px); }
}

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

@media (max-width: 1279px) {
  .hero { padding: 32px 32px 56px; }
  .hero__scroll { bottom: 8px; }
}

@media (max-width: 899px) {
  .hero { padding: 16px 16px 52px; }
  .hero__card { background: var(--blue); }
  .hero__inner { flex-direction: column; align-items: stretch; }
  .hero__content {
    order: -1;
    flex: none;
    margin: 0;
    padding: 40px 0 8px;
  }
  /* a faixa branca acompanha a imagem quando ela fica embaixo do texto */
  .hero__media {
    flex: none;
    margin: 0 calc(-1 * var(--gutter));
    background: linear-gradient(to bottom, transparent 78.3%, #fff 78.3%); /* 148/682 da imagem */
  }
  .hero__media img { max-width: 520px; margin-inline: auto; }
  .hero__scroll { bottom: 6px; }
}

/* ---------- Nossa história ---------- */
.about {
  padding: 123px 0 138px;
  background: var(--soft);
}

.about__photo {
  overflow: hidden;
  border-radius: var(--radius);
  aspect-ratio: 1216 / 396;
}
.about__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 31%;
}

.about__grid {
  display: grid;
  grid-template-columns: 592fr 624fr;
  margin-top: 56px;
}

.about__text { margin-top: 52px; }
.about__text p + p { margin-top: 22px; }

/* ---------- Farinhas de arroz ---------- */
.farinhas {
  padding: 112px 0 117px;
  overflow-x: clip;
}

.farinhas__top {
  display: flex;
  align-items: flex-start;
}

.farinhas__info {
  position: relative;
  z-index: 1;
  flex: 0 0 48.85%;
  padding-top: 87px;
}

.farinhas__desc { margin-top: 24px; }
.farinhas__desc p + p { margin-top: 22px; }

/* grupo das embalagens: x 929 → 1662, 94px além do container */
.farinhas__media {
  position: relative;
  flex: 0 0 60.28%;
  aspect-ratio: 733 / 744;
  margin-left: -1.4%;
  margin-right: max(-7.73%, -1 * var(--gutter));
}
.farinhas__bag { position: absolute; }
.farinhas__bag--lg { left: 16.37%; top: 0; width: 83.63%; }
.farinhas__bag--sm { left: 0; top: 38.71%; width: 51.16%; }

.features {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: 24px;
}
.features li {
  display: flex;
  align-items: center;
  gap: 16px;
  font-weight: 700;
  color: var(--text-strong);
}
.features img { flex: none; }

.farinhas__rule {
  margin: 48px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.scale-title {
  font-stretch: 75%;
  font-weight: 700;
  font-size: 24px;
  line-height: 30px;
  color: var(--blue);
}

.scale-row {
  display: flex;
  align-items: flex-end;
  gap: 47px;
  margin-top: 16px;
}

.scale-frame {
  position: relative;
  flex: 0 1 889px;
  min-width: 0;
}

.scale {
  padding: 27px 21px 27px 22px;
  border-radius: var(--radius);
  background: var(--blue);
  color: #fff;
}

/* separate + bordas nas células: permite fixar a coluna de rótulos no mobile */
.scale table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}
.scale__col-label { width: 159px; }
.scale__col-last { width: 83px; }

.scale th,
.scale td {
  padding: 0;
  vertical-align: middle;
  text-align: left;
}
.scale th {
  padding-right: 48px;
  text-align: right;
  font-weight: 700;
}
.scale td {
  font-size: 14px;
  line-height: 22px;
}

.scale tr + tr > * { border-top: 1px solid var(--green); }
.scale tr:nth-child(1) > * { padding-bottom: 21px; }
.scale tr:nth-child(2) > * { padding-top: 22px; padding-bottom: 27px; }
.scale tr:nth-child(3) > * { padding-top: 20px; }
.scale tr:nth-child(3) > th { padding-top: 24px; }

.pill {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 63px;
  height: 32px;
  border: 1px solid var(--green);
  border-radius: 10px;
  font-size: 16px;
  line-height: 1;
}

.scale td.scale__end { padding-right: 20px; text-align: right; }

.scale__dots {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 30px 0 -19px;
}
.scale__dots i { flex: none; border-radius: 50%; background: var(--dot); }
.scale__dots .d4 { width: 4px; height: 4px; }
.scale__dots .d35 { width: 3.5px; height: 3.5px; }
.scale__dots .d3 { width: 3px; height: 3px; }
.scale__dots .d2 { width: 2px; height: 2px; }

.scale__val {
  display: block;
  width: 63px;
  text-align: center;
}
.scale__val > span { display: inline-block; text-align: right; }

.scale-hint { display: none; }

.scale-aside p {
  margin-bottom: 16px;
  color: var(--blue);
}

.farinhas__note {
  max-width: 655px;
  margin-top: 48px;
}

/* ---------- Coloríficos ---------- */
.colorificos {
  padding: 127px 0;
  background: var(--soft);
  overflow-x: clip;
}

.colorificos__head { text-align: center; }

.product-tabs { display: none; }

.product {
  display: flex;
  align-items: flex-start;
  margin-top: 112px;
}
.colorificos__head + .product { margin-top: 80px; }

.product__title {
  font-stretch: 75%;
  font-weight: 700;
  font-size: 34px;
  line-height: 44px;
  margin-bottom: -11px; /* caixa de texto de 33px no Figma */
  color: var(--blue);
}
.product__title .regular { font-weight: 400; }

.product__desc { margin-top: 32px; max-width: 598px; }
.product .features { margin-top: 32px; }
.product__note { margin-top: 32px; max-width: 655px; }

/* Colorau: texto 759px + imagem 487px (41px além do container) */
.product--colorau .product__info { flex: 0 0 62.42%; }
.product--colorau .product__media {
  flex: 0 0 40.05%;
  margin-left: .9%;
  margin-right: max(-3.37%, -1 * var(--gutter));
}

/* Colorau Premium: imagem 515px (55px antes do container) + texto alinhado à direita */
.product--premium .product__media {
  flex: 0 0 42.35%;
  margin-left: max(-4.52%, -1 * var(--gutter));
}
.product--premium .product__info {
  position: relative;
  flex: 0 0 62.58%;
  margin-left: -.41%;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
}
.product--premium .product__desc { max-width: 623px; }
.product--premium .product__note { max-width: 608px; }
.product--premium .features { align-items: flex-end; }
.product--premium .features li { flex-direction: row-reverse; }

/* ---------- Qualidade ---------- */
.quality {
  padding: 101px 0 128px;
  overflow-x: clip;
}

.quality__grid {
  display: flex;
  align-items: flex-start;
}

.quality__info {
  flex: 0 0 48.68%;
  padding-top: 28px;
}
.quality__info .title { max-width: 461px; }

.quality__text { margin-top: 22px; }
.quality__text p + p { margin-top: 22px; }

/* imagem: x 976 → 1577 (9px além do container) */
.quality__media {
  flex: 0 0 49.42%;
  margin-left: 2.63%;
  margin-right: -.74%;
}

/* ---------- Contato ---------- */
.contact {
  padding: 102px 0 96px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--blue);
  color: #fff;
}

.contact__grid {
  display: flex;
  justify-content: space-between;
  gap: 48px;
}

/* 494px no Figma; +8px compensa a renderização um pouco mais larga da fonte no navegador */
.contact__info { flex: 0 1 502px; }
.contact__form { flex: 0 1 592px; }

.contact__title {
  max-width: 443px;
  color: #fff;
}

.contact__text {
  margin-top: 11px;
  font-weight: 300;
  line-height: 28px;
}
.contact__text p + p { margin-top: 28px; }
.contact__text strong { font-weight: 700; }

.contact__list {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: 24px;
}
.contact__list li {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.contact__list img { flex: none; }
.contact__list li > :not(img) { padding-top: 1px; }
.contact__list a { text-decoration: none; }
.contact__list a.underline { text-decoration: underline; text-underline-offset: 2px; }
.contact__list a:hover { color: var(--green); }
.contact__list address { max-width: 346px; }

.field + .field { margin-top: 24px; }

.field label {
  display: block;
  margin-bottom: 22px;
  font-weight: 700;
}

.field input {
  display: block;
  width: 100%;
  height: 55px;
  padding: 0 24px;
  border: 1px solid var(--input-border);
  border-radius: 8px;
  background: transparent;
  color: #fff;
  font: inherit;
  transition: border-color .2s ease, background-color .2s ease;
}
.field input::placeholder { color: var(--placeholder); opacity: 1; }
.field input:hover { border-color: #3a80c6; }
.field input:focus {
  outline: none;
  border-color: var(--green);
  background: rgba(255, 255, 255, .04);
}

.checks {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 24px;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
  line-height: 22px;
  color: var(--form-muted);
  cursor: pointer;
}
.check a { text-decoration: none; }
.check a:hover { color: #fff; }

.check input {
  flex: none;
  appearance: none;
  -webkit-appearance: none;
  width: 15px;
  height: 15px;
  margin: 4px 0 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-content: center;
}
.check input::after {
  content: "";
  width: 8px;
  height: 4px;
  margin-top: -2px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) scale(0);
  transition: transform .15s ease;
}
.check input:checked {
  border-color: var(--green);
  background: var(--green);
}
.check input:checked::after { transform: rotate(-45deg) scale(1); }

.contact__submit {
  display: flex;
  margin: 24px 0 0 auto;
}

/* ---------- Mapa ---------- */
.map iframe {
  display: block;
  width: 100%;
  height: 521px;
  border: 0;
  filter: grayscale(1);
}

/* ---------- Footer ---------- */
.footer {
  background: var(--green);
  font-size: 14px;
  line-height: 22px;
  color: var(--text);
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 32px;
  min-height: 86px;
}

.footer__credits {
  display: flex;
  align-items: center;
  gap: 8px;
}
.footer__credits a { display: block; transition: opacity .2s ease; }
.footer__credits a:hover { opacity: .7; }

/* =========================================================
   Responsivo
   ========================================================= */

/* Tablet / notebooks pequenos */
@media (max-width: 1279px) {
  .about { padding: 96px 0 104px; }
  .farinhas { padding: 96px 0; }
  .colorificos { padding: 96px 0; }
  .quality { padding: 88px 0 104px; }
  .contact { padding: 88px 0; }
}

@media (max-width: 1099px) {
  .scale-row { flex-direction: column; align-items: flex-start; gap: 24px; }
  .scale-frame { flex: none; width: 100%; max-width: 889px; }
}

/* Mobile */
@media (max-width: 899px) {
  .about { padding: 64px 0 72px; }
  .about__photo { aspect-ratio: 16 / 10; }
  .about__grid { grid-template-columns: 1fr; gap: 24px; margin-top: 32px; }
  .about__text { margin-top: 0; }

  .farinhas { padding: 64px 0 72px; }
  .farinhas__top { flex-direction: column; }
  .farinhas__info { flex: none; padding-top: 0; }
  .farinhas__media {
    flex: none;
    width: min(100%, 520px);
    margin: 32px auto 0;
  }
  .farinhas__rule { margin: 40px 0; }

  /* Escala: colunas F20–F80 deslizam na horizontal, rótulos ficam fixos à esquerda */
  .scale {
    padding: 0;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scroll-padding-left: 112px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .scale::-webkit-scrollbar { display: none; }
  .scale:focus-visible { outline-offset: 2px; }

  .scale table { min-width: 592px; }
  .scale col { width: 96px; }
  .scale col.scale__col-label { width: 112px; }

  .scale th,
  .scale td { text-align: center; }
  .scale th {
    position: sticky;
    left: 0;
    z-index: 1;
    padding: 0 12px 0 16px;
    background: var(--blue);
    font-size: 14px;
    line-height: 20px;
    text-align: left;
    transition: box-shadow .2s ease;
  }
  .scale-frame.is-scrolled .scale th { box-shadow: 8px 0 12px -8px rgba(0, 0, 0, .45); }

  .scale tr:nth-child(1) > * { padding-top: 20px; padding-bottom: 18px; }
  .scale tr:nth-child(2) > * { padding-top: 18px; padding-bottom: 18px; }
  .scale tr:nth-child(3) > * { padding-top: 16px; padding-bottom: 20px; }
  .scale tr:nth-child(3) > th { padding-top: 16px; }
  .scale tr:first-child td { scroll-snap-align: start; }
  .scale td:last-child { padding-right: 16px; }

  .scale td.nowrap { white-space: normal; }
  .scale td.scale__end { padding-right: 16px; text-align: center; }
  .pill,
  .scale__val { margin-inline: auto; }
  .scale__dots { margin: 0 6px; }

  /* degradê na borda direita: indica que há mais colunas */
  .scale-frame::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 56px;
    height: 100%;
    border-radius: 0 var(--radius) var(--radius) 0;
    background: linear-gradient(to right, rgba(16, 75, 133, 0), var(--blue) 85%);
    pointer-events: none;
    transition: opacity .25s ease;
  }
  .scale-frame.is-end::after { opacity: 0; }

  .scale-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: -12px; /* compensa o gap de 24px do .scale-row */
    font-size: 13px;
    line-height: 18px;
    color: var(--muted);
    transition: opacity .25s ease;
  }
  .scale-hint span { display: inline-block; animation: hint-x 1.6s ease-in-out infinite; }
  .scale-frame.is-end + .scale-hint { opacity: 0; }

  @keyframes hint-x {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(4px); }
  }

  @media (prefers-reduced-motion: reduce) {
    .scale-hint span { animation: none; }
  }

  .farinhas__note { margin-top: 40px; }

  .colorificos { padding: 64px 0 72px; }
  .colorificos__head + .product { margin-top: 48px; }
  .product,
  .product--premium { flex-direction: column; margin-top: 64px; }
  .product .product__info,
  .product .product__media { flex: none; width: 100%; margin: 0; }
  .product .product__media {
    order: -1;
    max-width: 320px;
    margin: 0 auto 24px;
  }
  .product__desc { margin-top: 20px; }
  .product .features,
  .product__note { margin-top: 24px; }

  .product--premium .product__info { align-items: flex-start; text-align: left; }
  .product--premium .features { align-items: flex-start; }
  .product--premium .features li { flex-direction: row; }

  /* Abas Colorau / Colorau Premium (ativadas pelo script.js) */
  .colorificos.has-tabs .product-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    max-width: 360px;
    margin: 24px auto 0;
    padding: 4px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(16, 75, 133, .1);
  }
  .product-tabs button {
    padding: 10px 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--blue);
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    line-height: 20px;
    cursor: pointer;
    transition: background-color .2s ease, color .2s ease;
  }
  .product-tabs button[aria-selected="true"] {
    background: var(--blue);
    color: #fff;
  }

  .colorificos.has-tabs .product { margin-top: 32px; }
  .colorificos.has-tabs .product.is-inactive { display: none; }
  .colorificos.has-tabs .product:not(.is-inactive) { animation: tab-in .3s ease; }

  @keyframes tab-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
  }

  @media (prefers-reduced-motion: reduce) {
    .colorificos.has-tabs .product:not(.is-inactive) { animation: none; }
  }

  .quality { padding: 64px 0 72px; }
  .quality__grid { flex-direction: column; }
  .quality__info { flex: none; padding-top: 0; }
  .quality__media { flex: none; width: 100%; max-width: 601px; margin: 40px auto 0; }

  .contact { padding: 64px 0 72px; }
  .contact__grid { flex-direction: column; gap: 48px; }
  .contact__info,
  .contact__form { flex: none; }
  .contact__submit { width: 100%; }

  .map iframe { height: 360px; }

  .footer__inner {
    flex-direction: column;
    justify-content: center;
    padding: 24px 0;
    text-align: center;
  }
  .footer__credits { flex-wrap: wrap; justify-content: center; }
}

@media (max-width: 479px) {
  .eyebrow { font-size: 18px; line-height: 26px; }
  .features li { font-size: 15px; }
  .features img { width: 44px; height: auto; }
}
