/**
 * Component: Shop by Category
 *
 * Styles for the category grid and pre-order banner.
 *
 * @package    Factoria child
 * @subpackage Styles/Components
 * @since      1.0.0
 */

/* --------------------------------------------------------
   Section
   -------------------------------------------------------- */
.shop-by-category {
  padding-block: 2rem;
}

@media (min-width: 1024px) {
  .shop-by-category {
    padding-block: 5.6rem;
  }
}

.shop-by-category__title {
  font-size: 1.8rem;
  font-weight: 700;
  color: hsl(var(--foreground));
  margin-bottom: 1.2rem;
}

@media (min-width: 1024px) {
  .shop-by-category__title {
    font-size: 3rem;
    margin-bottom: 3.2rem;
  }
}

/* --------------------------------------------------------
   Grid
   -------------------------------------------------------- */
.shop-by-category__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem;
}

@media (min-width: 1024px) {
  .shop-by-category__grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
  }
}

/* --------------------------------------------------------
   Category Card
   -------------------------------------------------------- */
.category-card {
  display: block;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--card));
  padding: 1.2rem;
  transition: all 0.2s ease;
}

@media (min-width: 1024px) {
  .category-card {
    padding: 2rem;
  }
}

.category-card:hover {
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

/* Icon */
.category-card__icon {
  width: 3.6rem;
  height: 3.6rem;
  border-radius: 0.8rem;
  background-color: hsl(var(--primary) / 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.8rem;
  transition: transform 0.2s ease;
  color: #fff;

  svg {
    width: 60%;
  }
}

@media (min-width: 1024px) {
  .category-card__icon {
    width: 4.8rem;
    height: 4.8rem;
    margin-bottom: 1.2rem;
  }
}

.category-card:hover .category-card__icon {
  transform: scale(1.1);
}

.category-card__icon .dashicons {
  color: hsl(var(--primary));
  font-size: 1.6rem;
}

@media (min-width: 1024px) {
  .category-card__icon .dashicons {
    font-size: 2.4rem;
  }
}

/* Name */
.category-card__name {
  font-size: 1.2rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  margin-bottom: 0.2rem;
}

@media (min-width: 1024px) {
  .category-card__name {
    font-size: 1.6rem;
    margin-bottom: 0.4rem;
  }
}

/* Description */
.category-card__description {
  display: none;
  font-size: 1.4rem;
  color: hsl(var(--muted-foreground));
  margin-bottom: 0.8rem;
}

@media (min-width: 1024px) {
  .category-card__description {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}

/* Count */
.category-card__footer {
  margin-top: 2rem;
}

.category-card__count {
  font-size: 1rem;
  font-weight: 600;
  color: hsl(var(--primary));
}

@media (min-width: 1024px) {
  .category-card__count {
    font-size: 1.2rem;
  }
}

/* --------------------------------------------------------
   Pre-order Card (Mobile)
   -------------------------------------------------------- */
.preorder-card-mobile {
  display: block;
  border-radius: var(--radius);
  border: 2px dashed hsl(var(--primary) / 0.4);
  background-color: hsl(var(--primary) / 0.04);
  padding: 1.2rem;
  transition: all 0.2s ease;
}

@media (min-width: 1024px) {
  .preorder-card-mobile {
    display: none;
  }
}

.preorder-card-mobile:hover {
  border-color: hsl(var(--primary));
  background-color: hsl(var(--primary) / 0.08);
}

.preorder-card-mobile__icon {
  width: 3.6rem;
  height: 3.6rem;
  border-radius: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.8rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease;
}

.preorder-card-mobile:hover .preorder-card-mobile__icon {
  transform: scale(1.1);
}

.preorder-card-mobile__icon .dashicons {
  color: hsl(var(--primary-foreground));
  font-size: 1.6rem;
}

.preorder-card-mobile__name {
  font-size: 1.2rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  margin-bottom: 0.2rem;
}

.preorder-card-mobile__badge {
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  margin-bottom: 0.4rem;
}

.preorder-card-mobile__count {
  font-size: 1rem;
  font-weight: 500;
  color: hsl(var(--primary));
}

/* --------------------------------------------------------
   Pre-order Banner (Desktop)
   -------------------------------------------------------- */
.preorder-banner {
  display: none;
  margin-top: 2.4rem;
  border-radius: 1.6rem;
  border: 2px dashed hsl(var(--primary) / 0.4);
  background-color: hsl(var(--primary) / 0.04);
  padding: 2.4rem;
  transition: all 0.2s ease;
}

@media (min-width: 1024px) {
  .preorder-banner {
    display: block;
  }
}

.preorder-banner:hover {
  border-color: hsl(var(--primary));
  background-color: hsl(var(--primary) / 0.08);
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

.preorder-banner__inner {
  display: flex;
  align-items: center;
  gap: 1.6rem;
}

.preorder-banner__icon {
  width: 5.6rem;
  height: 5.6rem;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease;
  color: #fff;
  svg {
    width: 60%;
  }
}

.preorder-banner:hover .preorder-banner__icon {
  transform: scale(1.1);
}

.preorder-banner__icon .dashicons {
  color: hsl(var(--primary-foreground));
  font-size: 2.8rem;
}

.preorder-banner__content {
  flex: 1;
  min-width: 0;
}

.preorder-banner__header {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.4rem;
}

.preorder-banner__name {
  font-size: 2rem;
  font-weight: 700;
  color: hsl(var(--foreground));
}

.preorder-banner__badge {
  display: inline-block;
  font-size: 1.2rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  padding: 0.2rem 0.8rem;
  border-radius: 9999px;
}

.preorder-banner__description {
  font-size: 1.4rem;
  color: hsl(var(--muted-foreground));
}

.preorder-banner__count {
  font-size: 1.4rem;
  font-weight: 500;
  color: hsl(var(--primary));
  flex-shrink: 0;
}
