/**
 * Product Item Block Styles
 */

/* Main Product Item container */
.product-item {
  list-style: none;
  flex: 0 0 calc(20% - 7.5px);
  padding: 0;
}

.product-item-card .discount-percentage-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10;
  background-color: var(--error);
  color: var(--white);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: var(--text-sm);
  font-weight: bold;
  pointer-events: none;
}

.product-item-card {
  background-color: var(--background);
  height: 100%;
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius);
  overflow: hidden;
  transition: all 0.3s ease;
  padding: var(--space-3);

  &:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  }

  span.onsale {
    background-color: var(--primary);
    color: var(--primary-foreground);
    border-radius: var(--border-radius);
  }

  & > a {
    display: flex;
    justify-content: center;
    position: relative;
    aspect-ratio: 1/1;
    overflow: hidden;
  }

  img {
    position: absolute;
    background-color: #f5f5f5;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
  }
}

/* Product Info Container */
.product-item-info {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);

  @media (width <= 480px) {
    padding: var(--space-1);
  }
}

/* Product Title */
.product-item-title-container {
  margin-bottom: var(--space-2);
}

.product-item-title-container > * {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text);
  margin: 0;
  line-height: 1.4;

  @media (width <= 480px) {
    font-size: var(--text-sm);
  }
}

/* Lämplig för att använda */
.product-item-suitable-for {
  font-size: var(--text-sm);
  color: var(--text);
  opacity: 0.7;
  margin-bottom: var(--space-2);
}

/* Stock Status */
.product-item-stock-status {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  margin-bottom: var(--space-3);
}

.product-item-stock-status .stock-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.product-item-stock-status.stock-green .stock-dot {
  background-color: var(--success);
}

.product-item-stock-status.stock-yellow .stock-dot {
  background-color: var(--warning);
}

.product-item-stock-status.stock-red .stock-dot {
  background-color: var(--error);
}

.product-item-stock-status .stock-text {
  color: var(--text);
  font-weight: 500;
}

/* Orange Circle Button */
.product-item-circle-button {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f6b055 0%, #f59e3d 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: auto;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(245, 158, 61, 0.3);

  @media (width <= 480px) {
    display: none;
  }
}

.product-item-circle-button:hover {
  background: linear-gradient(135deg, #f59e3d 0%, #f48c25 100%);
}

.product-item-circle-button svg {
  width: 20px;
  height: 20px;
  stroke: var(--white);
  stroke-width: 2.5;
}
/* Horizontal Layout */
.product-item.horizontal {
  padding: 0;
  .product-item-card {
    flex-direction: row;
    width: 100%;
    & > a {
      min-height: 160px;
    }
  }
  .product-item-info {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 100%;
    padding-left: var(--space-4);
  }
}

/* Responsive styles */
@media (width <= 1024px) {
  .product-item {
    flex: 0 0 calc(25% - 7px);
  }
}
@media (width <= 768px) {
  .product-item {
    flex: 0 0 calc(40% - 7px);
  }
}
@media (width <= 480px) {
  .product-item {
    flex: 0 0 calc(50% - 7px);
  }
}

/* Price wrapper */
.product-item-price-wrapper {
  margin-bottom: var(--space-2);
}

.product-item-price {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text);
}

.product-item-login-for-price {
  font-size: var(--text-sm);
  color: var(--text);
  text-decoration: underline;
  font-weight: 500;
  transition: color 0.2s;
}

.product-item-login-for-price:hover {
  color: var(--primary-dark);
}
