/* =====================================================================
   ISA COMMERCE CORE — KOMPONEN REUSABLE (foundation)
   Product Card · Product Grid/Carousel · Category Card · Scroll Row · Badge
   Sumber: PROTOTYPE/isa-hijab/css/main.css §7, §8, §21 (visual tidak diubah).
   Pemetaan WooCommerce Blocks:
     .product-card          ← Product Template item (li.wc-block-product) di Product Collection
     .product-card__media   ← Product Image block (woocommerce/product-image)
     .product-card__title   ← Post Title block (core/post-title) di dalam Product Template
     .product-card__price   ← Product Price block (woocommerce/product-price)
     .rating                ← Product Rating block (woocommerce/product-rating)
     .badge--sale           ← On-Sale Badge (woocommerce/product-sale-badge)
     .product-grid          ← Product Collection layout grid
   Komponen homepage lain (hero, campaign banner, lookbook, testimonials, …)
   dikonversi pada langkah berikutnya (pattern per section).
   ===================================================================== */

/* ---------- SCROLL ROW & CATEGORY GRID ---------- */
.scroll-row { display: flex; gap: var(--isa-card-gap); overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--isa-page-padding); scrollbar-width: none; padding-inline: var(--isa-page-padding); margin-inline: calc(-1 * var(--isa-page-padding)); padding-bottom: .25rem; }
.scroll-row::-webkit-scrollbar { display: none; }
.scroll-row > * { flex: 0 0 auto; scroll-snap-align: start; }
.cat-grid > * { width: 42vw; max-width: 15rem; }
@media (min-width: 768px) {
  .cat-grid { display: grid; grid-template-columns: repeat(3, 1fr); overflow: visible; margin: 0; padding: 0; }
  .cat-grid > * { width: auto; max-width: none; }
}
@media (min-width: 1024px) { .cat-grid { grid-template-columns: repeat(6, 1fr); } }
.cat-card { position: relative; display: block; border-radius: var(--isa-radius-card); overflow: hidden; aspect-ratio: var(--isa-ratio-category); background: var(--isa-color-surface-alt); }
.cat-card img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform var(--isa-motion-slow) var(--isa-ease); }
.cat-card:hover img { transform: scale(1.06); }
.cat-card__body { position: absolute; inset: auto 0 0 0; padding: 1rem; background: linear-gradient(to top, rgba(34,24,21,.82), rgba(34,24,21,0)); color: #fff; }
.cat-card__title { font-family: var(--isa-font-display); font-size: 1.25rem; font-weight: 500; line-height: 1.1; color: #fff; margin: 0; }
.cat-card__count { display: block; margin-top: .2rem; font-size: var(--isa-text-caption); color: rgba(255,255,255,.75); letter-spacing: .06em; }
.cat-card__arrow { position: absolute; top: .75rem; right: .75rem; width: 2rem; height: 2rem; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.9); color: var(--isa-color-primary); opacity: 0; transform: translate(4px, -4px); transition: opacity var(--isa-motion-normal), transform var(--isa-motion-normal) var(--isa-ease); }
.cat-card:hover .cat-card__arrow { opacity: 1; transform: none; }

/* ---------- PRODUCT GRID / CAROUSEL ---------- */
.product-grid, .wc-block-product-template.product-grid, .product-grid .wc-block-product-template { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--isa-card-gap); row-gap: clamp(1.5rem, 3vw, 2.5rem); list-style: none; margin: 0; padding: 0; }
@media (min-width: 768px) { .product-grid, .product-grid .wc-block-product-template { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .product-grid, .product-grid .wc-block-product-template { grid-template-columns: repeat(4, 1fr); } }
.product-grid--4, .product-grid--4 .wc-block-product-template { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 1024px) { .product-grid--4, .product-grid--4 .wc-block-product-template { grid-template-columns: repeat(4, 1fr); } }

.product-carousel.scroll-row > * { width: 62vw; max-width: 18rem; }
@media (min-width: 640px) { .product-carousel.scroll-row > * { width: 40vw; } }
@media (min-width: 1024px) { .product-carousel.scroll-row > * { width: calc((min(var(--isa-container), 100vw) - 2 * var(--isa-page-padding) - 3 * var(--isa-card-gap)) / 4); max-width: none; } }
.carousel__nav { display: none; gap: .5rem; }
.carousel__btn { width: 2.75rem; height: 2.75rem; border: 1px solid var(--isa-color-border); border-radius: 50%; display: grid; place-items: center; background: var(--isa-color-surface); transition: background var(--isa-motion-fast), border-color var(--isa-motion-fast), color var(--isa-motion-fast); }
.carousel__btn:hover { background: var(--isa-color-primary); color: #fff; border-color: var(--isa-color-primary); }
@media (min-width: 1024px) { .carousel__nav { display: flex; } }

/* ---------- PRODUCT CARD ---------- */
.product-card, .wc-block-product-template .wc-block-product { position: relative; display: flex; flex-direction: column; gap: .75rem; min-width: 0; }
.product-card__media, .wc-block-product .wc-block-components-product-image { position: relative; aspect-ratio: var(--isa-ratio-product); overflow: hidden; border-radius: var(--isa-radius-card); background: var(--isa-color-surface-alt); margin: 0; }
.product-card__media img, .wc-block-product .wc-block-components-product-image img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; transition: opacity var(--isa-motion-slow) var(--isa-ease), transform var(--isa-motion-slow) var(--isa-ease); }
.wc-block-product .wc-block-components-product-image a { display: block; position: absolute; inset: 0; }
.product-card__img--hover { opacity: 0; }
@media (hover: hover) {
  .product-card:hover .product-card__img--hover { opacity: 1; }
  .product-card:hover .product-card__img--main, .wc-block-product:hover .wc-block-components-product-image img { transform: scale(1.03); }
}
.product-card__badges { position: absolute; top: .6rem; left: .6rem; display: flex; flex-direction: column; align-items: flex-start; gap: .3rem; z-index: 2; }
.badge, .wc-block-components-product-sale-badge { display: inline-block; padding: .3rem .55rem; font-size: .65rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; border-radius: var(--isa-radius); line-height: 1; border: 0; }
.badge--new { background: var(--isa-color-primary); color: #fff; }
.badge--sale, .wc-block-components-product-sale-badge { background: var(--isa-color-error); color: #fff; }
.badge--best { background: var(--isa-color-accent); color: var(--isa-color-primary); }
.badge--limited { background: var(--isa-color-warning); color: #fff; }
.badge--soldout { background: var(--isa-color-surface); color: var(--isa-color-text-muted); border: 1px solid var(--isa-color-border); }
/* On-Sale Badge block di dalam Product Image block (posisi kiri atas, sama dengan prototype) */
.wc-block-product .wc-block-components-product-image .wc-block-components-product-sale-badge { position: absolute; top: .6rem; left: .6rem; right: auto; z-index: 2; margin: 0; }
.wc-block-components-product-sale-badge__text { font: inherit; }

.product-card__wishlist { position: absolute; top: .5rem; right: .5rem; z-index: 2; width: 2.25rem; height: 2.25rem; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.9); color: var(--isa-color-primary); transition: transform var(--isa-motion-fast), color var(--isa-motion-fast); }
.product-card__wishlist:hover { transform: scale(1.08); }
.product-card__wishlist.is-active { color: var(--isa-color-error); }
.product-card__wishlist.is-active .icon { fill: currentColor; }
.product-card__quick { position: absolute; inset: auto .6rem .6rem .6rem; z-index: 2; display: none; gap: .4rem; transform: translateY(120%); opacity: 0; transition: transform var(--isa-motion-normal) var(--isa-ease), opacity var(--isa-motion-normal); }
.product-card__quick .btn, .product-card__quick .wp-block-button__link { flex: 1; min-height: 2.6rem; padding: 0 .75rem; font-size: .7rem; background: color-mix(in srgb, var(--isa-color-background) 96%, transparent); color: var(--isa-color-primary); backdrop-filter: blur(6px); }
.product-card__quick .btn:hover, .product-card__quick .wp-block-button__link:hover { background: var(--isa-color-primary); color: #fff; }
.product-card__quick .btn--wa-icon { flex: 0 0 2.6rem; padding: 0; background: var(--isa-color-whatsapp); color: #fff; }
.product-card__mobile-add { position: absolute; right: .5rem; bottom: .5rem; z-index: 2; width: 2.25rem; height: 2.25rem; display: grid; place-items: center; border-radius: 50%; background: var(--isa-color-primary); color: #fff; box-shadow: var(--isa-shadow-md); }
@media (hover: hover) and (min-width: 1024px) {
  .product-card__quick { display: flex; }
  .product-card:hover .product-card__quick, .wc-block-product:hover .product-card__quick { transform: none; opacity: 1; }
  .product-card__mobile-add { display: none; }
}
.product-card--soldout .product-card__media img { filter: grayscale(.4); opacity: .75; }
.product-card--soldout .product-card__quick, .product-card--soldout .product-card__mobile-add { display: none; }
.product-card__body { display: flex; flex-direction: column; gap: .3rem; }
.product-card__cat { font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--isa-color-text-muted); margin: 0; }
.product-card__title, .wc-block-product .wp-block-post-title { font-family: var(--isa-font-body); font-size: var(--isa-text-small); font-weight: 600; line-height: 1.35; color: var(--isa-color-primary); margin: 0; letter-spacing: 0; }
.product-card__title a::after, .wc-block-product .wp-block-post-title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.product-card__title a:hover, .wc-block-product .wp-block-post-title a:hover { color: var(--isa-color-secondary); }
.product-card__price, .wc-block-product .wc-block-components-product-price { display: flex; align-items: baseline; gap: .5rem; font-size: var(--isa-text-small); font-weight: 600; flex-wrap: wrap; margin: 0; }
.product-card__price del, .wc-block-product .wc-block-components-product-price del { color: var(--isa-color-text-muted); font-weight: 400; text-decoration: line-through; }
.product-card__price ins, .wc-block-product .wc-block-components-product-price ins { text-decoration: none; color: var(--isa-color-error); }
.product-card__meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .35rem .5rem; }
.rating, .wc-block-product .wc-block-components-product-rating { display: inline-flex; align-items: center; gap: .3rem; font-size: var(--isa-text-caption); color: var(--isa-color-text-muted); margin: 0; }
.rating__stars, .wc-block-components-product-rating__stars { display: inline-flex; color: var(--isa-color-accent); }
.rating__stars .icon { width: .8rem; height: .8rem; }
.swatches { display: flex; align-items: center; gap: .3rem; }
.swatch { width: .8rem; height: .8rem; border-radius: 50%; border: 1px solid rgba(0,0,0,.12); box-shadow: inset 0 0 0 1px rgba(255,255,255,.4); }
.swatches__more { font-size: .68rem; color: var(--isa-color-text-muted); }
.product-card__stock { font-size: .7rem; font-weight: 600; color: var(--isa-color-warning); }
.product-card__stock--out { color: var(--isa-color-text-muted); }

/* Gambar tidak tersedia (edge state) */
.product-card__media.is-missing img { display: none; }
.product-card__media.is-missing::before {
  content: attr(data-missing-label); position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: .5rem;
  font-size: var(--isa-text-caption); letter-spacing: .1em; text-transform: uppercase; color: var(--isa-color-text-muted);
  background: var(--isa-color-surface-alt);
  padding-top: 3rem;
}

/* ---------- PRODUCT CARD: quick add (Product Button), kategori (Post Terms), stok (Stock Indicator) ---------- */
/* Desktop (hover): tombol muncul di atas gambar seperti prototype .product-card__quick; mobile: tombol bulat "+" kanan bawah gambar */
.wc-block-product .wc-block-components-product-button { position: absolute; z-index: 2; margin: 0; }
.wc-block-product .wc-block-components-product-button .wp-block-button__link, .wc-block-product .wc-block-components-product-button .wc-block-components-product-button__button { min-height: 2.6rem; padding: 0 .75rem; font-size: .7rem; letter-spacing: var(--isa-tracking-wide); }
@media (max-width: 1023px) {
  .wc-block-product .wc-block-components-product-button { right: .5rem; bottom: .5rem; }
  .wc-block-product .wc-block-components-product-button .wp-block-button__link, .wc-block-product .wc-block-components-product-button .wc-block-components-product-button__button { width: 2.25rem; height: 2.25rem; min-height: 0; padding: 0; border-radius: 50%; font-size: 0; background: var(--isa-color-primary); color: #fff; box-shadow: var(--isa-shadow-md); display: grid; place-items: center; }
  .wc-block-product .wc-block-components-product-button .wp-block-button__link::before, .wc-block-product .wc-block-components-product-button .wc-block-components-product-button__button::before { content: ""; width: 1.1rem; height: 1.1rem; background: currentColor; -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round'><path d='M12 5v14M5 12h14'/></svg>") center / contain no-repeat; mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round'><path d='M12 5v14M5 12h14'/></svg>") center / contain no-repeat; }
}
@media (min-width: 1024px) {
  .wc-block-product .wc-block-components-product-button { left: .6rem; right: .6rem; bottom: .6rem; transform: translateY(120%); opacity: 0; transition: transform var(--isa-motion-normal) var(--isa-ease), opacity var(--isa-motion-normal); }
  .wc-block-product:hover .wc-block-components-product-button, .wc-block-product:focus-within .wc-block-components-product-button { transform: none; opacity: 1; }
  .wc-block-product .wc-block-components-product-button .wp-block-button__link, .wc-block-product .wc-block-components-product-button .wc-block-components-product-button__button { width: 100%; background: color-mix(in srgb, var(--isa-color-background) 96%, transparent); color: var(--isa-color-primary); backdrop-filter: blur(6px); }
  .wc-block-product .wc-block-components-product-button .wp-block-button__link:hover, .wc-block-product .wc-block-components-product-button .wc-block-components-product-button__button:hover { background: var(--isa-color-primary); color: #fff; }
}
/* Product Button harus berada di dalam kotak gambar agar posisinya relatif terhadap media (lihat helper markup: tombol setelah Product Image, dibungkus .product-card__media-actions) */
.wc-block-product .product-card__media-wrap { position: relative; }
/* Kategori kecil (Post Terms product_cat) & stok (Stock Indicator) */
.wc-block-product .wp-block-post-terms.product-card__cat { font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--isa-color-text-muted); margin: 0; }
.wc-block-product .wp-block-post-terms.product-card__cat a { color: inherit; }
.wc-block-product .wp-block-post-terms.product-card__cat .wp-block-post-terms__separator { display: none; }
.wc-block-product .wp-block-post-terms.product-card__cat a:not(:first-child) { display: none; }
.wc-block-product .wc-block-components-product-stock-indicator { font-size: .7rem; font-weight: 600; color: var(--isa-color-warning); margin: 0; }
.wc-block-product .wc-block-components-product-stock-indicator--in-stock { display: none; }
.wc-block-product .wc-block-components-product-stock-indicator--out-of-stock { color: var(--isa-color-text-muted); }
.wc-block-product .wc-block-components-product-stock-indicator--low-stock { color: var(--isa-color-warning); }
/* Judul kartu = tautan (Post Title isLink) — area klik seluruh kartu via ::after (components.css) */


