/* TiltedCard – React Bits port (vanilla JS) */

.tilted-card-figure {
  position: relative;
  width: 100%;
  height: 100%;
  perspective: 800px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0;
}

.tilted-card-mobile-alert {
  position: absolute;
  top: 1rem;
  text-align: center;
  font-size: 0.875rem;
  display: none;
}

@media (max-width: 640px) {
  .tilted-card-mobile-alert {
    display: block;
  }

  .tilted-card-caption {
    display: none;
  }
}

.tilted-card-inner {
  position: relative;
  transform-style: preserve-3d;
  will-change: transform;
}

.tilted-card-img {
  position: absolute;
  top: 0;
  left: 0;
  object-fit: cover;
  border-radius: 15px;
  will-change: transform;
  transform: translateZ(0);
}

.tilted-card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  will-change: transform;
  transform: translateZ(30px);
}

.tilted-card-caption {
  pointer-events: none;
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 4px;
  background-color: #fff;
  padding: 4px 10px;
  font-size: 10px;
  color: #2d2d2d;
  opacity: 0;
  z-index: 3;
  white-space: nowrap;
}

/* Product card integration */

.product-card .tilted-card-figure {
  height: 220px;
  flex-shrink: 0;
  overflow: visible;
}

.product-card .tilted-card-inner {
  width: 100%;
  height: 220px;
  background: var(--color-card);
}

.product-card .tilted-card-overlay {
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
}

.product-card .tilted-card-overlay h2 {
  font-family: var(--font-roboto);
  font-size: 30px;
  font-weight: 600;
  color: #000;
  margin-bottom: 12px;
  width: 100%;
}

.product-card .tilted-card-overlay p {
  font-family: var(--font-open);
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-text);
  margin: 0;
}

/* Image cards – match ipdizains.lv layout */

.product-card--has-image .tilted-card-inner {
  background: transparent;
}

.product-card--has-image .tilted-card-inner,
.product-card--has-image .tilted-card-img {
  width: 100%;
  height: 220px;
}

.product-card--has-image .tilted-card-img {
  border-radius: 0;
}

.product-card--has-image .tilted-card-overlay {
  inset: 85px 0 0 0;
  height: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 18px 20px 0;
  text-align: center;
  background: var(--color-card);
  box-shadow: 0 -4px 12px rgba(68, 68, 68, 0.15);
  pointer-events: none;
}

.product-card--has-image .tilted-card-overlay h2 {
  padding: 0;
  margin-bottom: 8px;
}

.product-card--has-image .tilted-card-figure {
  position: relative;
  z-index: 1;
}

.product-card--has-image .product-card-body {
  margin-top: 0;
  padding: 28px 20px 40px;
  position: relative;
  z-index: 3;
  justify-content: flex-start;
  background: var(--color-card);
}

.product-card--has-image h2 {
  font-family: var(--font-roboto);
  font-size: 30px;
  font-weight: 600;
  color: #000;
  padding: 0;
  margin: 8px 0 12px;
  width: 100%;
}

.product-card--has-image p {
  font-family: var(--font-open);
  font-size: 14px;
  margin-bottom: 20px;
  line-height: 1.5;
  flex: 1;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Product detail page – larger tilted images */

.product-detail-image.tilted-card-figure {
  max-width: 800px;
  width: 100%;
  height: 400px;
  margin: 0 auto 24px;
  overflow: visible;
}

.product-detail-image .tilted-card-inner {
  width: 100%;
  height: 400px;
  background: #fff;
}

.product-detail-image .tilted-card-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 0;
}

@media (max-width: 767px) {
  .product-detail-image.tilted-card-figure,
  .product-detail-image .tilted-card-inner {
    height: 280px;
  }
}
