@import url('https://api.fontshare.com/v2/css?f[]=general-sans@300,400,500,600,700&display=swap');

:root {
  --bg: #f2f2f2;
  --fg: #898989;
  --fg-strong: #6f6f6f;
  --white: #ffffff;
  --border: #cfcfcf;
  --max-width: 1296px; /* 1200px de conteúdo + 48px de respiro de cada lado */
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: 'General Sans', 'Degular', -apple-system, sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-transform: lowercase;
}

.rs { text-transform: none; }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; text-transform: lowercase; }
img { display: block; max-width: 100%; }

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 48px;
}

/* ---------- HEADER ---------- */

.site-header {
  padding: 30px 0 18px;
  position: relative;
}

.header-icons {
  position: absolute;
  top: 30px;
  right: 48px;
  display: flex;
  gap: 20px;
  z-index: 5;
}

.header-icons a,
.header-icons button {
  background: none;
  border: none;
  color: var(--fg);
  cursor: pointer;
  display: flex;
  align-items: center;
  position: relative;
  padding: 0;
}

.header-icons a:hover { color: var(--fg-strong); }
.header-icons a:hover svg { stroke: var(--fg-strong); }
.header-icons svg { width: 22px; height: 22px; stroke: var(--fg); }

.cart-count {
  position: absolute;
  top: -8px;
  right: -10px;
  background: var(--fg-strong);
  color: var(--white);
  font-size: 10px;
  min-width: 16px;
  height: 16px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}

.cart-count.show { display: flex; }

.logo-mark {
  display: block;
  text-align: center;
  margin: 0 auto 8px;
  max-width: 300px;
  cursor: pointer;
}

.logo-mark img { width: 100%; height: auto; margin: 0 auto; }

.main-nav {
  display: flex;
  justify-content: center;
  gap: 50px;
  font-size: 17px;
  letter-spacing: .4px;
}

.main-nav a {
  background: none;
  border: none;
  color: var(--fg);
  padding-bottom: 4px;
  cursor: pointer;
  font-size: 17px;
  font-family: inherit;
  text-transform: lowercase;
}

.main-nav a.active { border-bottom: 1px solid var(--fg); color: var(--fg-strong); }
.main-nav a:hover { color: var(--fg-strong); }

/* ---------- SECTIONS (spa view-switching) ---------- */

.view {
  display: none;
  padding: 36px 0 70px;
  min-height: 50vh;
}

.view.view-active { display: block; }

.section-title {
  font-size: 14px;
  letter-spacing: 3px;
  color: var(--fg);
  margin: 0 0 40px;
  opacity: .7;
}

/* ---------- GALERIA GRID ---------- */

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 44px 40px;
}

.product-card {
  display: block;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  text-align: left;
  width: 100%;
  font-family: inherit;
}

/* ---- vitrine: containers de imagem com proporção 100% uniforme ---- */
/* .product-card-fixed / .product-image-container-fixed são usados tanto na
   galeria principal quanto na subseção "peças disponíveis" do arquivo,
   garantindo que as 6 fotos (camisetas + acessórios) fiquem sempre
   perfeitamente centralizadas, sem distorção, corte ou estiramento. */

.product-card-fixed {
  display: flex;
  flex-direction: column;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  text-align: left;
  width: 100%;
  font-family: inherit;
}

.product-image-container-fixed {
  width: 100%;
  height: 100%;
  aspect-ratio: 4 / 5;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg);
}

.product-card-fixed img,
.product-image-container-fixed img {
  display: block;
  max-width: 92%;
  max-height: 92%;
  width: auto;
  height: auto;
  object-fit: contain;
  margin: auto;
  transition: transform .45s cubic-bezier(.2,.7,.3,1);
  transform-origin: center center;
}

.product-card-fixed:hover .product-image-container-fixed img { transform: scale(1.03); }

.fixed-card-label {
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--fg);
}

.product-card .img-box {
  aspect-ratio: 4 / 5;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg);
  padding: 6%;
}

.product-card .img-box.tight { padding: 15%; }

.product-card .img-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform .45s cubic-bezier(.2,.7,.3,1);
  transform-origin: center center;
}

.product-card:hover .img-box img { transform: scale(1.03); }

/* galeria fixa, sem scroll, em telas desktop (a altura exata é calculada via JS) */
@media (min-width: 901px) {
  #galeria.view.view-active:not(.galeria-scroll) {
    padding: 0;
    display: flex;
    align-items: center;
    overflow: hidden;
    min-height: 0;
  }

  #galeria.view-active:not(.galeria-scroll) .wrap { width: 100%; height: 100%; display: flex; align-items: center; }

  #galeria.view-active:not(.galeria-scroll) .product-grid {
    width: 100%;
    height: 100%;
    max-height: 100%;
    grid-template-rows: repeat(2, 1fr);
    row-gap: 22px;
  }

  #galeria.view-active:not(.galeria-scroll) .product-card-fixed {
    height: 100%;
    min-height: 0;
  }

  #galeria.view-active:not(.galeria-scroll) .product-image-container-fixed {
    aspect-ratio: auto;
    width: 100%;
    height: 100%;
    min-height: 0;
    min-width: 0;
  }

  #galeria.view-active:not(.galeria-scroll) .product-image-container-fixed img {
    min-height: 0;
    min-width: 0;
    max-width: 70%;
    max-height: 70%;
  }

  /* camisetas um pouco menores que os acessórios na vitrine */
  #galeria.view-active:not(.galeria-scroll) .card-camiseta .product-image-container-fixed img {
    max-width: 60%;
    max-height: 60%;
  }

  /* a touca é quase quadrada: menor pra ter o mesmo peso visual dos bonés */
  #galeria.view-active:not(.galeria-scroll) .card-touca .product-image-container-fixed img {
    max-width: 56%;
    max-height: 56%;
  }
}

.card-camiseta .product-image-container-fixed img {
  max-width: 82%;
  max-height: 82%;
}

.card-touca .product-image-container-fixed img {
  max-width: 70%;
  max-height: 70%;
}

/* ---------- ARQUIVO: sem peças no momento ---------- */

.arquivo-vazio {
  min-height: 38vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.arquivo-vazio .section-title { margin-bottom: 18px; }

.arquivo-aviso {
  margin: 0;
  font-size: 15px;
  letter-spacing: 3px;
  color: var(--fg-strong);
}

.preco-nota {
  display: inline-block;
  margin-left: 10px;
  font-size: 12px;
  letter-spacing: .5px;
  color: #a8a8a8;
  vertical-align: middle;
}

/* ---------- ARQUIVO: peças disponíveis + acervo/indisponíveis ---------- */

.arquivo-subhead {
  font-size: 15px;
  letter-spacing: 2.5px;
  color: var(--fg-strong);
  font-weight: 500;
  margin: 56px 0 28px;
  padding-top: 34px;
  border-top: 1px solid #e2e2e0;
}

.arquivo-subhead.first {
  margin-top: 8px;
  padding-top: 0;
  border-top: none;
}

.arquivo-intro {
  max-width: 620px;
  font-size: 15px;
  line-height: 1.8;
  margin: -20px 0 44px;
  color: var(--fg);
}

.arquivo-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px 24px;
}

.arquivo-card {
  position: relative;
  display: block;
  border: none;
  background: none;
  padding: 0;
  text-align: left;
  width: 100%;
  font-family: inherit;
}

.arquivo-card .img-box {
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.arquivo-card img {
  display: block;
  max-width: 88%;
  max-height: 88%;
  width: auto;
  height: auto;
  object-fit: contain;
  margin: auto;
  transition: filter .5s ease, transform .5s ease;
}

/* peças de acervo: iniciam em cinza, ganham cor de forma nítida e dão um leve zoom no hover */
.arquivo-card.arquivo-esgotado { cursor: default; }
.arquivo-card.arquivo-esgotado img { filter: grayscale(1); }
.arquivo-card.arquivo-esgotado:hover img {
  filter: grayscale(0);
  transform: scale(1.03);
}

.arquivo-card .arquivo-label {
  margin-top: 14px;
  font-size: 13px;
  color: var(--fg);
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.arquivo-tag {
  font-size: 10px;
  letter-spacing: 1.5px;
  color: #adadad;
  white-space: nowrap;
}

.arquivo-tag.disponivel { color: var(--fg-strong); }

/* ---------- SOBRE ---------- */

#sobre {
  background: var(--bg);
  border-top: 1px solid #e2e2e0;
}

.sobre-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 90px;
  align-items: center;
}

.sobre-visual {
  display: flex;
  align-items: center;
  justify-content: center;
}

.sobre-visual .logo3d { max-width: 320px; }

/* ---------- SÍMBOLO 3D (three.js, com png girando como reserva) ---------- */

.logo3d {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
}

.logo3d > img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  animation: spin3D 14s linear infinite;
  transform-style: preserve-3d;
}

.logo3d > canvas {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  display: block;
  pointer-events: none;
}

.logo3d.is-3d > img { visibility: hidden; animation: none; }

.sobre-text {
  font-size: 19px;
  line-height: 1.95;
  color: var(--fg);
}

.sobre-text p { margin: 0 0 26px; }
.sobre-text strong { color: var(--fg-strong); font-weight: 500; }
.sobre-text .assinatura {
  margin-top: 40px;
  font-size: 14px;
  letter-spacing: 2px;
  color: #b7b7b7;
}

/* ---------- CARRINHO ---------- */

.carrinho-vazio {
  font-size: 16px;
  color: var(--fg);
  padding: 40px 0;
}

.carrinho-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 70px;
  align-items: start;
}

.carrinho-lista {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.carrinho-item {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 24px;
  align-items: center;
  border-bottom: 1px solid #e2e2e0;
  padding-bottom: 28px;
}

.carrinho-item .item-img {
  width: 110px;
  height: 110px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8%;
}

.carrinho-item .item-img.tight { padding: 16%; }
.carrinho-item .item-img img { width: 100%; height: 100%; object-fit: contain; }

.carrinho-item .item-info .item-nome { color: var(--fg-strong); font-size: 17px; margin: 0 0 4px; }
.carrinho-item .item-info .item-tamanho { font-size: 13px; color: var(--fg); margin: 0 0 14px; }

.qty-control {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--border);
  width: fit-content;
  padding: 6px 14px;
}

.qty-control button {
  background: none;
  border: none;
  color: var(--fg);
  font-size: 16px;
  cursor: pointer;
  width: 18px;
}

.qty-control button:hover { color: var(--fg-strong); }
.qty-control span { min-width: 14px; text-align: center; font-size: 14px; }

.carrinho-item .item-side {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 14px;
}

.carrinho-item .item-preco { font-size: 16px; color: var(--fg-strong); }

.item-remover {
  background: none;
  border: none;
  color: #b5b5b5;
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.item-remover:hover { color: var(--fg-strong); }

.carrinho-resumo {
  border: 1px solid #e2e2e0;
  padding: 32px;
}

.carrinho-resumo h3 {
  font-size: 15px;
  letter-spacing: 1px;
  color: var(--fg-strong);
  margin: 0 0 24px;
  font-weight: 500;
}

.resumo-linha {
  display: flex;
  justify-content: space-between;
  font-size: 15px;
  color: var(--fg);
  margin-bottom: 14px;
}

.resumo-linha.total {
  color: var(--fg-strong);
  font-size: 18px;
  border-top: 1px solid #e2e2e0;
  padding-top: 16px;
  margin-top: 16px;
}

.checkout-btn {
  width: 100%;
  padding: 19px;
  background: var(--fg);
  color: var(--white);
  border: none;
  font-size: 16px;
  cursor: pointer;
  transition: background .2s ease;
  margin-top: 22px;
}

.checkout-btn:hover { background: var(--fg-strong); }

/* ---------- PÁGINAS INSTITUCIONAIS ---------- */

.policy-content {
  max-width: 760px;
}

.policy-content h1 {
  font-size: 28px;
  font-weight: 600;
  color: var(--fg-strong);
  margin: 0 0 34px;
}

.policy-content h2 {
  font-size: 16px;
  font-weight: 500;
  color: var(--fg-strong);
  margin: 34px 0 12px;
}

.policy-content p {
  font-size: 15px;
  line-height: 1.85;
  color: var(--fg);
  margin: 0 0 18px;
}

.policy-back {
  display: inline-block;
  margin-bottom: 36px;
  background: none;
  border: none;
  color: var(--fg);
  font-size: 13px;
  letter-spacing: .5px;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  font-family: inherit;
  text-transform: lowercase;
}

.policy-back:hover { color: var(--fg-strong); }

/* ---------- PÁGINA DE PRODUTO DEDICADA ---------- */

.produto-layout {
  display: grid;
  grid-template-columns: 1fr 440px;
  gap: 80px;
}

.produto-gallery .main-image {
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.produto-gallery .main-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.produto-gallery .main-image.tight img { max-width: 72%; max-height: 72%; }

.icon-3d {
  position: absolute;
  bottom: -10px;
  right: -10px;
  width: 64px;
  height: 64px;
  opacity: .9;
  pointer-events: none;
}

.icon-3d > img { animation-duration: 6s; }

.thumb-row {
  display: flex;
  gap: 16px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.thumb-row button {
  width: 84px;
  height: 84px;
  padding: 6px;
  border: none;
  background: transparent;
  cursor: pointer;
  opacity: .5;
  transition: opacity .2s ease;
}

.thumb-row button.active,
.thumb-row button:hover { opacity: 1; }

.thumb-row img { width: 100%; height: 100%; object-fit: contain; }

.produto-info { padding-top: 4px; }

.produto-info h1 {
  font-weight: 600;
  font-size: 34px;
  line-height: 1.2;
  color: var(--fg-strong);
  margin: 0 0 4px;
}

.produto-info .subtitulo {
  font-weight: 400;
  font-size: 20px;
  color: var(--fg);
  margin: 0 0 24px;
}

.produto-info .preco {
  font-size: 21px;
  color: var(--fg);
  margin: 0 0 28px;
}

.label {
  font-size: 15px;
  color: var(--fg);
  margin-bottom: 12px;
  letter-spacing: .5px;
}

.tamanhos { display: flex; gap: 12px; margin-bottom: 26px; flex-wrap: wrap; }

.tamanhos button {
  min-width: 56px;
  height: 56px;
  padding: 0 12px;
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 15px;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}

.tamanhos button.selected {
  background: var(--fg-strong);
  color: var(--white);
  border-color: var(--fg-strong);
}

.tamanhos button:hover { border-color: var(--fg-strong); }

.add-to-cart {
  width: 100%;
  padding: 19px;
  background: var(--fg);
  color: var(--white);
  border: none;
  font-size: 16px;
  cursor: pointer;
  transition: background .2s ease;
  margin-bottom: 30px;
}

.add-to-cart:hover { background: var(--fg-strong); }
.add-to-cart:disabled { opacity: .5; cursor: not-allowed; }

.descricao p {
  font-size: 14px;
  line-height: 1.75;
  color: var(--fg);
  margin: 0 0 18px;
  position: relative;
  padding-left: 14px;
}

.descricao p::before { content: "-"; position: absolute; left: 0; }
.descricao p:last-child { margin-bottom: 0; }

.tabela-medidas {
  margin-top: 34px;
}

.tabela-medidas table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 4px;
}

.tabela-medidas th,
.tabela-medidas td {
  text-align: left;
  padding: 10px 12px 10px 0;
  font-size: 13px;
  color: var(--fg);
  border-bottom: 1px solid #e2e2e0;
  white-space: nowrap;
}

.tabela-medidas th {
  color: var(--fg-strong);
  font-weight: 500;
  letter-spacing: .3px;
}

/* ---------- CADASTRO ---------- */

.cadastro-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 90px;
  align-items: center;
  max-width: 900px;
}

.cadastro-visual {
  display: flex;
  align-items: center;
  justify-content: center;
}

.cadastro-visual .logo3d { max-width: 180px; }
.cadastro-visual .logo3d > img { animation-duration: 10s; }

.cadastro-box { max-width: 420px; }

.field { margin-bottom: 30px; }

.field label {
  display: block;
  font-size: 13px;
  letter-spacing: .4px;
  margin-bottom: 10px;
  color: var(--fg);
}

.field input {
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  padding: 10px 2px;
  font-size: 17px;
  color: var(--fg-strong);
  font-family: inherit;
}

.field input::placeholder { color: #c2c2c2; }
.field input:focus { outline: none; border-bottom-color: var(--fg-strong); }

.field-error { border-bottom-color: #b5605a !important; }

.cadastro-sucesso {
  font-size: 16px;
  line-height: 1.7;
  color: var(--fg-strong);
  padding: 18px 0 6px;
}

/* ---------- SOCIAIS FLUTUANTES (fixos, sempre visíveis) ---------- */

.social-float {
  position: fixed;
  bottom: 30px;
  left: 5%;
  z-index: 1000;
  display: flex;
  gap: 16px;
}

.social-float a {
  color: var(--fg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.social-float svg { width: 21px; height: 21px; stroke: var(--fg); fill: none; }
.social-float a:hover svg { stroke: var(--fg-strong); }

/* ---------- FOOTER ---------- */

.site-footer {
  padding: 36px 0 34px;
  border-top: 1px solid #e2e2e0;
}

.footer-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  font-size: 13px;
  color: var(--fg);
}

.footer-links a {
  background: none;
  border: none;
  color: var(--fg);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
  text-transform: lowercase;
}

.footer-links a:hover { color: var(--fg-strong); }

/* ---------- TOAST ---------- */

.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--fg-strong);
  color: #fff;
  padding: 14px 26px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
  z-index: 2100;
}

.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@keyframes spin3D {
  0%   { transform: rotateY(0deg); }
  100% { transform: rotateY(360deg); }
}

/* ---------- RESPONSIVE ---------- */

@media (max-width: 1100px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .arquivo-grid { grid-template-columns: repeat(3, 1fr); }
  .produto-layout { grid-template-columns: 1fr; gap: 40px; }
  .sobre-layout { grid-template-columns: 1fr; text-align: center; gap: 40px; }
  .sobre-visual .logo3d { max-width: 220px; }
  .carrinho-layout { grid-template-columns: 1fr; gap: 40px; }
  .cadastro-layout { grid-template-columns: 1fr; text-align: center; gap: 30px; }
  .cadastro-box { margin: 0 auto; }
}

@media (max-width: 640px) {
  .wrap { padding: 0 22px; }
  .logo-mark { max-width: 210px; }
  .main-nav { gap: 26px; font-size: 14px; }
  .header-icons { right: 22px; top: 26px; }
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 36px 18px; }
  .arquivo-grid { grid-template-columns: repeat(2, 1fr); }
  .arquivo-card .arquivo-label { flex-direction: column; gap: 4px; }
  .footer-row { flex-direction: column; text-align: center; }
  .footer-links { justify-content: center; gap: 14px 20px; }
  .produto-info h1 { font-size: 26px; }
  .thumb-row { gap: 10px; }
  .thumb-row button { width: 72px; height: 72px; }
  .carrinho-item { grid-template-columns: 80px 1fr; }
  .carrinho-item .item-img { width: 80px; height: 80px; }
  .carrinho-item .item-side { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; margin-top: 10px; }
}
