.xcodee-product-grid-wrapper {
  width: 100%;
  margin: 40px 0;
}

.xcodee-product-grid {
  display: grid;
  gap: 30px;
  align-items: stretch;
}

.xcodee-product-grid-card {
  background: #f5f5f5;
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  position: relative;
  display: flex;
  min-height: 100%;
}

.xcodee-product-grid-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.xcodee-product-grid-card a {
  text-decoration: none !important;
}

.xcodee-product-grid-link {
  display: block;
  text-decoration: none;
  color: inherit;
  height: 100%;
  width: 100%;
}

.xcodee-product-grid-content {
  display: flex;
  align-items: stretch;
  min-height: 320px;
  padding: 24px;
  gap: 20px;
  height: 100%;
}

.xcodee-product-grid-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  min-width: 0;
  z-index: 2;
  gap: 10px;
}

.xcodee-product-grid-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #333;
  line-height: 1.35;
  letter-spacing: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: calc(1em * 1.35 * 4);
  word-break: break-word;
  overflow-wrap: anywhere;
}

.xcodee-product-grid-link:hover .xcodee-product-grid-title {
  color: #0071bd;
}

.xcodee-product-grid-category {
  display: block;
  font-size: 13px;
  color: #666;
  margin-bottom: 0;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

.xcodee-product-grid-price {
  display: none;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: auto;
}

.xcodee-price-regular {
  font-size: 18px;
  color: #999;
  text-decoration: line-through;
  font-weight: 400;
}

.xcodee-price-sale {
  font-size: 20px;
  font-weight: 600;
  color: var(--e-global-color-5b522ed);
  text-decoration: none;
  text-underline-offset: 3px;
}

.xcodee-price-current {
  font-size: 20px;
  font-weight: 600;
  color: #333;
}

.xcodee-product-grid-image {
  flex: 0 0 auto;
  width: min(42%, 180px);
  aspect-ratio: 1 / 1;
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  align-self: center;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  padding: 10px;
}

.xcodee-product-grid-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.1));
}

.xcodee-product-grid-card:hover .xcodee-product-grid-image img {
  transform: scale(1.03);
}

/* Responsive */
@media (max-width: 1024px) {
  .xcodee-product-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 25px;
  }

  .xcodee-product-grid-content {
    padding: 20px;
    gap: 16px;
    min-height: 280px;
  }

  .xcodee-product-grid-title {
    font-size: 17px;
  }

  .xcodee-product-grid-image {
    width: min(44%, 165px);
  }
}

@media (max-width: 768px) {
  .xcodee-product-grid {
    grid-template-columns: 1fr !important;
    gap: 20px;
  }

  .xcodee-product-grid-content {
    flex-direction: column;
    padding: 20px;
    min-height: auto;
    gap: 14px;
  }

  .xcodee-product-grid-info {
    width: 100%;
    order: 1;
  }

  .xcodee-product-grid-image {
    width: min(100%, 210px);
    min-height: 180px;
    order: 2;
  }

  .xcodee-product-grid-title {
    font-size: 16px;
  }

  .xcodee-product-grid-category {
    margin-bottom: 15px;
    font-size: 13px;
  }

  .xcodee-price-regular {
    font-size: 16px;
  }

  .xcodee-price-sale,
  .xcodee-price-current {
    font-size: 18px;
  }
}

@media (max-width: 480px) {
  .xcodee-product-grid-content {
    padding: 25px 20px;
  }

  .xcodee-product-grid-title {
    font-size: 15px;
    min-height: calc(1em * 1.35 * 3);
    -webkit-line-clamp: 3;
    line-clamp: 3;
  }

  .xcodee-price-sale,
  .xcodee-price-current {
    font-size: 17px;
  }
}

/* Pulse Animation for Sale Badge */
@keyframes glowPulse {
  0%,
  100% {
    box-shadow: 0 2px 8px rgba(255, 68, 68, 0.4);
  }
  50% {
    box-shadow: 0 2px 8px rgba(255, 68, 68, 0.4),
      0 0 20px rgba(255, 68, 68, 0.6), 0 0 30px rgba(255, 68, 68, 0.4);
  }
}

.xcodee-product-sale-badge {
  position: absolute;
  top: 20px;
  left: -30px;
  min-width: 120px;
  background: #ff4444;
  color: #fff;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  line-height: 1.2;
  text-align: center;
  transform: rotate(-45deg);
  transform-origin: center;
  animation: glowPulse 2s ease-in-out infinite;
}

/* Add triangular cutouts for ribbon effect */
.xcodee-product-sale-badge::before,
.xcodee-product-sale-badge::after {
  content: "";
  position: absolute;
  top: 100%;
  width: 0;
  height: 0;
  border-style: solid;
}

.xcodee-product-sale-badge::before {
  left: 0;
  border-width: 0 8px 8px 0;
  border-color: transparent #cc0000 transparent transparent;
}

.xcodee-product-sale-badge::after {
  right: 0;
  border-width: 0 0 8px 8px;
  border-color: transparent transparent transparent #cc0000;
}
