/* ==========================================================================
   BEST SELLERS (#FFFFFF) & COMFORT REVOLUTION (#141414)
   Signature 4-Direction Product Image Rotation + Vertical Title Hover Effect
   ========================================================================== */

.products-section {
  padding-block: var(--section-py);
  background-color: var(--color-white);
  border-top: 1px solid var(--border-light);
}

.products-header-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.5rem 2.5rem;
}

.collection-tabs {
  display: inline-flex;
  align-items: center;
  gap: 1.5rem;
}

.collection-tab {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-muted);
  padding-bottom: 0.35rem;
  border-bottom: 1.5px solid transparent;
  transition: color var(--dur-micro) ease, border-color var(--dur-micro) ease;
}

.collection-tab:hover,
.collection-tab[aria-selected='true'] {
  color: var(--color-ink);
}

.collection-tab[aria-selected='true'] {
  border-bottom-color: var(--color-ink);
}

/* Product Grid — Generous 4-column Desktop, 3-col Tablet, 2-col Mobile */
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(2rem, 3vw, 3rem) clamp(1.1rem, 1.8vw, 1.75rem);
}

/* Product Card — Sharp, Clean, Image-First, Zero Badges, Zero Horizontal Overflow */
.product-card {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  position: relative;
  min-width: 0;
  max-width: 100%;
}

.product-card__media {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background-color: var(--color-stone);
  isolation: isolate;
}

.product-card__link-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.product-card__stage {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.product-card__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  will-change: transform;
  transform: translate3d(0, 0, 0);
}

.product-card__img--incoming {
  z-index: 2;
}

.product-card__img--outgoing {
  z-index: 1;
}

/* 4-Direction Transform Sequence: Up -> Left -> Right -> Down */
@keyframes manto-exit-up {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(0, -100%, 0); }
}
@keyframes manto-enter-from-bottom {
  from { transform: translate3d(0, 100%, 0); }
  to { transform: translate3d(0, 0, 0); }
}

@keyframes manto-exit-left {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-100%, 0, 0); }
}
@keyframes manto-enter-from-right {
  from { transform: translate3d(100%, 0, 0); }
  to { transform: translate3d(0, 0, 0); }
}

@keyframes manto-exit-right {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(100%, 0, 0); }
}
@keyframes manto-enter-from-left {
  from { transform: translate3d(-100%, 0, 0); }
  to { transform: translate3d(0, 0, 0); }
}

@keyframes manto-exit-down {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(0, 100%, 0); }
}
@keyframes manto-enter-from-top {
  from { transform: translate3d(0, -100%, 0); }
  to { transform: translate3d(0, 0, 0); }
}

.dir-up-out { animation: manto-exit-up 520ms var(--ease-wipe) forwards; }
.dir-up-in { animation: manto-enter-from-bottom 520ms var(--ease-wipe) forwards; }

.dir-left-out { animation: manto-exit-left 520ms var(--ease-wipe) forwards; }
.dir-left-in { animation: manto-enter-from-right 520ms var(--ease-wipe) forwards; }

.dir-right-out { animation: manto-exit-right 520ms var(--ease-wipe) forwards; }
.dir-right-in { animation: manto-enter-from-left 520ms var(--ease-wipe) forwards; }

.dir-down-out { animation: manto-exit-down 520ms var(--ease-wipe) forwards; }
.dir-down-in { animation: manto-enter-from-top 520ms var(--ease-wipe) forwards; }

/* Subtle bottom vignette for dot legibility */
.product-card__media::after {
  content: '';
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 46px;
  background: linear-gradient(to top, rgba(20, 20, 20, 0.28), transparent);
  pointer-events: none;
  z-index: 3;
}

/* Minimal Discreet Pagination Dots */
.product-card__dots {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
}

.product-card__dot {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background-color: rgba(255, 255, 255, 0.52);
  transition: width 320ms var(--ease-out), background-color 320ms var(--ease-out);
  padding: 0;
}

.product-card__dot:hover {
  background-color: rgba(255, 255, 255, 0.9);
}

.product-card__dot.is-active {
  width: 16px;
  background-color: var(--color-white);
}

/* Product Info — Readable 15px Title & Price, Subtle Context Category */
.product-card__info {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  min-width: 0;
  max-width: 100%;
}

.product-card__meta-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  min-width: 0;
  max-width: 100%;
}

/* Vertical Hover Title Reveal (No Continuous Marquee, Strictly Clipped Inside Card Width) */
.product-card__title-link {
  display: block;
  overflow: hidden;
  position: relative;
  height: 1.45em;
  line-height: 1.45;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-ink);
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
}

.product-card__title-track {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  transition: transform 380ms var(--ease-out);
}

.product-card__title-primary,
.product-card__title-hover {
  display: block;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  height: 1.45em;
}

.product-card__title-hover {
  color: var(--color-burgundy);
}

.product-card:hover .product-card__title-track,
.product-card:focus-within .product-card__title-track {
  transform: translateY(-50%);
}

.product-card__price {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-ink);
  white-space: nowrap;
  flex-shrink: 0;
}

.product-card__category {
  font-size: 0.8125rem;
  color: var(--color-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   COMFORT REVOLUTION — THE ONLY DARK PRODUCT SECTION (#141414)
   ========================================================================== */

.comfort-section {
  padding-block: var(--section-py);
  background-color: var(--color-dark);
  color: var(--color-dark-text);
}

.comfort-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem 3rem;
  margin-bottom: clamp(1.75rem, 3.5vw, 3rem);
  padding-bottom: clamp(1.35rem, 2.5vw, 2rem);
  border-bottom: 1px solid var(--border-dark);
}

.comfort-header__title {
  font-family: var(--font-sans);
  font-size: var(--text-section);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.03em;
  color: var(--color-dark-text);
  max-width: 15ch;
}

.comfort-header__aside {
  flex: 1 1 320px;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.15rem;
}

.comfort-header__desc {
  font-size: 0.96rem;
  line-height: 1.6;
  color: rgba(244, 241, 236, 0.76);
  max-width: 48ch;
}

.comfort-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(1.25rem, 2vw, 1.85rem);
}

.comfort-section .product-card__media {
  background-color: #202020;
}

.comfort-section .product-card__title-link,
.comfort-section .product-card__price {
  color: var(--color-dark-text);
}

.comfort-section .product-card__title-hover {
  color: #ffffff;
}

.comfort-section .product-card__category {
  color: rgba(244, 241, 236, 0.56);
}

/* Responsive Product Grids */
@media (max-width: 1120px) {
  .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .comfort-header {
    grid-template-columns: 1fr;
  }

  .comfort-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .product-grid,
  .comfort-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.35rem 0.75rem;
  }

  .product-card__meta-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    width: 100%;
  }

  .product-card__title-link {
    width: 100%;
    flex: none;
    font-size: 0.84rem;
  }

  .product-card__price {
    font-size: 0.84rem;
  }

  .product-card__category {
    font-size: 0.74rem;
    width: 100%;
  }
}
