/* =========================================================
   LojaTodoDia3D — páginas de categoria (listagem de produtos)
   Faixa de título, ordenação, atalhos de linha, grade de
   produtos e descrição da categoria.
   ========================================================= */

/* ---------- Faixa de título ---------- */

.shop-page-title {
  position: relative;
  background-color: var(--cor-faixa);
  color: var(--cor-texto-faixa);
  text-shadow: 1px 1px 1px rgb(var(--rgb-sombra) / 0.2);
}

.shop-page-title .title-overlay {
  position: absolute;
  inset: 0;
  background-color: rgb(var(--rgb-primaria) / 0.3);
}

.page-title-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 15px;
  min-height: 60px;
  padding-top: 20px;
  padding-bottom: 20px;
}

.page-title-main {
  flex: 1;
  min-width: 0;
}

@media (min-width: 850px) {
  .page-title-tools:empty {
    display: none;
  }
}

.shop-page-title h1 {
  margin: 0 0 0.5em;
  color: var(--cor-texto-faixa);
  font-size: 1.5em;
}

.breadcrumbs {
  color: var(--cor-texto-faixa);
  font-size: 0.8em;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.2;
  text-transform: uppercase;
}

.breadcrumbs a {
  color: var(--cor-texto-faixa);
  font-weight: 400;
}

.breadcrumbs a:hover {
  opacity: 0.8;
}

.breadcrumbs .divider {
  margin: 0 0.3em;
  font-weight: 300;
  opacity: 0.7;  /* legível sobre a faixa azul (contraste 4.7:1) */
}

.woocommerce-ordering {
  margin: 5px 0;
}

.woocommerce-ordering select {
  width: 293px;
  max-width: 100%;
  height: 39px;
  padding: 0 2.2em 0 0.75em;
  border: 1px solid rgb(var(--rgb-branco) / 0.09);
  border-radius: 99px;
  background-color: rgb(var(--rgb-branco) / 0.2);
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-position: right 0.6em center;
  background-repeat: no-repeat;
  background-size: 15px 15px;
  color: var(--cor-texto-faixa);
  font-size: 0.97em;
  text-shadow: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.woocommerce-ordering select:focus {
  outline: none;
  border-color: var(--cor-texto-faixa);
}

.woocommerce-ordering option {
  color: var(--cor-texto);
  background-color: var(--cor-fundo);
}

@media (max-width: 849px) {
  .page-title-inner {
    flex-direction: column;
    gap: 0;
    text-align: center;
  }

  /* As duas colunas (título e ordenação) têm 5px em cima e embaixo, mesmo vazias */
  .page-title-main,
  .page-title-tools {
    padding: 5px 0;
  }

  .page-title-main {
    width: 100%;
  }

  .woocommerce-ordering select {
    width: 302px;
    height: 40px;
    font-size: 1em;
  }
}

@media (max-width: 549px) {
  .shop-page-title h1 {
    margin-bottom: 0.5em;
    font-size: 1.8em;
  }
}

/* ---------- Conteúdo ---------- */

.category-page-row {
  padding-top: 30px;
}

.shop-container {
  min-width: 0;
}

/* Atalhos de linha (só no celular/tablet; no desktop o menu já lista as linhas) */
.tdfa-lines {
  margin: 0 0 10px;
}

.tdfa-lines__track {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tdfa-chip {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--cor-borda-forte);
  border-radius: 999px;
  background-color: var(--cor-fundo);
  color: var(--cor-texto);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.tdfa-chip:hover {
  border-color: var(--cor-link);
  color: var(--cor-link);
}

.tdfa-chip.is-current {
  border-color: var(--cor-botao);
  background-color: var(--cor-botao);
  color: var(--cor-texto-botao);
}

@media (min-width: 850px) {
  .tdfa-lines--mobile {
    display: none;
  }
}

@media (max-width: 849px) {
  .tdfa-lines__track {
    flex-wrap: nowrap;
    margin-inline: -15px;
    padding: 2px 15px 6px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .tdfa-lines__track::-webkit-scrollbar {
    display: none;
  }

  .tdfa-chip {
    scroll-snap-align: start;
  }
}

/* Filtro de cor */
.tdfa-colors {
  margin: 0 0 16px;
}

.tdfa-colors__head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 28px;
  margin-bottom: 6px;
}

.tdfa-colors__title {
  color: var(--cor-texto-suave);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tdfa-colors__status {
  color: var(--cor-texto);
  font-size: 13px;
}

.tdfa-colors__clear {
  margin: 0 0 0 auto;
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--cor-link);
  font-size: 13px;
  font-weight: 600;
  text-decoration: underline;
}

.tdfa-colors__track {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tdfa-chip--color {
  gap: 6px;
  cursor: pointer;
}

.tdfa-chip--color[aria-pressed="true"] {
  border-color: var(--cor-botao);
  background-color: var(--cor-botao);
  color: var(--cor-texto-botao);
}

.tdfa-chip__swatch {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgb(var(--rgb-tinta) / 0.18);
}

.tdfa-chip[aria-pressed="true"] .tdfa-chip__swatch {
  box-shadow: inset 0 0 0 1px rgb(var(--rgb-tinta) / 0.18), 0 0 0 2px var(--cor-fundo);
}

.tdfa-chip__n {
  font-weight: 400;
  opacity: 0.7;
}

@media (max-width: 849px) {
  .tdfa-colors__track {
    flex-wrap: nowrap;
    margin-inline: -15px;
    padding: 2px 15px 6px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .tdfa-colors__track::-webkit-scrollbar {
    display: none;
  }
}

/* ---------- Grade de produtos ---------- */

.products {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -10px;
}

.product-small.col {
  display: flex;
  flex: 0 0 50%;
  max-width: 50%;
  padding: 0 9.8px 19.6px;
}

@media (min-width: 550px) {
  .product-small.col { flex-basis: 33.3333%; max-width: 33.3333%; }
}

@media (min-width: 850px) {
  .product-small.col { flex-basis: 25%; max-width: 25%; }
}

.product-small .col-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.products-empty {
  padding: 30px 0;
  text-align: center;
  color: var(--cor-texto-suave);
}

/* ---------- Cartões de subcategoria ---------- */

.product-category.col {
  display: flex;
  flex: 0 0 50%;
  max-width: 50%;
  padding: 0 9.8px 19.6px;
}

@media (min-width: 550px) {
  .product-category.col { flex-basis: 33.3333%; max-width: 33.3333%; }
}

@media (min-width: 850px) {
  .product-category.col { flex-basis: 25%; max-width: 25%; }
}

/* Os cartões de uma linha ficam com a mesma altura (como o "equalize-box" do tema) */
.product-category .col-inner,
.product-category .col-inner > a,
.product-category .box {
  display: flex;
  flex: 1;
  flex-direction: column;
  width: 100%;
}

.box-bounce .box-image,
.box-bounce .box-text {
  transition: opacity 0.3s, transform 0.3s, background-color 0.3s;
}

.box-bounce .box-text {
  position: relative;
  z-index: 1;
  flex: 1;
  padding: 15px 15px 20px;
  font-size: 0.9em;
  text-align: center;
}

.box-bounce:hover .box-image,
a:focus-visible .box-bounce .box-image {
  transform: translateY(-5px);
}

.box-bounce:hover .box-text,
a:focus-visible .box-bounce .box-text {
  background-color: var(--cor-fundo);
  transform: translateY(-15px);
}

.header-title {
  margin: 0.1em 0;
  font-size: 1em;
  line-height: 1.3;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

@media (max-width: 549px) {
  .box-bounce .box-text {
    font-size: 85%;
  }
}

/* Selo "Novo" */
.badge-container {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  margin: 30px 0 0;
  pointer-events: none;
}

.badge {
  display: table;
  width: 5.8em;
  height: 2.8em;
  margin-left: -0.4em;
}

.badge-inner {
  display: table-cell;
  padding: 2px;
  border-radius: 999px;
  background-color: var(--cor-secundaria);
  color: var(--cor-branco);
  font-size: 0.8em;
  font-weight: bolder;
  line-height: 0.85;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}

/* Caixa do produto: 70% da coluna, centralizada (como no tema original) */
.product-small.box {
  display: flex;
  flex: 1;
  flex-direction: column;
  width: 70%;
  margin: 0 auto;
}

.box-image {
  position: relative;
  overflow: hidden;
}

.box-image > a {
  display: block;
}

.box-image img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
}

.box-image .back-image {
  position: absolute;
  inset: 0;
  height: 100%;
  opacity: 0;
  transition: opacity 0.5s;
}

.product-small.col:hover .box-image .back-image {
  opacity: 1;
}

@media (max-width: 549px) {
  .box-image .back-image {
    display: none;
  }
}

.out-of-stock-label {
  position: absolute;
  top: 40%;
  right: 0;
  left: 0;
  padding: 20px 0;
  background-color: rgb(var(--rgb-fundo) / 0.9);
  color: var(--cor-texto-forte);
  font-weight: 700;
  line-height: 1.6;
  text-align: center;
  text-transform: uppercase;
  opacity: 0.9;
}

.box-text-products {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 0.7em 10px 1.4em;
  font-size: 0.9em;
  text-align: center;
}

@media (max-width: 549px) {
  .box-text-products {
    font-size: 85%;
  }
}

.title-wrapper {
  height: 66px;
  margin-top: 0.1em; /* no original é a margem do título, que "vaza" para fora do bloco */
}

.product-title {
  margin: 0 0 0.1em;
  line-height: 1.3;
}

.product-title a {
  display: inline-block;
  width: 125px;
  max-width: none;
  color: var(--cor-link);
}

.product-title a:hover {
  color: var(--cor-link-hover);
}

/* Preços Pix e cartão (o alinhamento por linha fica em js/category.js) */

.wcsp-container {
  display: block;
  line-height: 1;
}

.wcsp-container .payment {
  display: block;
  margin-bottom: 10px;
}

.wcsp-container .payment:last-child {
  margin-bottom: 0;
}

.payment-price {
  display: block;
  font-weight: 700;
  line-height: 1;
}

.payment-pix .payment-price {
  color: var(--cor-preco);
  font-size: 17px; /* --wcsp-loop-pix-price-font-size do plugin original */
}

.payment-pix .payment-name {
  display: block;
  margin-top: 2px;
  color: var(--cor-texto-forte);
  font-size: 0.8em;
  text-transform: uppercase;
}

.payment-card .payment-price {
  color: var(--cor-texto-forte);
  font-size: 17px;
}

.payment-card .payment-name {
  display: block;
  margin-top: 5px;
  color: var(--cor-texto-forte);
  font-size: 14px;
  line-height: 1;
}

.payment-card .payment-name strong {
  white-space: nowrap;
}

/* Avaliação na grade (estrelas na cor secundária do tema) */
/* Estrelas em linha com a contagem: em cartões estreitos a contagem desce
   para a linha de baixo, como no original */
.loop-rating .star-rating {
  height: 19px;
  margin: 8px 0;
}

.loop-rating .rating-count {
  margin-left: 4px;
  color: inherit;
  font-size: 0.8em;
  opacity: 0.8;
}

/* Espaço do tamanho das estrelas para produtos sem avaliação (js/category.js) */
.rating-spacer {
  visibility: hidden;
}

/* Botão comprar */
.add-to-cart-button .button {
  margin-top: 1em;
  padding: 0 1.2em;
  font-size: 0.8em;
  line-height: 2.4em;
}

/* ---------- Descrição da categoria ---------- */
/* Listas e imagens seguem as regras de conteúdo do tema original:
   marcadores fora do texto, listas aninhadas recuadas e imagens em linha. */

.term-description ul {
  margin: 0 0 1.3em;
  padding: 0;
  list-style: disc;
}

.term-description ul ul {
  margin: 1.5em 0 1.5em 3em;
}

.term-description li {
  margin-bottom: 0.6em;
}

.term-description img {
  display: inline-block;
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

.term-description img.aligncenter {
  display: block;
  margin: 0 auto;
}

.term-description img.size-full.alignnone {
  margin-bottom: 2em;
}

/* Vídeo do YouTube carregado só no clique */
.lazy-video {
  position: relative;
  display: block;
  width: 100%;
  height: 0;
  margin: 0;
  padding: 0 0 56.23%;
  overflow: hidden;
  border: 0;
  background-color: var(--cor-video);
  cursor: pointer;
}

.lazy-video img,
.lazy-video iframe {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: cover;
}

.lazy-video img {
  transition: filter 0.5s;
}

.lazy-video:hover img,
.lazy-video:focus-visible img {
  filter: brightness(75%);
}

.lazy-video .play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 68px;
  height: 48px;
  margin: -24px 0 0 -34px;
  filter: grayscale(1);
  pointer-events: none;
  transition: filter 0.3s;
}

.lazy-video .play-fundo {
  fill: var(--cor-youtube-play);
}

.lazy-video .play-seta {
  fill: var(--cor-branco);
}

.lazy-video:hover .play,
.lazy-video:focus-visible .play {
  filter: none;
}
