/* ==========================================================================
   Seiva - scroll reveal for native blocks + Product Collection styling

   Native Gutenberg blocks can set a className but not a data attribute, so
   the reveal hook is a class. This mirrors the [data-reveal] rules in
   seiva-base.css, which the remaining raw-HTML pages still use.
   seiva.js targets both selectors.
   ========================================================================== */

.seiva-reveal {
  opacity: 0;
  transform: translate3d(0, 24px, 0);
  transition:
    opacity var(--seiva-dur-slow) var(--seiva-ease-out),
    transform var(--seiva-dur-slow) var(--seiva-ease-out);
  transition-delay: calc(var(--seiva-stagger, 0) * 60ms);
  will-change: opacity, transform;
}

.seiva-reveal.is-revealed {
  opacity: 1;
  transform: none;
  will-change: auto;
}

/* If JS is blocked or fails to load, content must still be readable. */
.no-js .seiva-reveal {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .seiva-reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* Testimonial stars drawn on the card itself, so no empty block is needed. */
.seiva-quote--rated::before {
  content: "";
  display: block;
  width: 95px;
  height: 17px;
  margin-bottom: 0.9rem;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23a16207'%3E%3Cpath d='m12 2 3.1 6.3 6.9 1-5 4.9 1.2 6.8L12 17.8 5.8 21l1.2-6.8-5-4.9 6.9-1z'/%3E%3C/svg%3E") repeat-x left center / 19px 17px;
}

/* ==========================================================================
   WooCommerce Product Collection block
   Replaces the [products] shortcode so the editor shows a live preview.
   Styled to match the classic product cards on the shop archive.
   ========================================================================== */

.wc-block-product-template {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(1rem, 2.5vw, 1.75rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

.wc-block-product-template .wc-block-product {
  display: flex;
  flex-direction: column;
  position: relative;
  margin: 0;
  padding: 0.75rem 0.75rem 1.15rem;
  background: #fff;
  border: 1px solid var(--wp--preset--color--line);
  border-radius: var(--seiva-radius);
  box-shadow: var(--seiva-shadow-soft);
  transition:
    transform var(--seiva-dur) var(--seiva-ease-out),
    box-shadow var(--seiva-dur) var(--seiva-ease-out),
    border-color var(--seiva-dur) var(--seiva-ease-out);
}

@media (hover: hover) {
  .wc-block-product-template .wc-block-product:hover {
    transform: translate3d(0, -4px, 0);
    box-shadow: var(--seiva-shadow-lifted);
    border-color: rgba(161, 98, 7, 0.35);
  }
}

.wc-block-product-template .wc-block-components-product-image {
  margin: 0 0 1rem;
  overflow: hidden;
  border-radius: var(--seiva-radius-sm);
}
.wc-block-product-template .wc-block-components-product-image img {
  aspect-ratio: 1 / 1;
  width: 100%;
  height: auto;
  object-fit: cover;
  background: var(--wp--preset--color--surface-alt);
  transition: transform var(--seiva-dur-slow) var(--seiva-ease-out);
}
@media (hover: hover) {
  .wc-block-product-template .wc-block-product:hover .wc-block-components-product-image img {
    transform: scale(1.03);
  }
}

.wc-block-product-template .wp-block-post-title {
  margin: 0 0 0.35rem;
  font-family: var(--wp--preset--font-family--rubik);
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.35;
}
.wc-block-product-template .wp-block-post-title a {
  color: var(--wp--preset--color--navy);
  text-decoration: none;
}
.wc-block-product-template .wp-block-post-title a:hover {
  color: var(--wp--preset--color--gold);
}

.wc-block-product-template .wc-block-components-product-price {
  margin: 0 0 0.9rem;
  font-family: var(--wp--preset--font-family--rubik);
  font-size: 1.125rem;
  font-weight: 700;
  color: #7a4c05;
  font-variant-numeric: tabular-nums;
}
.wc-block-product-template .wc-block-components-product-price del {
  margin-inline-end: 0.4rem;
  font-weight: 400;
  font-size: 0.9375rem;
  color: var(--wp--preset--color--ink-muted);
  opacity: 1;
}
.wc-block-product-template .wc-block-components-product-price ins {
  text-decoration: none;
}

/* Push the button to the bottom so cards align across a row. */
.wc-block-product-template .wp-block-button {
  margin-top: auto;
}
.wc-block-product-template .wp-block-button__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  padding: 0.85rem 1.5rem;
  border-radius: var(--seiva-radius-sm);
  background-color: var(--wp--preset--color--navy);
  color: #fff;
  font-family: var(--wp--preset--font-family--rubik);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
}
.wc-block-product-template .wp-block-button__link:hover {
  background-color: var(--wp--preset--color--navy-mid);
  color: #fff;
  box-shadow: var(--seiva-shadow-lifted);
}

/* Sale badge */
.wc-block-product-template .wc-block-components-product-sale-badge {
  position: absolute;
  top: 1.25rem;
  left: 1.25rem;
  z-index: 2;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: var(--wp--preset--color--gold);
  color: #fff;
  font-family: var(--wp--preset--font-family--rubik);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

@media (max-width: 1024px) {
  .wc-block-product-template {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 480px) {
  .wc-block-product-template {
    grid-template-columns: 1fr;
  }
}
