/* ═══════════════════════════════════════════════════════════
   MOXABUILDER — PRODUCTS GRID (products_grid) modül stilleri
   Grid / Liste / Kompakt varyantlar + filtre & sıralama çubuğu.
   Hem builder canvas hem yayınlanan sayfada yüklenir.
   ═══════════════════════════════════════════════════════════ */

/* ── 📐 Varyant: Liste (yatay satır) ── */
.moxa-product-card-list {
    display: flex;
    flex-direction: row;
    align-items: stretch;
}
.moxa-product-card-list > a[data-pb-el="product_image"] {
    flex: 0 0 38%;
    aspect-ratio: 4 / 3;
    min-height: 100%;
}
.moxa-product-card-list > .p-5 {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* ── 📐 Varyant: Kompakt (yoğun kart) ── */
.moxa-product-card-compact {
    border-radius: 12px;
}
.moxa-product-card-compact > .p-5 {
    padding: 0.9rem 1rem;
}
.moxa-product-card-compact .moxa-grid-price {
    font-size: 1rem;
}
.moxa-product-card-compact h3[data-pb-el="product_title"] {
    font-size: 1rem;
    line-height: 1.3;
}

/* ── 🔍 Filtre & Sıralama çubuğu ── */
.moxa-product-filter-chip,
.moxa-grid-sort {
    border-radius: 9999px;
}
form .moxa-grid-sort {
    background-color: #fff;
}

/* ── 🎠 Swiper içinde kart yüksekliği eşitleme ── */
.pb-products-carousel .swiper-slide {
    height: auto;
}
.pb-products-carousel .swiper-slide > article {
    height: 100%;
}

/* ── 💫 Stagger animasyonu (Motion Engine dostu) ── */
[data-pb-el="product_card"] {
    will-change: transform, opacity;
}

/* ── 📱 Mobilde liste varyantı alt alta düşsün ── */
@media (max-width: 640px) {
    .moxa-product-card-list {
        flex-direction: column;
    }
    .moxa-product-card-list > a[data-pb-el="product_image"] {
        flex: none;
        width: 100%;
    }
}

/* ═══════════════════════════════════════════════════════════
   Renk Swatch (products_grid) — dairesel renk seçenekleri
   Tıklanan renk: cover/hover görsel + varyant adı + fiyat güncellenir.
   ═══════════════════════════════════════════════════════════ */

.moxa-color-swatches {
    margin-top: 0.75rem;
}
.moxa-color-swatch-head {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: #6b7280;
    margin-bottom: 0.4rem;
}
.moxa-color-swatch-label {
    font-weight: 600;
}
.moxa-color-swatch-value {
    color: #111827;
    font-weight: 500;
}
.moxa-color-swatch-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}
.moxa-color-swatch {
    width: 28px;
    height: 28px;
    border-radius: 9999px;
    padding: 0;
    border: 2px solid #ffffff;
    outline: 1px solid #d1d5db;
    background: var(--moxa-swatch-color, #cccccc);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, outline-color 0.15s ease;
    -webkit-appearance: none;
    appearance: none;
    position: relative;
}
.moxa-color-swatch:hover {
    transform: scale(1.12);
    outline-color: #9ca3af;
}
.moxa-color-swatch.is-active {
    outline: 2px solid var(--color-primary, #111827);
    outline-offset: 1px;
    box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.08);
    transform: scale(1.08);
}
.moxa-color-swatch:focus-visible {
    outline: 2px solid var(--color-primary, #111827);
    outline-offset: 2px;
}
.moxa-color-swatch[disabled],
.moxa-color-swatch.moxa-swatch-disabled {
    opacity: 0.35;
    cursor: not-allowed;
}
.moxa-color-swatch-dot {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 9999px;
    background: var(--moxa-swatch-color, #cccccc);
}

/* Varyant adı (renk seçildiğinde JS doldurur) */
.moxa-variant-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #111827;
    min-height: 1rem;
    margin-bottom: 0.35rem;
}
