/* ============================================
   CATEGORY PRODUCTS
   ============================================ */

/* ---------- Category First Card ---------- */
.category-first-card {
  aspect-ratio: 2/3;
  position: relative;
  display: flex;
  align-items: flex-end;
  background-color: #1a1a1a;
  background-size: cover;
  background-position: center;
  color: #fff;
  border-radius: var(--radius-lg, 8px);
  overflow: hidden;
  transition:
    transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.4s ease;
}

.responsive-product-grid .category-first-card {
  grid-column: span var(--cat-card-span, 2);
  aspect-ratio: auto;
}

@media (max-width: 768px) {
  .responsive-product-grid .category-first-card {
    grid-column: 1 / -1;
    aspect-ratio: 16/9;
  }
}

.category-first-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.category-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.5) 0%,
    rgba(0, 0, 0, 0.15) 50%,
    rgba(0, 0, 0, 0.02) 100%
  );
  z-index: 1;
  transition: background 0.4s ease;
}

.category-first-card:hover .category-card-overlay {
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.6) 0%,
    rgba(0, 0, 0, 0.2) 50%,
    rgba(0, 0, 0, 0.05) 100%
  );
}

.category-card-link {
  text-decoration: none;
  color: inherit;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  text-align: start;
  padding: 1.5rem;
  position: relative;
  z-index: 2;
  gap: 0.5rem;
}

/* Vertical position of the title/subtitle/button group */
.category-card-link.card-vpos-top {
  justify-content: flex-start;
}
.category-card-link.card-vpos-middle {
  justify-content: center;
}
.category-card-link.card-vpos-bottom {
  justify-content: flex-end;
}

/* Horizontal alignment of the group (logical, RTL-aware) */
.category-card-link.card-halign-start {
  align-items: flex-start;
  text-align: start;
}
.category-card-link.card-halign-center {
  align-items: center;
  text-align: center;
}
.category-card-link.card-halign-end {
  align-items: flex-end;
  text-align: end;
}

.category-card-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 32rem;
}

.category-card-eyebrow {
  font-size: var(--fs-xs, 0.8rem);
  font-weight: var(--fw-semibold, 600);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0;
  color: rgba(255, 255, 255, 0.75);
}

.category-card-title {
  font-size: clamp(1.5rem, 2.5vw, 2.25rem);
  font-weight: var(--fw-bold, 700);
  margin: 0;
  color: #fff;
  line-height: 1.2;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.category-card-subtitle {
  font-size: var(--fs-sm, 0.95rem);
  margin: 0;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.5;
}

.category-card-description {
  font-size: var(--fs-xs, 0.8rem);
  margin: 0;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Visual style comes from the theme .btn variant; this only handles
   the card layout marker and the animated chevron. */
.category-card-cta {
  margin-top: 0.5rem;
}

.category-card-cta svg {
  transition: transform 0.3s ease;
}

/* Flip the chevron to point toward the reading direction's end in RTL */
[dir="rtl"] .category-card-cta svg {
  transform: rotate(180deg);
}

.category-first-card:hover .category-card-cta svg {
  transform: translateX(3px);
}

[dir="rtl"] .category-first-card:hover .category-card-cta svg {
  transform: rotate(180deg) translateX(3px);
}

/* ---------- Responsive Grid ---------- */
.responsive-product-grid {
  display: grid;
  grid-template-columns: repeat(var(--grid-cols-desktop, 4), 1fr);
  gap: var(--spacing-md, 1rem);
  width: 100%;
}

@media (max-width: 1024px) {
  .responsive-product-grid {
    grid-template-columns: repeat(var(--grid-cols-tablet, 3), 1fr);
  }
}

@media (max-width: 768px) {
  .responsive-product-grid {
    grid-template-columns: repeat(var(--grid-cols-mobile, 2), 1fr);
  }
}

/* ---------- Slider: size cards to the column count per view ---------- */
.product-slider--cols .product-card {
  flex: 0 0 calc((100% - (var(--grid-cols-desktop, 4) - 1) * var(--spacing-lg)) / var(--grid-cols-desktop, 4));
}

@media (max-width: 1024px) {
  .product-slider--cols .product-card {
    flex-basis: calc((100% - (var(--grid-cols-tablet, 3) - 1) * var(--spacing-lg)) / var(--grid-cols-tablet, 3));
  }
}

@media (max-width: 768px) {
  .product-slider--cols .product-card {
    flex-basis: calc((100% - (var(--grid-cols-mobile, 2) - 1) * var(--spacing-lg)) / var(--grid-cols-mobile, 2));
  }
}

/* ---------- View All Button ---------- */

.view-all-wrapper {
  display: flex;
  justify-content: center;
  margin-top: var(--spacing-xl, 2rem);
  width: 100%;
}

.view-all-btn {
  cursor: pointer;
}

