/* Kuki · página do prende-chupetas que muda de tecido (só carregada nesse artigo).
   Cartão fosco com a fotografia do prende-chupetas e bolinhas com a foto de cada tecido. */

.product--tecido { align-items: start; }
/* fica parado logo abaixo do cabeçalho (que também fica preso ao topo); a altura dele vem do JavaScript */
.product--tecido .product-gallery { position: sticky; top: calc(var(--kuki-header-h, 0px) + .75rem); }

.tecido-stage {
  display: block; position: relative; width: 100%; height: min(calc(100vh - var(--kuki-header-h, 0px) - 2rem), 680px); min-height: 380px;
  /* 29/11/2026 (pedido da dona): o mesmo creme e a mesma costura do cartão das opções ao lado */
  border-radius: 26px; background: #FFFAF1;
  box-shadow: 0 1px 2px rgba(90, 70, 40, .08), 0 22px 30px -18px rgba(90, 70, 40, .45);
  overflow: hidden;
}
.tecido-stage::before { content: ""; position: absolute; inset: 9px; border: 2px dashed rgba(156, 139, 108, .55); border-radius: 18px; pointer-events: none; z-index: 1; }
.tecido-stage canvas { position: absolute; left: 4%; top: 4%; width: 92%; height: 92%; display: block; object-fit: contain; }
/* Troca sem piscar (29/11/2026, a dona: "não haver telas a piscar"): antes o desenho antigo desaparecia ao mesmo tempo que o
   novo aparecia e, a meio, os dois ficavam meio transparentes (o prende parecia desbotar). Agora o novo aparece por cima
   (z-index 1) e o antigo fica inteiro por baixo até ao fim e só então some (sem animação). Igual para a imagem pronta. */
.tecido-cv { opacity: 0; z-index: 0; transition: opacity 0s linear .32s; }
.tecido-cv.on { opacity: 1; z-index: 1; transition: opacity .3s ease; }
.tecido-loading { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; color: var(--ink-soft); font-weight: 700; font-size: .9rem; }
.tecido-loading[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .tecido-cv, .tecido-cv.on, .tecido-ph, .tecido-ph.off { transition: none; } }

/* Opções: modelo (franzido / liso), cor da mola, personalização e resumo do pedido */
.product--tecido .opcoes { border: 0; padding: 0; margin: 1.3rem 0 0; min-width: 0; }
.product--tecido .opcoes--modelo { margin: 0 0 1.3rem; }
.product--tecido .opcoes legend { padding: 0; font: 800 .72rem/1.2 var(--font-body); letter-spacing: .09em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: .6rem; }
.product--tecido .opcoes legend span { display: block; margin-top: .2rem; font-size: 1.05rem; letter-spacing: 0; text-transform: none; color: var(--ink); }
.op-pills { display: flex; flex-wrap: wrap; gap: .5rem; }
.op-pill { position: relative; cursor: pointer; touch-action: manipulation; }
.op-pill input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; font-size: 16px; }
.op-pill span { display: block; padding: .6rem 1.3rem; border-radius: 999px; background: #FFFAF1; box-shadow: inset 0 0 0 2px rgba(156, 139, 108, .38); font-weight: 800; font-size: .95rem; transition: background .15s ease, color .15s ease; }
.op-pill input:checked + span { background: var(--ink); color: #FFF8EC; box-shadow: none; }
.op-pill input:focus-visible + span { outline: 3px solid var(--ink); outline-offset: 2px; }
.mola-dots { display: flex; gap: .5rem; }
.mola-dot { position: relative; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; touch-action: manipulation; }
.mola-dot input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; font-size: 16px; }
.mola-dot i { display: block; width: 38px; height: 38px; border-radius: 50%; background: var(--c); pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .14), inset 0 -3px 6px rgba(0, 0, 0, .08), inset 0 3px 5px rgba(255, 255, 255, .5); }
.mola-dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 3px solid transparent; pointer-events: none; transition: border-color .15s ease; }
.mola-dot:has(input:checked)::after { border-color: var(--ink); }
.mola-dot:has(input:focus-visible) { outline: 3px solid var(--ink); outline-offset: 2px; }
.op-texto { display: block; margin: 1.3rem 0 0; }
.op-texto .op-label { display: block; font: 800 .72rem/1.2 var(--font-body); letter-spacing: .09em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: .5rem; }
.op-texto small { font-size: inherit; text-transform: none; letter-spacing: 0; font-weight: 700; }
.op-texto input { width: 15rem; max-width: 100%; padding: .65rem .9rem; font: 800 16px/1.2 var(--font-body); letter-spacing: .02em; /* nomes sem limite de letras (29/11/2026) */ border-radius: 12px; border: 2px solid rgba(156, 139, 108, .45); background: #FFFAF1; color: var(--ink); }
.op-texto input:focus { outline: none; border-color: var(--ink); }
.pedido { margin: 1.3rem 0 0; padding: 1rem 1.15rem 1.05rem; border-radius: 18px; background: #FFFAF1; box-shadow: inset 0 0 0 1.5px rgba(156, 139, 108, .35); }
/* "O teu pedido" em talão (28/11/2026): o título e o botão "Copiar"; uma linha por escolha (modelo, tecido, mola, nome),
   com o nome à esquerda e a escolha à direita, separadas por um tracejado fino; por baixo a dica.
   Têm sempre as mesmas 4 linhas, por isso a caixa não muda de altura ao trocar de escolha. */
.pedido-topo { display: flex; align-items: center; justify-content: space-between; gap: .8rem; margin-bottom: .4rem; }
.pedido-titulo { margin: 0; font: 800 .72rem/1.2 var(--font-body); letter-spacing: .09em; text-transform: uppercase; color: var(--ink-soft); }
.pedido-lista { margin: 0; }
.pedido-lista > div { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 2.4rem; padding: .3rem 0; border-top: 1.5px dashed rgba(156, 139, 108, .32); }
.pedido-lista dt { flex: none; font-size: .9rem; font-weight: 700; color: var(--ink-soft); }
.pedido-lista dd { margin: 0; min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: .45rem; font-weight: 800; text-align: right; line-height: 1.25; }
.pedido-cor { flex: none; width: 1.2rem; height: 1.2rem; border-radius: 50%; background: var(--fill, #ddd) center / cover;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .2), inset 0 2px 3px rgba(255, 255, 255, .45); }
.pedido-nome { letter-spacing: .12em; }
.pedido-extra { flex: none; font-size: .75rem; font-weight: 800; padding: .18rem .5rem; border-radius: 999px; background: rgba(156, 139, 108, .2); }
.pedido-vazio { font-weight: 700; color: var(--ink-soft); }
.pedido-dica { margin: 0; padding-top: .6rem; border-top: 1.5px dashed rgba(156, 139, 108, .32); font-size: .82rem; line-height: 1.4; color: var(--ink-soft); }
.pedido-dica b { color: var(--ink); }
.pedido-copiar { flex: none; display: inline-flex; align-items: center; gap: .35rem; font: 800 .78rem/1.2 var(--font-body); padding: .4rem .85rem; border-radius: 999px; border: 1.5px solid var(--ink); background: none; color: var(--ink); cursor: pointer; touch-action: manipulation; }
.pedido-copiar svg { flex: none; }
.pedido-copiar:hover, .pedido-copiar.is-ok { background: var(--ink); color: #FFF8EC; }
/* o botão principal fica cheio (o "Copiar" é o secundário) */
.product--tecido .buy-row .btn--ghost { background: var(--ink); color: #FFF8EC; }

/* Página inicial: o prende-chupetas a mudar de tecido sozinho, no lugar da colagem */
.hero-tecido { display: block; text-decoration: none; color: inherit; }
.tecido-stage--hero { height: clamp(380px, 46vw, 560px); min-height: 0; transition: transform .25s ease; }
.hero-tecido:hover .tecido-stage--hero { transform: translateY(-3px); }
.tecido-ph { position: absolute; left: 4%; top: 4%; width: 92%; height: 92%; object-fit: contain; transition: opacity .3s ease; }
.tecido-ph.off { opacity: 0; transition: opacity 0s linear .32s; }   /* só sai quando o desenho já está inteiro por cima */
.hero-tecido-caption { display: block; text-align: center; margin-top: .75rem; font: 400 1.35rem/1.25 var(--font-hand); color: var(--ink); }
.hero-tecido-caption span { color: var(--ink-soft); }
@media (max-width: 800px) {
  .tecido-stage--hero { height: 380px; }
}
@media (max-width: 600px) {
  .tecido-stage--hero { height: 320px; border-radius: 24px; }
  .hero-tecido-caption { font-size: 1.1rem; margin-top: .55rem; }
}

/* Bolinhas de tecido */
.swatches--tecido { display: block; }
.swatches--tecido legend { font-weight: 900; margin-bottom: .55rem; }
.swatches--tecido legend span { font-weight: 700; color: var(--ink-soft); }
.tecido-dots { display: flex; flex-wrap: wrap; gap: .5rem; }
.tecido-dot { position: relative; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.tecido-dot input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; font-size: 16px; touch-action: manipulation; } /* 16px: o iPhone não faz zoom ao tocar */
.tecido-dot, .tecido-stage { touch-action: manipulation; }
/* iPhone: os toques vão para o cartão (não para o desenho por cima), sem seleção nem menu de toque longo */
.tecido-stage { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.tecido-stage canvas { pointer-events: none; touch-action: manipulation; }
.tecido-dot i {
  display: block; width: 40px; height: 40px; border-radius: 50%; pointer-events: none;
  background: var(--fill); background-size: var(--size, 40px); background-position: center;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .14), inset 0 -3px 6px rgba(0, 0, 0, .1), inset 0 3px 5px rgba(255, 255, 255, .25);
  transition: transform .15s ease;
}
.tecido-dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 3px solid transparent; pointer-events: none; transition: border-color .15s ease; }
.tecido-dot:hover i { transform: scale(1.06); }
.tecido-dot:has(input:checked)::after { border-color: var(--ink); }
.tecido-dot:has(input:focus-visible) { outline: 3px solid var(--ink); outline-offset: 2px; }
.tecido-dot.is-out { opacity: .4; cursor: not-allowed; }
.tecido-dot.is-out i { position: relative; }
.tecido-dot.is-out i::after { content: ""; position: absolute; left: 50%; top: 4px; bottom: 4px; width: 2px; background: var(--ink); transform: rotate(45deg); }

/* Arrumação da página do prende-chupetas (computador e telemóvel):
   título e preço (em etiqueta) em cima, "TECIDO" + nome do tecido, e a seguir ao botão
   a frase, a descrição e os selos juntos num só remendo creme ("Detalhes"). */
/* o menu já diz "Prende-chupetas": sem o caminho repetido por cima do título */
.product--tecido .crumbs { display: none; }
.product--tecido .product-info { display: flex; flex-direction: column; }
.product--tecido .product-info h1 { order: 1; margin: 0 0 .6rem; line-height: 1.05; }
.product--tecido .product-price { order: 2; align-self: flex-start; justify-self: start; margin: 0 0 1.4rem; }
.product--tecido form.buy { order: 3; }
.product--tecido .lead { order: 4; }
.product--tecido .description { order: 5; }
.product--tecido .perks { order: 6; }
.product--tecido .product-price.is-soon {
  font: 800 .85rem/1 var(--font-body); color: var(--ink-soft); background: #FFFAF1;
  padding: .5rem .9rem; border-radius: 999px; box-shadow: inset 0 0 0 1.5px rgba(156, 139, 108, .35);
}
.product--tecido .swatches--tecido { margin-top: 0; }
/* "TECIDO" pequeno em cima e o nome do tecido escolhido por baixo */
.product--tecido .swatches--tecido legend { font: 800 .72rem/1.2 var(--font-body); letter-spacing: .09em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: .6rem; }
.product--tecido .swatches--tecido legend span { display: block; margin-top: .2rem; font-size: 1.05rem; letter-spacing: 0; text-transform: none; color: var(--ink); font-weight: 800; }
.product--tecido .stock { font-size: .88rem; min-height: 0; margin: .8rem 0 1rem; }

/* remendo "Detalhes": três peças seguidas (frase, descrição, selos) com a costura desenhada por dentro */
.product--tecido .lead, .product--tecido .description, .product--tecido .perks {
  position: relative; margin: 0; max-width: none; background: #FFFAF1; border: 0;
  padding: 0 1.7rem; color: var(--ink-soft); font-size: 1rem; line-height: 1.55;
}
.product--tecido .lead { margin-top: 2.2rem; padding-top: 1.6rem; border-radius: 26px 26px 0 0; }
.product--tecido .lead::before { content: "Detalhes"; display: block; font: 400 1.7rem/1.1 var(--font-hand); color: var(--ink); margin-bottom: .45rem; }
.product--tecido .description { padding-top: .5rem; }
.product--tecido .description, .product--tecido .perks { margin-top: -1px; } /* sem risca fina entre as peças */
.product--tecido .perks {
  padding-top: .9rem; padding-bottom: 1.7rem; border-radius: 0 0 26px 26px;
  box-shadow: 0 22px 30px -18px rgba(90, 70, 40, .45);
}
.product--tecido .perks li { background: #F3EAD9; }
.product--tecido .lead::after, .product--tecido .description::after, .product--tecido .perks::after {
  content: ""; position: absolute; left: 9px; right: 9px; top: 0; bottom: 0; pointer-events: none;
  border: 2px dashed rgba(156, 139, 108, .55); border-top: 0; border-bottom: 0;
}
.product--tecido .lead::after { top: 9px; border-top: 2px dashed rgba(156, 139, 108, .55); border-radius: 18px 18px 0 0; }
.product--tecido .perks::after { bottom: 9px; border-bottom: 2px dashed rgba(156, 139, 108, .55); border-radius: 0 0 18px 18px; }

/* Telemóvel: título e preço em cima; por baixo, o prende-chupetas à esquerda e os tecidos à direita.
   O cartão do prende-chupetas tem a altura da coluna dos tecidos (vai até ao fim deles), sem espaço vazio. */
@media (max-width: 600px) {
  .product.product--tecido {
    grid-template-columns: minmax(0, 1fr) 9rem; column-gap: .8rem; row-gap: 0; /* 9rem = 3 bolinhas por linha */
    grid-template-areas: "title title" "price price" "modelo modelo" "img tecido" "mola mola" "ponta ponta" "texto texto" "pedido pedido" "alt alt" "lead lead" "desc desc" "perks perks";
  }
  .product--tecido .product-info { display: contents; }
  .product--tecido .product-info h1 { grid-area: title; margin: 0 0 .35rem; font-size: 2rem; }
  .product--tecido .product-price { grid-area: price; margin: 0 0 1.1rem; }
  .product--tecido .product-price.is-soon { font-size: .82rem; padding: .45rem .8rem; }
  /* as opções do formulário entram na grelha: modelo em cima, tecidos ao lado da imagem, mola e texto por baixo */
  .product--tecido form.buy { display: contents; }
  .product--tecido .opcoes--modelo { grid-area: modelo; margin: 0 0 1.1rem; }
  .product--tecido .swatches--tecido { grid-area: tecido; }
  .product--tecido .opcoes--mola { grid-area: mola; margin-top: 1.3rem; }
  .product--tecido .opcoes--ponta { grid-area: ponta; margin-top: 1.3rem; }
  .product--tecido .op-texto { grid-area: texto; }
  .product--tecido .pedido { grid-area: pedido; }
  .product--tecido .alt-order { grid-area: alt; }
  .product--tecido .product-gallery { grid-area: img; position: relative; top: auto; align-self: stretch; }
  .product--tecido .tecido-stage { height: 100%; min-height: 330px; border-radius: 24px; }
  /* com espaço à volta, para o prende-chupetas não parecer ampliado e a mola caber inteira */
  .product--tecido .tecido-stage canvas { inset: 0; margin: auto; width: auto; height: auto; max-width: 84%; max-height: 88%; }
  .product--tecido .swatches--tecido legend { font-size: .7rem; margin-bottom: .55rem; }
  /* nome do tecido: até 2 linhas, com o espaço das 2 sempre guardado, para o desenho ao lado não mudar de altura
     ao trocar de tecido (29/11/2026, pedido da dona) */
  .product--tecido .swatches--tecido legend { width: 100%; max-width: 100%; }
  .product--tecido .swatches--tecido legend span { font-size: 1rem; line-height: 1.25; min-height: 2.5em; white-space: normal;
    overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow-wrap: break-word; }
  .product--tecido .stock { font-size: .85rem; margin: .7rem 0 0; }
  .tecido-dots { gap: .3rem; }
  .tecido-dot { width: 44px; height: 44px; }
  .tecido-dot i { width: 36px; height: 36px; }
  .product--tecido .lead, .product--tecido .description, .product--tecido .perks { padding-left: 1.45rem; padding-right: 1.45rem; font-size: .95rem; }
  .product--tecido .lead { grid-area: lead; padding-top: 1.5rem; }
  .product--tecido .lead::before { font-size: 1.6rem; }
  .product--tecido .description { grid-area: desc; }
  .product--tecido .perks { grid-area: perks; padding-bottom: 1.6rem; }
  .product--tecido .perks li { font-size: .8rem; }
}
/* Computador: as escolhas todas num só remendo creme (como o "Detalhes"), cada uma na sua linha,
   separadas por um tracejado fino; o nome escolhido ao lado do título; o botão de encomendar no fim. */
@media (min-width: 601px) {
  .product--tecido form.buy {
    position: relative; margin: 0; padding: 1.6rem 1.5rem 1.6rem; border-radius: 26px; background: #FFFAF1;
    box-shadow: 0 1px 2px rgba(90, 70, 40, .08), 0 22px 30px -18px rgba(90, 70, 40, .45);
  }
  .product--tecido form.buy::before {
    content: ""; position: absolute; inset: 9px; border: 2px dashed rgba(156, 139, 108, .55); border-radius: 18px; pointer-events: none;
  }
  .product--tecido .opcoes--modelo { position: relative; margin: 0; }
  .product--tecido .swatches--tecido, .product--tecido .opcoes--mola, .product--tecido .opcoes--ponta, .product--tecido .op-texto { position: relative; margin: 2.2rem 0 0; }
  /* o tracejado fica a meio do espaço entre duas escolhas: desenhado no fim de cada uma
     (no início não dá: nos grupos com título, o navegador punha-o à altura do título) */
  .product--tecido .opcoes--modelo::after, .product--tecido .swatches--tecido::after, .product--tecido .opcoes--mola::after, .product--tecido .opcoes--ponta::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -1.1rem; border-top: 1.5px dashed rgba(156, 139, 108, .32); pointer-events: none;
  }
  .product--tecido .opcoes legend span, .product--tecido .swatches--tecido legend span { display: inline; margin: 0 0 0 .3rem; font-size: 1rem; }
  .product--tecido .tecido-dots { gap: .45rem; }
  .product--tecido .stock { margin: .6rem 0 0; }
  .product--tecido .pedido { margin-top: 1.6rem; background: #F6EEDF; box-shadow: none; }
  /* até 800 px o site punha nowrap e o fundo da barra do telemóvel; aqui (sem barra) não */
  .product--tecido .buy-row { margin-top: 1rem; flex-wrap: wrap; background: none; border: 0; padding: 0; box-shadow: none; }
  /* 10rem: se não couber ao lado da quantidade (ecrãs médios), o botão passa para a linha de baixo, a toda a largura */
  .product--tecido .buy-row .btn { flex: 1 1 10rem; justify-content: center; text-align: center; }
  .product--tecido .alt-order { margin-bottom: 0; }
}

/* telemóveis muito estreitos: tudo numa coluna */
@media (max-width: 340px) {
  .product.product--tecido { grid-template-columns: 1fr; grid-template-areas: "title" "price" "modelo" "img" "tecido" "mola" "ponta" "texto" "pedido" "alt" "lead" "desc" "perks"; }
  .product--tecido .tecido-stage { height: auto; min-height: 0; aspect-ratio: 1 / 1.6; }
}
