/**
 * Fortena - Linhas de Produtos (Product Lines Swiper Widget)
 */

.fortena-products-slider {
  --fortena-slider-gap: 24px;
  --fortena-slides-per-view: var(--fortena-slides-desktop, 4);
  position: relative;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

@media (max-width: 1024px) {
  .fortena-products-slider {
    --fortena-slides-per-view: var(--fortena-slides-tablet, 2.2);
    --fortena-slider-gap: 20px;
  }
}

@media (max-width: 640px) {
  .fortena-products-slider {
    --fortena-slides-per-view: var(--fortena-slides-mobile, 1.2);
    --fortena-slider-gap: 16px;
  }
}

.fortena-products-swiper {
  width: 100%;
  overflow: hidden;
  position: relative;
  touch-action: pan-y;
}

.fortena-products-swiper .swiper-wrapper {
  display: flex;
  align-items: stretch;
  flex-wrap: nowrap;
  box-sizing: content-box;
  width: 100%;
}

.fortena-product-slide {
  height: auto;
  box-sizing: border-box;
  display: flex;
  flex-shrink: 0;
  width: calc((100% - ((var(--fortena-slides-per-view) - 1) * var(--fortena-slider-gap, 24px))) / var(--fortena-slides-per-view));
  max-width: calc((100% - ((var(--fortena-slides-per-view) - 1) * var(--fortena-slider-gap, 24px))) / var(--fortena-slides-per-view));
}

/* Quando o Swiper inicializa com sucesso, os estilos inline calculados pelo Swiper assumem */
.fortena-products-swiper.swiper-initialized .swiper-wrapper {
  gap: 0 !important;
}

.fortena-products-swiper.swiper-initialized .fortena-product-slide {
  width: auto;
  max-width: none;
}

/* Fallback com rolagem horizontal limpa quando o Swiper ainda não inicializou */
.fortena-products-swiper:not(.swiper-initialized) .swiper-wrapper {
  gap: var(--fortena-slider-gap, 24px);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.fortena-products-swiper:not(.swiper-initialized) .swiper-wrapper::-webkit-scrollbar {
  display: none;
}

.fortena-product-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

.fortena-product-img {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: var(--radius, 4px);
  background: var(--paper, #F3F1EF);
}

.fortena-product-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
  transition: transform 1.1s var(--ease, cubic-bezier(.16, 1, .3, 1));
  display: block;
}

.fortena-product-card:hover .fortena-product-img img {
  transform: scale(1.07);
}

.fortena-product-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 14px 0 4px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-soft, #7A535F);
}

.fortena-product-num {
  color: var(--red, #DA291C);
  font-family: var(--f-display, "Barlow Condensed", sans-serif);
  font-size: 0.875rem;
}

.fortena-product-count {
  font-size: 0.75rem;
  color: var(--ink-soft, #7A535F);
}

.fortena-product-title {
  font-family: var(--f-display, "Barlow Condensed", sans-serif);
  font-weight: 700;
  font-size: clamp(1.7rem, 2.3vw, 2.3rem);
  line-height: 0.95;
  text-transform: uppercase;
  margin: 0 0 6px;
  color: var(--wine-deep, #471423);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.fortena-product-title::after {
  content: "↗";
  font-family: var(--f-text, "Work Sans", sans-serif);
  font-size: 0.55em;
  color: var(--red, #DA291C);
  opacity: 0;
  transform: translate(-6px, 4px);
  transition: opacity 0.4s, transform 0.5s var(--ease, cubic-bezier(.16, 1, .3, 1));
}

.fortena-product-card:hover .fortena-product-title::after {
  opacity: 1;
  transform: none;
}

.fortena-product-desc {
  margin: 0;
  font-size: 0.875rem;
  color: var(--ink-soft, #7A535F);
  line-height: 1.45;
  max-width: 34ch;
}

/* Paginação Swiper */
.fortena-products-pagination {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
}

.fortena-products-pagination .swiper-pagination-bullet {
  width: 8px;
  height: 8px;
  background: var(--line, rgba(71, 20, 35, 0.2));
  opacity: 1;
  border-radius: 50%;
  margin: 0 !important;
  transition: width 0.3s, background-color 0.3s;
}

.fortena-products-pagination .swiper-pagination-bullet-active {
  background: var(--red, #DA291C);
  width: 24px;
  border-radius: 4px;
}

/* Mobile Ajustes */
@media (max-width: 767px) {
  .fortena-product-title {
    font-size: 1.5rem;
  }
  .fortena-product-desc {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}
