/**
 * Store Category Grid Styles
 */

.store-category-grid {
  padding: 3rem 0;
}

.store-category-grid__heading {
  font-size: 2rem;
  font-weight: 700;
  color: #1f2937;
  margin: 0 0 2.5rem;
  text-align: center;
}

.store-category-grid__items {
  display: grid;
  gap: 1.5rem;
}

/* Grid columns */
.store-category-grid--cols-2 .store-category-grid__items {
  grid-template-columns: repeat(2, 1fr);
}

.store-category-grid--cols-3 .store-category-grid__items {
  grid-template-columns: repeat(3, 1fr);
}

.store-category-grid--cols-4 .store-category-grid__items {
  grid-template-columns: repeat(4, 1fr);
}

.store-category-grid--cols-6 .store-category-grid__items {
  grid-template-columns: repeat(6, 1fr);
}

/* Store Category Card - Horizontal Layout */
.store-category-card {
  position: relative;
  height: 155px;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  background: #ffffff;
  border: 1px solid #e5e7eb;
}

.store-category-card:hover {
  border-color: var(--hover-border-color, #1a4d2e);
  border-width: var(--hover-border-width, 1px);
  box-shadow: var(--hover-box-shadow, 0 4px 12px rgba(26, 77, 46, 0.15));
}

.store-category-card a:hover {
  text-decoration: none !important;
}

.store-category-card__link {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
  width: 100%;
  height: 100%;
  position: relative;
}

/* Left: Text Content */
.store-category-card__text {
  position: relative;
  z-index: 2;
  width: 135px;
  padding-left: 24px;
  flex-shrink: 0;
}

.store-category-card__name {
  font-size: 20px;
  font-weight: 600;
  color: #1a4d2e;
  margin: 0 0 8px;
  line-height: 1.2;
}

.store-category-card__count {
  font-size: 16px;
  font-weight: 500;
  color: #4ade80;
  margin: 0;
  line-height: 1.2;
}

/* Middle: Background Shape */
.store-category-card__shape {
  position: absolute;
  right: 0;
  top: 0;
  width: 70%;
  height: 100%;
  z-index: 1;
  background-size: cover;
  background-position: right center;
  background-repeat: no-repeat;
}

/* Predefined Shape 1: Default Arrow (original) */
.store-category-card__shape--shape_1,
.store-category-card__shape--default,
.store-category-card__shape--arrow,
.store-category-card__shape--default_arrow {
  background-image: url("data:image/svg+xml,%3Csvg width='297' height='154' viewBox='0 0 297 154' fill='none' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'%3E%3Cpath d='M297.001 154V0H28.0007L110.125 98.3253C111.983 100.55 112.492 103.606 111.456 106.313L93.2045 154H297.001Z' fill='%2382DCB4'/%3E%3C/svg%3E");
}

/* Predefined Shape 2: Top Arrow */
.store-category-card__shape--shape_2,
.store-category-card__shape--top_arrow,
.store-category-card__shape--toparrow {
  background-image: url("data:image/svg+xml,%3Csvg width='297' height='155' viewBox='0 0 297 155' fill='none' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'%3E%3Cpath d='M65.9328 154H296.997L297 0H62L105.182 46.5725C107.304 48.8611 107.901 52.1748 106.712 55.0602L65.9328 154Z' fill='%2382DCB4'/%3E%3C/svg%3E");
}

/* Predefined Shape 3: Angled */
.store-category-card__shape--shape_3,
.store-category-card__shape--angled {
  background-image: url("data:image/svg+xml,%3Csvg width='297' height='154' viewBox='0 0 297 154' fill='none' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'%3E%3Cpath d='M92.6079 153.5H296.893V0.5H88.3186L63.6902 92.0355C63.1767 93.944 63.3878 95.975 64.2829 97.7371L92.6079 153.5Z' fill='%2382DCB4'/%3E%3C/svg%3E");
}

/* Predefined Shape 4: Deep Cut */
.store-category-card__shape--shape_4,
.store-category-card__shape--deep_cut,
.store-category-card__shape--deepcut {
  background-image: url("data:image/svg+xml,%3Csvg width='297' height='154' viewBox='0 0 297 154' fill='none' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'%3E%3Cpath d='M100.264 153H296.5V0H87.6032L56.9517 80.2015C56.0395 82.5885 56.3224 85.2677 57.7132 87.4115L100.264 153Z' fill='%2382DCB4'/%3E%3C/svg%3E");
}

/* Predefined Shape 5: Wide Arrow */
.store-category-card__shape--shape_5,
.store-category-card__shape--wide_arrow,
.store-category-card__shape--widearrow {
  background-image: url("data:image/svg+xml,%3Csvg width='297' height='154' viewBox='0 0 297 154' fill='none' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'%3E%3Cpath d='M68.8347 153.5L297 153.5V0.5H59.843L26.4877 94.7943C25.5629 97.4086 26.0579 100.315 27.7959 102.476L68.8347 153.5Z' fill='%2382DCB4'/%3E%3C/svg%3E");
}

/* Predefined Shape 6: Narrow Arrow */
.store-category-card__shape--shape_6,
.store-category-card__shape--narrow_arrow,
.store-category-card__shape--narrowarrow {
  background-image: url("data:image/svg+xml,%3Csvg width='297' height='154' viewBox='0 0 297 154' fill='none' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'%3E%3Cpath d='M118.491 153.5H297V0.5H97L135.399 98.2642C136.093 100.03 136.136 101.986 135.521 103.781L118.491 153.5Z' fill='%2382DCB4'/%3E%3C/svg%3E");
}

/* Predefined Shape: None (no shape) */
.store-category-card__shape--none {
  display: none;
}

/* Reversed Layout - Text on right, Shape/Image on left */
.store-category-card--reversed .store-category-card__link {
  flex-direction: row-reverse;
}

.store-category-card--reversed .store-category-card__text {
  padding-left: 0;
  padding-right: 24px;
  text-align: right;
}

.store-category-card--reversed .store-category-card__shape {
  right: 30%;
  left: auto;
  transform: scaleX(-1);
}

.store-category-card--reversed .store-category-card__image-wrapper {
  right: auto;
  left: 0;
}

/* Right: Product Image */
.store-category-card__image-wrapper {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 192px;
  height: 153px;
  border-radius: 0.375rem 0.375rem 0 0;
  overflow: hidden;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
}

.store-category-card__image {
  /* Default values - can be overridden by inline styles from taxonomy term fields */

  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  transition: transform 0.3s ease;
}

.store-category-card:hover .store-category-card__image {
  /* Note: If image has custom rotation via inline style, this hover effect will be overridden */
  /* For proper hover with rotation, use CSS custom properties in future enhancement */
  filter: brightness(1.05);
}

.store-category-card__placeholder-icon {
  width: 80px;
  height: 80px;
  opacity: 0.3;
}

.store-category-grid__empty {
  text-align: center;
  color: #6b7280;
  padding: 3rem 0;
  font-size: 1.125rem;
}

/* Responsive */
@media (max-width: 1024px) {
  .store-category-grid--cols-6 .store-category-grid__items {
    grid-template-columns: repeat(4, 1fr);
  }

  .store-category-card {
    height: 140px;
  }

  .store-category-card__text {
    width: 120px;
    padding-left: 20px;
  }

  .store-category-card__name {
    font-size: 18px;
  }

  .store-category-card__count {
    font-size: 14px;
  }

  .store-category-card__image-wrapper {
    width: 160px;
    height: 130px;
  }

  .store-category-card__gradient {
    width: 72%;
    clip-path: polygon(100% 100%, 100% 0%, 12% 0%, 35% 60%, 30% 100%);
  }
}

@media (max-width: 768px) {
  .store-category-grid {
    padding: 2rem 0;
  }

  .store-category-grid__heading {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
  }

  .store-category-grid--cols-4 .store-category-grid__items,
  .store-category-grid--cols-6 .store-category-grid__items {
    grid-template-columns: repeat(2, 1fr);
  }

  .store-category-grid__items {
    gap: 1rem;
  }

  .store-category-card {
    height: 120px;
    border-radius: 10px;
  }

  .store-category-card__text {
    width: 100px;
    padding-left: 16px;
  }

  .store-category-card__name {
    font-size: 16px;
    margin-bottom: 6px;
  }

  .store-category-card__count {
    font-size: 13px;
  }

  .store-category-card__image-wrapper {
    width: 130px;
    height: 110px;
  }

  .store-category-card__gradient {
    width: 70%;
    clip-path: polygon(100% 100%, 100% 0%, 15% 0%, 38% 60%, 32% 100%);
  }

  .store-category-card__placeholder-icon {
    width: 60px;
    height: 60px;
  }
}

@media (max-width: 480px) {
  .store-category-grid--cols-2 .store-category-grid__items,
  .store-category-grid--cols-3 .store-category-grid__items,
  .store-category-grid--cols-4 .store-category-grid__items,
  .store-category-grid--cols-6 .store-category-grid__items {
    grid-template-columns: repeat(1, 1fr);
  }

  .store-category-grid__heading {
    font-size: 1.5rem;
  }

  .store-category-card {
    height: 110px;
  }

  .store-category-card__text {
    width: 90px;
    padding-left: 12px;
  }

  .store-category-card__name {
    font-size: 14px;
    margin-bottom: 4px;
  }

  .store-category-card__count {
    font-size: 12px;
  }

  .store-category-card__image-wrapper {
    width: 110px;
    height: 100px;
  }

  .store-category-card__gradient {
    width: 68%;
    clip-path: polygon(100% 100%, 100% 0%, 18% 0%, 40% 60%, 34% 100%);
  }

  .store-category-card__placeholder-icon {
    width: 50px;
    height: 50px;
  }
}
