/* Catálogo em fichas por categoria */
.cat-page {
  min-height: 70vh;
  background: var(--cream);
}

.cat-hero {
  background: var(--black);
  color: #f5f5f5;
  padding: 1.5rem 0 0;
  border-bottom: 4px solid var(--orange);
}

.cat-hero h1 {
  font-family: var(--display);
  text-transform: uppercase;
  font-size: clamp(1.75rem, 3.2vw, 2.4rem);
  margin: 0 0 0.4rem;
  letter-spacing: 0.02em;
  line-height: 1.05;
}

.cat-hero .lede {
  margin: 0 0 1rem;
  color: rgba(245, 245, 245, 0.78);
  max-width: 40rem;
  font-size: 0.95rem;
}

/* Tabs */
.cat-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding-bottom: 0;
}

.cat-tab {
  appearance: none;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 245, 245, 0.7);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.75rem 1rem;
  border-radius: 10px 10px 0 0;
  cursor: pointer;
  border: 1px solid transparent;
  border-bottom: none;
  transition: background 0.15s, color 0.15s;
}

.cat-tab:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.cat-tab.active {
  background: var(--cream);
  color: var(--black);
  border-color: rgba(255, 255, 255, 0.1);
}

.cat-tab .badge-count {
  display: inline-block;
  margin-left: 0.35rem;
  min-width: 1.25rem;
  padding: 0.1rem 0.35rem;
  border-radius: 999px;
  background: var(--orange);
  color: #111;
  font-size: 0.68rem;
}

.cat-tab.active .badge-count {
  background: var(--red);
  color: #fff;
}

/* Body layout: content + order */
.cat-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.25rem;
  padding: 1.5rem 0 3rem;
  align-items: start;
}

.cat-main {
  min-width: 0;
}

.cat-intro {
  margin-bottom: 1.25rem;
}

.cat-intro h2 {
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 1.75rem;
  margin: 0 0 0.4rem;
}

.cat-intro p {
  margin: 0;
  color: var(--muted);
  max-width: 46rem;
}

.cat-tip {
  margin-top: 0.75rem;
  padding: 0.65rem 0.85rem;
  background: rgba(255, 106, 0, 0.1);
  border-left: 3px solid var(--orange);
  border-radius: 0 8px 8px 0;
  font-size: 0.88rem;
}

/* Sheet grid (category landing) */
.sheet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.sheet-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  text-align: left;
  padding: 0;
  font: inherit;
  color: inherit;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.sheet-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.sheet-card .thumb {
  aspect-ratio: 4/3;
  background: #e8e4dc;
  position: relative;
  overflow: hidden;
}

.sheet-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sheet-card .badge {
  position: absolute;
  top: 0.65rem;
  left: 0.65rem;
  background: var(--red);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.3rem 0.5rem;
  border-radius: 3px;
}

.sheet-card .body {
  padding: 0.9rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.sheet-card h3 {
  margin: 0;
  font-family: var(--display);
  text-transform: uppercase;
  font-size: 1.2rem;
  letter-spacing: 0.02em;
  line-height: 1.1;
}

.sheet-card .sum {
  margin: 0;
  font-size: 0.86rem;
  color: var(--muted);
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sheet-card .meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.sheet-card .price {
  font-weight: 800;
  font-size: 1.05rem;
}

.sheet-card .open {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--red);
}

.sheet-card .colors {
  display: flex;
  gap: 0.25rem;
  margin-top: 0.25rem;
}

.sheet-card .colors i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.15);
}

/* Product sheet (full detail) */
.sheet-detail {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}

.sheet-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  background: var(--sand);
  border-bottom: 1px solid var(--line);
  align-items: center;
}

.sheet-toolbar .crumb {
  flex: 1;
  font-size: 0.85rem;
  color: var(--muted);
  min-width: 160px;
}

.sheet-toolbar .crumb strong {
  color: var(--ink);
}

.sheet-detail-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 1.5rem;
  padding: 1.25rem;
}

.sheet-gallery .main {
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  background: #e8e4dc;
  border: 1px solid var(--line);
  min-height: 240px;
}

.sheet-gallery .main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sheet-gallery .thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.65rem;
}

.sheet-gallery .thumbs button {
  width: 64px;
  height: 64px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background: #eee;
}

.sheet-gallery .thumbs button.active {
  border-color: var(--orange);
}

.sheet-gallery .thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sheet-info h2 {
  font-family: var(--display);
  text-transform: uppercase;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  margin: 0 0 0.5rem;
  letter-spacing: 0.02em;
  line-height: 1.05;
}

.sheet-info .badge {
  display: inline-block;
  background: rgba(227, 6, 19, 0.1);
  color: var(--red);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.3rem 0.55rem;
  border-radius: 3px;
  margin-bottom: 0.5rem;
}

.sheet-info .summary {
  color: var(--muted);
  margin: 0 0 0.85rem;
}

.sheet-info .price-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 0.75rem;
  margin-bottom: 1rem;
}

.sheet-info .price-row .price {
  font-size: 1.75rem;
  font-weight: 800;
}

.sheet-info .price-row .pix {
  color: var(--pix);
  font-weight: 700;
  font-size: 0.9rem;
}

.sheet-section {
  margin-top: 1.15rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.sheet-section h3 {
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 1.05rem;
  margin: 0 0 0.45rem;
}

.sheet-section p,
.sheet-section li {
  font-size: 0.92rem;
  color: var(--muted);
  margin: 0;
}

.sheet-section ul {
  margin: 0;
  padding-left: 1.1rem;
}

.sheet-section li {
  margin-bottom: 0.35rem;
  color: var(--ink);
}

.sheet-section li strong {
  color: var(--black);
}

.sheet-video {
  margin-top: 0.65rem;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 16/9;
  background: #000;
  border: 1px solid #222;
}

.sheet-video iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.sheet-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.sheet-actions .btn {
  flex: 1;
  min-width: 140px;
}

/* Variants */
.variant-block {
  margin: 0.85rem 0;
}

.variant-block .vlabel {
  display: block;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.45rem;
}

.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.swatch {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.6rem 0.35rem 0.35rem;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  background: #fff;
}

.swatch i {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.15);
}

.swatch.selected {
  border-color: var(--red);
  box-shadow: 0 0 0 1px var(--red);
}

.swatch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* Order rail */
.order-rail {
  position: sticky;
  top: calc(var(--header-h) + 0.75rem);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.order-rail .oh {
  background: var(--black);
  color: #fff;
  padding: 0.9rem 1rem;
  border-bottom: 3px solid var(--orange);
}

.order-rail .oh h2 {
  margin: 0;
  font-family: var(--display);
  text-transform: uppercase;
  font-size: 1.15rem;
  color: #fff;
  letter-spacing: 0.04em;
}

.order-rail .oh p {
  margin: 0.25rem 0 0;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
}

.order-rail .ob {
  padding: 0.9rem 1rem 1rem;
}

.order-lines {
  max-height: 220px;
  overflow: auto;
  margin-bottom: 0.65rem;
}

.order-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.15rem 0.5rem;
  font-size: 0.84rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--line);
}

.order-line .on {
  font-weight: 700;
}

.order-line .ov {
  grid-column: 1;
  font-size: 0.74rem;
  color: var(--muted);
}

.order-line .op {
  font-weight: 800;
  grid-row: 1 / span 2;
  align-self: center;
}

.order-line .rm {
  grid-column: 1 / -1;
  justify-self: start;
  border: none;
  background: none;
  color: var(--red);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.order-empty {
  font-size: 0.88rem;
  color: var(--muted);
  padding: 0.35rem 0 0.75rem;
}

.totals .tr {
  display: flex;
  justify-content: space-between;
  font-size: 0.86rem;
  margin-bottom: 0.28rem;
}

.totals .tr.big {
  font-weight: 800;
  font-size: 1.05rem;
  margin-top: 0.35rem;
}

.totals .tr.pix {
  color: var(--pix);
  font-weight: 700;
}

.totals .tr.btc {
  color: #b8860b;
  font-weight: 700;
}

.ship-note {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0.4rem 0 0.7rem;
}

.ship-note.ok {
  color: var(--pix);
  font-weight: 700;
}

.pay-row {
  display: grid;
  gap: 0.3rem;
  margin-bottom: 0.7rem;
}

.pay-row label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.pay-row label.active {
  border-color: var(--orange);
  background: rgba(255, 106, 0, 0.08);
}

.order-rail .btn {
  width: 100%;
  margin-bottom: 0.4rem;
}

.order-hint {
  font-size: 0.74rem;
  color: var(--muted);
  margin: 0.35rem 0 0;
  line-height: 1.4;
}

/* Order tab full view */
.pedido-list {
  display: grid;
  gap: 0.85rem;
}

.pedido-card {
  display: grid;
  grid-template-columns: 88px 1fr auto;
  gap: 0.85rem;
  align-items: center;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem;
}

.pedido-card img {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: 8px;
  background: #eee;
}

.pedido-card h3 {
  margin: 0 0 0.25rem;
  font-family: var(--display);
  text-transform: uppercase;
  font-size: 1.1rem;
}

.pedido-card p {
  margin: 0;
  font-size: 0.84rem;
  color: var(--muted);
}

@media (max-width: 960px) {
  .cat-layout {
    display: flex;
    flex-direction: column;
    grid-template-columns: 1fr;
    /* espaço só para a barra CTA fina no rodapé, não para um painel travado */
    padding-bottom: 1.25rem;
  }

  /* Catálogo primeiro; pedido no fim, SEM sticky (não cobre a tela) */
  .cat-main {
    order: 1;
  }
  .order-rail {
    order: 2;
    position: static;
    max-height: none;
    z-index: auto;
    margin-top: 0.5rem;
  }
  .order-rail .ob {
    overflow: visible;
    max-height: none;
  }
  .order-rail .btn {
    min-height: 46px;
  }

  .sheet-detail-grid {
    grid-template-columns: 1fr;
  }

  .cat-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 0.25rem;
    scrollbar-width: thin;
  }
  .cat-tab {
    flex: 0 0 auto;
    white-space: nowrap;
  }
}

@media (max-width: 560px) {
  .cat-tab {
    font-size: 0.7rem;
    padding: 0.65rem 0.7rem;
  }
  .pedido-card {
    grid-template-columns: 64px 1fr;
  }
  .pedido-card .actions {
    grid-column: 1 / -1;
  }
  .pedido-card .actions .btn {
    width: 100%;
    min-height: 44px;
  }
  #btn-wa-pedido,
  #btn-ggrupos-pedido,
  #btn-wa-rail,
  #btn-ggrupos {
    min-height: 48px;
  }
}
