/* ============================================================
   LUIBERA — Swatch (Renk/Kaplama Yuvarlağı)
   Listeleme kartı + ürün detay için ortak stiller.
   ============================================================ */

/* ============================================================
   1) LİSTELEME KARTI: nokta (sadece görsel, non-interactive)
   ============================================================ */
.lui-swatch-list {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    padding: 6px 0 2px;
    line-height: 1;
}

.lui-swatch {
    display: inline-block;
    border-radius: 50%;
    border: 1px solid;
    box-shadow:
        inset 0 1px 2px rgba(255,255,255,.55),
        inset 0 -1px 2px rgba(0,0,0,.18),
        0 1px 2px rgba(0,0,0,.08);
    transition: transform .18s ease, box-shadow .18s ease;
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
}

.lui-swatch--sm { width: 16px; height: 16px; }
.lui-swatch--md { width: 22px; height: 22px; }
.lui-swatch--lg { width: 28px; height: 28px; }

.lui-swatch:hover {
    transform: scale(1.18);
    z-index: 2;
    box-shadow:
        inset 0 1px 2px rgba(255,255,255,.65),
        inset 0 -1px 2px rgba(0,0,0,.22),
        0 2px 6px rgba(0,0,0,.18);
}

.lui-swatch.is-active {
    transform: scale(1.18);
    outline: 2px solid #1a1a1a;
    outline-offset: 2px;
}

.lui-swatch.is-disabled {
    opacity: .35;
    cursor: not-allowed;
    pointer-events: none;
}

/* "+N" sayacı */
.lui-swatch-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 18px;
    padding: 0 6px;
    margin-left: 2px;
    font-size: .68rem;
    font-weight: 600;
    color: #555;
    background: #f4f1eb;
    border: 1px solid #e0d8c8;
    border-radius: 999px;
    letter-spacing: .02em;
    font-family: 'Jost', sans-serif;
}

/* ============================================================
   2) ÜRÜN DETAY: tıklanabilir buton (radio gibi davranır)
   ============================================================ */
.lui-swatch-btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 8px 0 4px;
}

.lui-swatch-btn {
    position: relative;
    background: transparent;
    border: 0;
    padding: 4px;          /* halka için boşluk */
    cursor: pointer;
    line-height: 0;
    border-radius: 50%;
    transition: transform .18s ease;
    isolation: isolate;
}

.lui-swatch-btn-group .lui-swatch-btn { padding: 4px; }

.lui-swatch-btn::before {
    /* Seçim halkası (selected'da görünür) */
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid transparent;
    transition: border-color .2s ease;
    pointer-events: none;
}

.lui-swatch-btn.is-selected::before {
    border-color: #1a1a1a;
}

.lui-swatch-btn:hover {
    transform: scale(1.05);
}

.lui-swatch-btn.is-disabled {
    cursor: not-allowed;
    opacity: .45;
}

.lui-swatch-btn.is-disabled::after {
    /* Stoksuz: çapraz çizgi */
    content: '';
    position: absolute;
    top: 50%;
    left: 6%;
    width: 88%;
    height: 1.5px;
    background: rgba(26,26,26,.65);
    transform: rotate(-45deg);
    transform-origin: center;
    pointer-events: none;
}

.lui-swatch-btn .lui-swatch-dot {
    display: block;
    border-radius: 50%;
    border: 1px solid;
    box-shadow:
        inset 0 2px 3px rgba(255,255,255,.55),
        inset 0 -2px 3px rgba(0,0,0,.22),
        0 1px 3px rgba(0,0,0,.10);
}

.lui-swatch-btn--sm .lui-swatch-dot { width: 22px; height: 22px; }
.lui-swatch-btn--md .lui-swatch-dot { width: 32px; height: 32px; }
.lui-swatch-btn--lg .lui-swatch-dot { width: 40px; height: 40px; }

/* Tooltip */
.lui-swatch-tooltip {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: #1a1a1a;
    color: #fff;
    font-size: .72rem;
    font-weight: 500;
    padding: 4px 9px;
    border-radius: 4px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity .15s ease, transform .15s ease;
    z-index: 10;
    letter-spacing: .02em;
    font-family: 'Jost', sans-serif;
}
.lui-swatch-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: #1a1a1a;
}

.lui-swatch-btn:hover .lui-swatch-tooltip,
.lui-swatch-btn:focus-visible .lui-swatch-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Listeleme kartında da (nokta) tooltip için title attribute kullanılır (browser native) */

/* ============================================================
   3) DETAY SAYFASI — Renk satırı yerleşimi
   ============================================================ */
.pd-variant-swatch-row {
    margin: 10px 0 14px;
    font-family: 'Jost', sans-serif;
}
.pd-variant-swatch-row .pd-variant-label {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 8px;
    font-size: .82rem;
    color: #555;
    letter-spacing: .03em;
    text-transform: uppercase;
}
.pd-variant-swatch-row .pd-variant-selected-name {
    color: #1a1a1a;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    font-size: .92rem;
}

/* ============================================================
   4) Listeleme kartı içinde konumlanma
   Görselin altı + ürün adının üstü — ürün kartı yapısına göre
   biraz padding ile ürün adı bloğunun başında yer alır.
   ============================================================ */
.lui-product-info > .lui-swatch-list {
    margin-bottom: 4px;
}

/* ============================================================
   5) RENK SAYISI BADGE — Görselin alt-ortasında overlay pill
   Info bloğunun yüksekliği değişmez → tüm kartlar simetrik kalır.
   ============================================================ */
.lui-product-media { position: relative; }
.lui-color-count-badge {
    position: absolute;
    left: 50%;
    bottom: 10px;
    transform: translateX(-50%);
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 14px;
    background: rgba(255,255,255,0.92);
    color: #1a1a1a;
    font-size: .72rem;
    font-weight: 500;
    letter-spacing: .02em;
    border-radius: 999px;
    line-height: 1.2;
    white-space: nowrap;
    user-select: none;
    pointer-events: none;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    transition: background .2s ease, color .2s ease, transform .25s ease;
}
.lui-product-card:hover .lui-color-count-badge {
    background: #301934;
    color: #ffffff;
    transform: translateX(-50%) translateY(-2px);
}

/* Mobilde biraz daha kompakt */
@media (max-width: 575.98px) {
    .lui-swatch-list { gap: 5px; padding: 4px 0 0; }
    .lui-swatch--sm { width: 14px; height: 14px; }
    .lui-swatch-more { min-width: 22px; height: 16px; font-size: .62rem; padding: 0 5px; }
    .lui-swatch-btn--md .lui-swatch-dot { width: 28px; height: 28px; }
    .lui-swatch-btn--lg .lui-swatch-dot { width: 34px; height: 34px; }
    .lui-color-count-badge { font-size: .64rem; padding: 4px 10px; bottom: 8px; }
}
