/* 
 * Product Categories Grid Component Styles
 * Displays product categories in a responsive grid layout
 */
.product-categories {
  padding: 64px 0 120px;
  background: #fff;
}

.product-categories .container {
  padding: 0;
}

.product-categories .container {
  margin: 0 auto;
}

/* Section Title */
.product-categories .section-title {
  font-size: 54px;
  padding: 0 70px;
  font-weight: 550;
  margin: 0 0 32px 0;
  text-align: left;
  font-family: var(--font-family-title);
}

/* Categories Grid */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

/* Category Card */
.category-card {
  padding: 48px;
  border: var(--border-default-primary);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: block;
  text-decoration: none;
  color: inherit;
}

/* Remove top border from all except first row */
.category-card:nth-child(n+4) {
  border-top: none;
}

/* Remove left border from all except first column */
.category-card:not(:nth-child(3n+1)) {
  border-left: none;
}

/* Hover effect for linked cards */
a.category-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

/* Category Icon */
.category-icon {
  width: 300px;
  height: 300px;
  margin: 0 auto 48px auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.category-icon img {
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: auto;
  object-fit: contain;
}

/* Category Title */
.category-title {
  font-size: 26px;
  font-weight: 600;
  font-family: var(--font-family-title);
  margin: 0 0 12px 0;
  line-height: 36px;
}

/* Category Description */
.category-description {
  font-size: 16px;
  line-height: 24px;
  line-height: 24px;
  margin: 0;
}

@media (max-width: 1040px) {
  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .product-categories .section-title {
    padding: 0 40px;
    font-size: 34px;
    line-height: 40px;
  }

  .product-categories {
    padding: 48px 0 104px;
  }

  .category-icon {
    width: 100%;
    margin-bottom: 40px;
  }

  .category-card {
    padding: 40px;
  }

  /* Reset for 2-column layout */
  .category-card:nth-child(n+4) {
    border-top: var(--border-default-primary);
  }

  .category-card:not(:nth-child(3n+1)) {
    border-left: var(--border-default-primary);
  }

  /* Remove top border from all except first row (first 2 items) */
  .category-card:nth-child(n+3) {
    border-top: none;
  }

  /* Remove left border from all except first column (odd items) */
  .category-card:nth-child(even) {
    border-left: none;
  }

  .category-title {
    font-size: 22px;
    line-height: 32px;
    margin-bottom: 8px;
  }

  .category-description {
    font-size: 14px;
    line-height: 20px;
  }
}

@media (max-width: 640px) {
  .categories-grid {
    grid-template-columns: 1fr;
  }

  .category-card {
    padding: 36px 20px;
  }

  /* Reset for 1-column layout */
  .category-card:nth-child(n+3) {
    border-top: var(--border-default-primary);
  }

  .category-card:nth-child(even) {
    border-left: var(--border-default-primary);
  }

  /* Remove top border from all except first item */
  .category-card:nth-child(n+2) {
    border-top: none;
  }

  /* Keep left border on all items */
  .category-card {
    border-left: var(--border-default-primary);
  }

  .category-icon {
    margin-bottom: 36px;
  }

  .product-categories {
    padding: 40px 0 106px;
  }

  .product-categories .section-title {
    padding: 0 20px;
    font-size: 34px;
    line-height: 40px;
    margin-bottom: 24px;
  }
}