/* Estilos da loja Ateliê Fio a Fio */
html {
  color-scheme: light;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
}
/* Layout: vitrine de ateliê. Faixa de entrada em tons de lã, peças em molduras ovais de tapete, bordas em ponto de crochê (escalopes). */
:root {
  --bg: #f8f2e9;
  --surface: #fffbf4;
  --ink: #2b1a17;
  --muted: #74605a;
  --red: #b3122b;
  --red-ink: #fff6f0;
  --green: #1f5a3c;
  --green-soft: #dce9de;
  --line: #e6d9c6;
  --blue: #6fa8d6;
  --display: "Young Serif", "Georgia", serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --shadow: 0 18px 40px -22px rgba(60, 20, 15, 0.45);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1a1210;
    --surface: #251a17;
    --ink: #f6ebdd;
    --muted: #b9a598;
    --red: #e0334c;
    --red-ink: #fff6f0;
    --green: #7cc19a;
    --green-soft: #1e2e25;
    --line: #3a2a25;
    --blue: #8dbbe2;
    --shadow: 0 18px 40px -22px rgba(0, 0, 0, 0.8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1a1210;
  --surface: #251a17;
  --ink: #f6ebdd;
  --muted: #b9a598;
  --red: #e0334c;
  --red-ink: #fff6f0;
  --green: #7cc19a;
  --green-soft: #1e2e25;
  --line: #3a2a25;
  --blue: #8dbbe2;
  --shadow: 0 18px 40px -22px rgba(0, 0, 0, 0.8);
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 0;
}
img {
  display: block;
  max-width: 100%;
}
a {
  color: inherit;
}
button {
  font: inherit;
  cursor: pointer;
}
:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 3px;
  border-radius: 6px;
}
.wrap {
  max-width: 1160px;
  margin: 0 auto;
}
h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.08;
  text-wrap: balance;
  margin: 0;
}
.eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--red);
}

/* top ribbon */
.ribbon {
  margin-inline: calc(-1 * max(16px, env(safe-area-inset-left, 0px)));
  padding: 8px max(16px, env(safe-area-inset-right, 0px)) 8px
    max(16px, env(safe-area-inset-left, 0px));
  background: var(--red);
  color: var(--red-ink);
  text-align: center;
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* header */
header.top {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  margin-inline: calc(-1 * max(16px, env(safe-area-inset-left, 0px)));
  padding-inline: max(16px, env(safe-area-inset-left, 0px))
    max(16px, env(safe-area-inset-right, 0px));
  border-bottom: 1px solid var(--line);
}
header .row {
  max-width: 1160px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  padding-block: 12px;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  min-width: 0;
}
.brand svg {
  flex: none;
}
.brand b {
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.3rem;
  white-space: nowrap;
}
nav.links {
  display: flex;
  gap: 22px;
  font-weight: 600;
  font-size: 0.95rem;
}
nav.links a {
  text-decoration: none;
  color: var(--muted);
}
nav.links a:hover {
  color: var(--red);
}
.bag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--ink);
  color: var(--bg);
  border: 0;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.92rem;
}
.bag .n {
  background: var(--red);
  color: var(--red-ink);
  border-radius: 999px;
  min-width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  font-size: 0.78rem;
  padding: 0 6px;
}
@media (max-width: 720px) {
  nav.links {
    display: none;
  }
}

/* scallop divider */
.scallop {
  height: 14px;
  background: radial-gradient(
      circle at 12px 0,
      transparent 11px,
      var(--c, var(--red)) 11.5px
    )
    repeat-x;
  background-size: 24px 14px;
}
.scallop.flip {
  transform: scaleY(-1);
}

/* hero */
.hero {
  padding-block: 56px 72px;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 48px;
  align-items: center;
}
.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.9rem);
  letter-spacing: -0.01em;
}
.hero h1 em {
  font-style: normal;
  color: var(--red);
  position: relative;
  white-space: nowrap;
}
.hero h1 em::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.08em;
  height: 0.28em;
  background: radial-gradient(
      circle at 10px 100%,
      transparent 8px,
      var(--green) 8.5px
    )
    repeat-x;
  background-size: 20px 100%;
  opacity: 0.9;
}
.hero p.lead {
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 46ch;
  margin: 22px 0 28px;
}
.cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 700;
  padding: 14px 24px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-size: 1rem;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s;
}
.btn:hover {
  transform: translateY(-2px);
}
.btn.primary {
  background: var(--red);
  border-color: var(--red);
  color: var(--red-ink);
  box-shadow: 0 12px 26px -12px var(--red);
}
.btn.wa {
  background: #1fa855;
  border-color: #1fa855;
  color: #fff;
}
.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  margin-top: 34px;
  font-size: 0.92rem;
  color: var(--muted);
  font-weight: 600;
}
.facts span::before {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  margin-right: 9px;
}

.collage {
  position: relative;
  aspect-ratio: 1/1.08;
  max-width: 560px;
  width: 100%;
  margin-inline: auto;
}
.collage .oval {
  position: absolute;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 6px solid var(--surface);
}
.collage .o1 {
  inset: 0 22% 30% 0;
  border-radius: 999px;
}
.collage .o2 {
  inset: 34% 0 0 30%;
  border-radius: 999px;
}
.collage .o3 {
  width: 30%;
  aspect-ratio: 1;
  left: 2%;
  bottom: 2%;
  border-radius: 50%;
}
.collage img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.stitch-badge {
  position: absolute;
  right: 2%;
  top: 4%;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  display: grid;
  place-items: center;
  text-align: center;
  font-family: var(--display);
  font-size: 0.98rem;
  line-height: 1.1;
  padding: 14px;
  transform: rotate(10deg);
  box-shadow: var(--shadow);
  outline: 2px dashed rgba(255, 255, 255, 0.6);
  outline-offset: -8px;
}
@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 36px;
    padding-block: 36px 52px;
  }
  .stitch-badge {
    width: 96px;
    height: 96px;
    font-size: 0.82rem;
  }
}

/* sections */
section {
  padding-block: 72px;
}
.sec-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-bottom: 34px;
}
.sec-head h2 {
  font-size: clamp(2rem, 4.4vw, 3.2rem);
  margin-top: 10px;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  padding: 9px 18px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.92rem;
}
.chip[aria-pressed="true"] {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

/* products */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr));
  gap: 30px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 28px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
}
.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
}
.card .ph {
  position: relative;
  aspect-ratio: 4/4.2;
  overflow: hidden;
  background: var(--green-soft);
}
.card .ph img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}
.card:hover .ph img {
  transform: scale(1.05);
}
.card .ph.tall img {
  object-fit: contain;
  background: var(--green-soft);
}
.tag {
  position: absolute;
  left: 14px;
  top: 14px;
  background: var(--bg);
  color: var(--ink);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 999px;
}
.card .body {
  padding: 22px 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}
.card h3 {
  font-size: 1.5rem;
}
.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.96rem;
}
.opts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.opts label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  min-width: 0;
}
select {
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
  background: var(--bg);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  width: 100%;
  min-width: 0;
}
.price {
  font-weight: 700;
  color: var(--green);
  font-size: 0.95rem;
}
.card .actions {
  margin-top: auto;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.card .actions .btn {
  padding: 12px 18px;
  font-size: 0.95rem;
  flex: 1 1 auto;
}

/* builder */
.builder {
  background: var(--green);
  color: #f3f7f1;
  margin-inline: calc(-1 * max(16px, env(safe-area-inset-left, 0px)));
  padding-inline: max(16px, env(safe-area-inset-left, 0px))
    max(16px, env(safe-area-inset-right, 0px));
  position: relative;
  padding-block: 90px;
}
.builder::before,
.builder::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 14px;
  --c: var(--green);
}
.builder::before {
  top: -13px;
  background: radial-gradient(
      circle at 12px 100%,
      transparent 11px,
      var(--green) 11.5px
    )
    repeat-x;
  background-size: 24px 14px;
}
.builder::after {
  bottom: -13px;
  background: radial-gradient(
      circle at 12px 0,
      transparent 11px,
      var(--green) 11.5px
    )
    repeat-x;
  background-size: 24px 14px;
}
.builder .wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}
.builder .eyebrow {
  color: #f9c9cf;
}
.builder h2 {
  font-size: clamp(2rem, 4.4vw, 3.4rem);
  margin: 10px 0 14px;
}
.builder p {
  color: #cfe0d3;
  max-width: 48ch;
  margin: 0 0 26px;
}
.picker {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.picker .grp b {
  display: block;
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 8px;
  color: #cfe0d3;
}
.sw {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.sw button {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 3px solid transparent;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.28);
  padding: 0;
  transition: transform 0.15s;
}
.sw button:hover {
  transform: scale(1.1);
}
.sw button[aria-pressed="true"] {
  box-shadow: 0 0 0 3px #fff;
}
.shape {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.shape button {
  background: transparent;
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.45);
  padding: 9px 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
}
.shape button[aria-pressed="true"] {
  background: #fff;
  color: var(--green);
}
.stage {
  display: grid;
  place-items: center;
  min-height: 360px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 36px;
  padding: 28px;
  overflow: hidden;
}
.rug {
  display: grid;
  place-items: center;
  transition: all 0.35s ease;
  box-shadow: 0 26px 40px -18px rgba(0, 0, 0, 0.55);
}
.rug[data-shape="oval"] {
  width: min(100%, 360px);
  aspect-ratio: 1.5/1;
  border-radius: 50%;
}
.rug[data-shape="pass"] {
  width: min(100%, 130px);
  aspect-ratio: 1/2.7;
  border-radius: 999px;
}
.rug[data-shape="redondo"] {
  width: min(100%, 290px);
  aspect-ratio: 1/1;
  border-radius: 50%;
}
.rug .r1,
.rug .r2,
.rug .r3 {
  display: block;
  border-radius: inherit;
}
.rug .r1 {
  width: 100%;
  height: 100%;
  padding: 6%;
  background: var(--edge);
  display: grid;
  place-items: center;
  border-radius: inherit;
}
.rug .r2 {
  width: 100%;
  height: 100%;
  padding: 7%;
  background: var(--ring);
  display: grid;
  place-items: center;
  border-radius: inherit;
}
.rug .r3 {
  width: 100%;
  height: 100%;
  background: var(--base);
  display: grid;
  place-items: center;
  border-radius: inherit;
  position: relative;
}
.rug .r3::after {
  content: "";
  width: 46%;
  height: 26%;
  background: var(--core);
  border-radius: 999px;
}
.rug[data-shape="pass"] .r3::after {
  width: 30%;
  height: 62%;
}
.rug[data-shape="redondo"] .r3::after {
  width: 44%;
  height: 44%;
  border-radius: 50%;
}
.rug .r1 {
  background-image: repeating-radial-gradient(
    circle at 50% 50%,
    transparent 0 5px,
    rgba(0, 0, 0, 0.07) 5px 6px
  );
}

/* steps */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 26px;
  counter-reset: s;
  padding: 0;
  margin: 0;
  list-style: none;
}
.steps li {
  counter-increment: s;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 28px 26px;
  position: relative;
  min-width: 0;
}
.steps li::before {
  content: counter(s);
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--red);
  color: var(--red-ink);
  font-family: var(--display);
  font-size: 1.3rem;
  margin-bottom: 16px;
}
.steps h3 {
  font-size: 1.35rem;
  margin-bottom: 6px;
}
.steps p {
  margin: 0;
  color: var(--muted);
}

/* gallery strip */
.strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.strip figure {
  margin: 0;
  border-radius: 26px;
  overflow: hidden;
  aspect-ratio: 1/1.1;
  background: var(--green-soft);
}
.strip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.strip figure:nth-child(2) {
  margin-top: 34px;
}
@media (max-width: 640px) {
  .strip {
    grid-template-columns: 1fr 1fr;
  }
  .strip figure:nth-child(3) {
    display: none;
  }
  .strip figure:nth-child(2) {
    margin-top: 20px;
  }
}

/* footer */
footer {
  margin-inline: calc(-1 * max(16px, env(safe-area-inset-left, 0px)));
  background: var(--ink);
  color: var(--bg);
  padding: 64px max(16px, env(safe-area-inset-right, 0px)) calc(48px + 70px)
    max(16px, env(safe-area-inset-left, 0px));
  position: relative;
}
footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 36px;
  justify-content: space-between;
  align-items: end;
}
footer h2 {
  font-size: clamp(2rem, 4.5vw, 3.4rem);
  max-width: 14ch;
}
footer .info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 1rem;
  min-width: 0;
}
footer .info span {
  opacity: 0.75;
}
footer .info strong {
  font-size: 1.25rem;
  user-select: all;
}
footer .info strong a {
  color: inherit;
  text-decoration: none;
}
footer .info strong a:hover {
  text-decoration: underline;
}
footer .info .sep {
  opacity: 0.7;
}
footer small {
  display: block;
  width: 100%;
  opacity: 0.55;
  margin-top: 20px;
}

/* drawer */
.fab {
  position: fixed;
  right: calc(16px + env(safe-area-inset-right, 0px));
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #1fa855;
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 14px 20px;
  font-weight: 700;
  box-shadow: 0 14px 30px -10px rgba(0, 0, 0, 0.55);
}
.scrim {
  position: fixed;
  inset: 0;
  background: rgba(20, 8, 6, 0.55);
  z-index: 40;
}
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(100%, 420px);
  background: var(--bg);
  z-index: 50;
  display: flex;
  flex-direction: column;
  padding: calc(20px + env(safe-area-inset-top, 0px))
    calc(20px + env(safe-area-inset-right, 0px))
    calc(20px + env(safe-area-inset-bottom, 0px)) 20px;
  box-shadow: -20px 0 50px -20px rgba(0, 0, 0, 0.6);
  transform: translateX(0);
  transition: transform 0.3s ease;
}
.drawer[hidden] {
  display: flex !important;
  transform: translateX(105%);
  visibility: hidden;
}
.drawer header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.drawer h2 {
  font-size: 1.7rem;
}
.x {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.2rem;
}
.items {
  flex: 1;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px 2px;
}
.item {
  display: flex;
  gap: 12px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 10px;
}
.item img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 12px;
  flex: none;
}
.item div {
  flex: 1;
  min-width: 0;
}
.item b {
  display: block;
  font-size: 0.98rem;
  line-height: 1.25;
}
.item small {
  color: var(--muted);
  display: block;
}
.qty {
  display: flex;
  align-items: center;
  gap: 6px;
}
.qty button {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font-weight: 700;
}
.empty {
  color: var(--muted);
  text-align: center;
  padding: 40px 10px;
}
.drawer .note {
  margin: 12px 0;
  font-size: 0.88rem;
  color: var(--muted);
}
.drawer textarea {
  width: 100%;
  font: inherit;
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 14px;
  padding: 10px 12px;
  resize: vertical;
  min-height: 70px;
  margin-bottom: 12px;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(86px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--bg);
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 600;
  z-index: 60;
  font-size: 0.92rem;
  max-width: calc(100% - 32px);
}

@media (max-width: 860px) {
  .builder .wrap {
    grid-template-columns: 1fr;
    gap: 34px;
  }
  .stage {
    min-height: 300px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
