/* --- Product Card Pattern Styles --- */
.product-card-wrapper {
  background-color: #eaeaea;
  border-radius: 20px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.product-card-wrapper:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.product-card-wrapper:hover .product-card-image-wrapper img {
  transform: scale(1.05) !important;
}

.product-card-image-wrapper {
  background-color: #ffffff;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  position: relative !important;
}

.product-card-image-wrapper a {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
}

.product-card-image-wrapper img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.product-card-badge {
  position: absolute !important;
  top: 8px !important;
  right: 8px !important;
  background-color: #e53935 !important;
  color: #ffffff !important;
  padding: 4px 12px !important;
  border-radius: 6px !important;
  font-size: 0.85rem !important;
  font-weight: 700 !important;
  font-family: var(--wp--preset--font-family--mn-kai-thot) !important;
  z-index: 10 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
  pointer-events: none !important;
}

.product-card-title {
  font-family: var(--wp--preset--font-family--mn-kai-thot) !important;
  font-size: 0.98rem !important;
  font-weight: 500 !important;
  color: #121212 !important;
  margin: 6px 0 3px 0 !important;
  line-height: 1.3 !important;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 2.6em;
}

.product-card-title a {
  text-decoration: none !important;
  color: inherit !important;
}

.product-card-price {
  font-family: var(--wp--preset--font-family--mn-kai-thot) !important;
  font-size: 1.1rem !important;
  font-weight: 700 !important;
  color: var(--wp--preset--color--primary, #43593b) !important;
  margin-bottom: 6px !important;
  display: flex !important;
  align-items: baseline !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
}

.product-card-price del {
  color: #9c9c9c !important;
  font-size: 0.85rem !important;
  font-weight: 500 !important;
  text-decoration: line-through !important;
}

.product-card-price ins {
  color: var(--wp--preset--color--primary, #43593b) !important;
  font-size: 1.1rem !important;
  font-weight: 700 !important;
  text-decoration: none !important;
  background: transparent !important;
  padding: 0 !important;
}

.product-card-button {
  margin-top: auto !important;
  width: 100% !important;
  position: relative !important;
}

.product-card-button .added_to_cart {
  display: none !important;
}

.product-card-button a.button {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  width: 100% !important;
  background-color: var(--wp--preset--color--light-green, #82cf61) !important;
  color: #ffffff !important;
  border-radius: 60px !important;
  padding: 12px 20px !important;
  text-decoration: none !important;
  font-family: var(--wp--preset--font-family--mn-kai-thot) !important;
  font-size: 1rem !important;
  font-weight: 600 !important;
  transition: all 0.3s ease !important;
  box-sizing: border-box !important;
  border: none !important;
  line-height: 1.2 !important;
}

.product-card-button a.button:hover {
  background-color: var(--wp--preset--color--primary, #43593b) !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(130, 207, 97, 0.3);
}

.product-card-button a.button::after {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m15 11-1 9'/%3E%3Cpath d='m19 11-4-7'/%3E%3Cpath d='M2 11h20'/%3E%3Cpath d='m3.5 11 1.6 7.4a2 2 0 0 0 2 1.6h9.8a2 2 0 0 0 2-1.6l1.7-7.4'/%3E%3Cpath d='M4.5 15.5h15'/%3E%3Cpath d='m5 11 4-7'/%3E%3Cpath d='m9 11 1 9'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  margin-left: 6px;
  flex-shrink: 0;
}

/* --- Related Products Grid --- */
.katanyu-related-products-section {
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.katanyu-related-products-title {
  font-family: var(--wp--preset--font-family--mn-kai-thot) !important;
  font-size: 1.35rem !important;
  font-weight: 700 !important;
  color: var(--wp--preset--color--primary, #43593b) !important;
  margin: 0 0 20px 0 !important;
}

.katanyu-related-products-grid {
  display: grid;
  grid-template-columns: repeat(var(--grid-cols, 4), minmax(0, 1fr));
  gap: 16px;
}

@media (max-width: 992px) {
  .katanyu-related-products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* --- Mobile Responsive Optimizations for Product Card --- */
@media (max-width: 576px) {
  .product-card-wrapper {
    padding: 8px !important;
    gap: 4px !important;
    border-radius: 14px !important;
  }

  .product-card-title {
    font-size: 0.88rem !important;
    margin: 4px 0 2px 0 !important;
    line-height: 1.2 !important;
    height: 2.4em !important;
  }

  .product-card-price {
    font-size: 0.98rem !important;
    margin-bottom: 4px !important;
    gap: 4px !important;
  }

  .product-card-price ins {
    font-size: 0.98rem !important;
  }

  .product-card-price del {
    font-size: 0.75rem !important;
  }

  .product-card-button a.button {
    font-size: 0.9rem !important;
  }

  .product-card-button a.button::after {
    width: 14px;
    height: 14px;
    margin-left: 4px;
  }

  .katanyu-related-products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
}
