/* ==========================================================================
   Storefront — category_slider (tek kaynak)
   - Varsayılan kategoriler :not(.sf-cat-pill-all) ile ayrılır → çift hover yok.
   - “Tüm ürünler” mor gölme; circle overflow:visible (shadow kesilmez).
   ========================================================================== */

.sf-cat-slider-wrap {
    position: relative;
    padding: 7px 60px 0;
    margin-top: 4px;
    margin-bottom: 0;
}

/*
 * Desktop: overflow-x hidden → partial items clipped at track boundary
 * Item widths are set with !important to override base .sf-cat-pill rules below.
 * Formula: (100% - (n-1)*gap) / n   [static values, no CSS variable subtraction]
 */

/* ≥1451px: 9 item, gap 10px → (100% - 80px) / 9 */
@media (min-width: 1451px) {
    .sf-cat-slider-track { overflow-x: hidden !important; }

    .sf-cat-pill, .sf-cat-pill-wrap {
        flex: 0 0 calc((100% - 80px) / 9) !important;
        min-width: calc((100% - 80px) / 9) !important;
        max-width: calc((100% - 80px) / 9) !important;
    }
}

/* 1201–1450px: 9 item, gap 6px → (100% - 48px) / 9 */
@media (min-width: 1201px) and (max-width: 1450px) {
    .sf-cat-slider-track {
        overflow-x: hidden !important;
        gap: 6px !important;
    }

    .sf-cat-pill, .sf-cat-pill-wrap {
        flex: 0 0 calc((100% - 48px) / 9) !important;
        min-width: calc((100% - 48px) / 9) !important;
        max-width: calc((100% - 48px) / 9) !important;
    }

    .sf-cat-pill-circle {
        width: 114px;
        height: 114px;
    }
}

/* 992–1200px: 8 item, gap 8px → (100% - 56px) / 8 */
@media (min-width: 992px) and (max-width: 1200px) {
    .sf-cat-slider-track {
        overflow-x: hidden !important;
        gap: 8px !important;
    }

    .sf-cat-pill, .sf-cat-pill-wrap {
        flex: 0 0 calc((100% - 56px) / 8) !important;
        min-width: calc((100% - 56px) / 8) !important;
        max-width: calc((100% - 56px) / 8) !important;
    }

    .sf-cat-pill-circle {
        width: 100px;
        height: 100px;
    }
}

.sf-cat-slider-wrap + .sf-section {
    margin-top: 10px;
}

.sf-cat-slider-track {
    display: flex;
    align-items: flex-start;
    gap: var(--sf-cat-gap);
    overflow-x: auto;
    scrollbar-width: none;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    padding-top: 17px;
    padding-bottom: 6px;
    padding-inline: max(10px,0);
    margin-top: -19px;
    justify-content: flex-start;
    scroll-padding-inline: 10px;
}

/* Desktop: ilk öğe olan "Tüm Ürünler" görünür kalsın. */
@media (min-width: 992px) {
    .sf-cat-slider-track {
        justify-content: flex-start;
    }
}

.sf-cat-slider-track::-webkit-scrollbar {
    display: none;
}

.sf-cat-pill {
    flex: 0 0 var(--sf-cat-item-width);
    min-width: var(--sf-cat-item-width);
    max-width: var(--sf-cat-item-width);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #1f2937;
}

.sf-cat-pill:hover,
.sf-cat-pill:focus {
    text-decoration: none;
    color: #111827;
}

.sf-cat-pill-circle {
    width: 120px;
    height: 120px;
    border-radius: 999px;
    overflow: hidden;
    border: 2px solid #e2e8f0;
    background: #f8fafc;
    box-shadow: 0 4px 10px rgb(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        transform 0.4s ease,
        box-shadow 0.18s ease,
        border-color 0.18s ease,
        filter 0.18s ease;
}

/* Varsayılan kategori ovali — tek hover / aktif kümesi (yumuşak) */
.sf-cat-pill:not(.sf-cat-pill-all):hover .sf-cat-pill-circle,
.sf-cat-pill:not(.sf-cat-pill-all).active .sf-cat-pill-circle,
.sf-cat-pill-wrap--open .sf-cat-pill:not(.sf-cat-pill-all) .sf-cat-pill-circle {
    transform: translateY(-2px) rotate(8deg);
    border-color: #4ade80;
    box-shadow:
        0 0 0 3px rgba(74, 222, 128, 0.12),
        0 0 16px rgba(74, 222, 128, 0.15),
        0 8px 14px rgba(22, 101, 52, 0.12);
    filter: brightness(1.02);
}

.sf-cat-pill-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sf-cat-pill-title {
    margin-top: 15px;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    line-height: 1.1;
    min-height: 15px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.sf-cat-title-mobile {
    display: none;
}

.sf-cat-title-desktop {
    display: inline-block;
    white-space: nowrap;
}

.sf-cat-pill-count {
    margin-top: 0;
    font-size: 11px;
    color: #64748b;
    text-align: center;
    white-space: nowrap;
}

.sf-cat-pill-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    background: linear-gradient(135deg, #0891b2, #2563eb);
}

.sf-cat-pill-all {
    position: relative;
    z-index: 2;
    color: #111827;
}

.sf-cat-pill-all:hover,
.sf-cat-pill-all:focus,
.sf-cat-pill-all.active {
    color: #111827;
}

.sf-cat-pill-all .sf-cat-pill-all-circle.sf-cat-pill-circle {
    overflow: hidden;
    background: linear-gradient(135deg, #166534 0%, #15803d 50%, #16a34a 100%);
    border-color: #166534;
    box-shadow: 0 4px 14px rgba(22, 101, 52, 0.25);
    transition: background 0.35s ease, transform 0.4s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.sf-cat-pill-all .sf-cat-pill-all-circle i {
    color: #fff;
    font-size: 1.6rem;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25));
    transition: color 0.25s ease;
}

.sf-cat-pill-all:hover .sf-cat-pill-all-circle,
.sf-cat-pill-all:focus .sf-cat-pill-all-circle,
.sf-cat-pill-all.active .sf-cat-pill-all-circle {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 50%, #bbf7d0 100%);
    border-color: #86efac;
    box-shadow:
        0 0 0 3px rgba(34, 197, 94, 0.12),
        0 0 18px rgba(34, 197, 94, 0.18),
        0 6px 14px rgba(22, 101, 52, 0.16);
    transform: translateY(-2px) rotate(8deg);
}

.sf-cat-pill-all:hover .sf-cat-pill-all-circle i,
.sf-cat-pill-all:focus .sf-cat-pill-all-circle i,
.sf-cat-pill-all.active .sf-cat-pill-all-circle i {
    color: #166534;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.10));
}

.sf-cat-pill-all:hover .sf-cat-pill-title,
.sf-cat-pill-all:focus .sf-cat-pill-title,
.sf-cat-pill-all.active .sf-cat-pill-title {
    color: #111827;
}

.sf-cat-pill-all:hover .sf-cat-pill-count,
.sf-cat-pill-all:focus .sf-cat-pill-count,
.sf-cat-pill-all.active .sf-cat-pill-count {
    color: #64748b;
}

.sf-cat-pill-wrap-all {
    position: relative;
    z-index: 2;
}

.sf-cat-pill-wrap {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 0 0 var(--sf-cat-item-width);
    min-width: var(--sf-cat-item-width);
    max-width: var(--sf-cat-item-width);
}

.sf-cat-pill-wrap .sf-cat-pill {
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
    width: 100%;
}

.sf-cat-sub-list {
    display: none;
}

.sf-cat-sub-floating {
    position: fixed;
    padding: 8px;
    background: #fff;
    border-radius: 12px;
    box-shadow:
        0 4px 6px rgb(15, 23, 42, 0.04),
        0 12px 28px rgb(15, 23, 42, 0.12),
        0 0 0 1px rgb(15, 23, 42, 0.06);
    border: 1px solid #e2e8f0;
    min-width: 200px;
    max-width: min(320px, calc(100vw - 20px));
    z-index: 200000;
    pointer-events: auto;
    box-sizing: border-box;
}

.sf-cat-sub-floating-scroll {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: min(70vh, 360px);
    overflow: hidden auto;
    -webkit-overflow-scrolling: touch;
}

.sf-cat-sub-floating::before {
    content: '';
    position: absolute;
    left: 50%;
    width: 11px;
    height: 11px;
    margin-left: -5.5px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-bottom: none;
    border-right: none;
    transform: rotate(45deg);
    top: -6px;
    z-index: 0;
    pointer-events: none;
}

.sf-cat-sub-floating--above::before {
    top: auto;
    bottom: -6px;
    border: 1px solid #e2e8f0;
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
}

@media (prefers-reduced-motion: no-preference) {
    .sf-cat-sub-floating {
        animation: sf-cat-sub-in 0.16s ease-out;
    }
}

@keyframes sf-cat-sub-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.sf-cat-sub-item {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    text-decoration: none;
    padding: 9px 12px;
    border-radius: 8px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: flex-start !important;
    text-align: left !important;
    line-height: 1.25;
    transition: background 0.12s ease, color 0.12s ease;
}

.sf-cat-sub-item:hover,
.sf-cat-sub-item:focus,
.sf-cat-sub-item.active {
    background: #f1f5f9;
    color: #0f172a;
}

.sf-cat-sub-floating {
    border-radius: 8px;
    overflow: hidden;
}

.sf-cat-sub-floating::before,
.sf-cat-sub-floating--above::before {
    display: none;
}

.sf-cat-sub-floating-header {
    padding: 11px 16px;
    border-top: 0;
    border-bottom: 1px solid #111827;
    color: #111827;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    line-height: 1.2;
}

.sf-cat-sub-floating-scroll .sf-cat-sub-item {
    gap: 8px;
}

.sf-cat-sub-floating-scroll .sf-cat-sub-item::before {
    content: '';
    flex: 0 0 6px;
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: #111827;
}

.sf-cat-mobile-sub-panel {
    display: none;
}

.sf-cat-arrow {
    position: absolute;
    top: 40%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 1px solid #dbe5ef;
    background: #fff;
    color: #1f2937;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 8px rgb(0, 0, 0, 0.12);
    cursor: pointer;
    z-index: 2;
}

.sf-cat-arrow:hover {
    background: #0ea5e9;
    color: #fff;
    border-color: #0ea5e9;
}

.sf-cat-arrow.left {
    left: 0;
}

.sf-cat-arrow.right {
    right: 0;
}

@media (max-width: 991.98px) {
    .sf-cat-slider-wrap {
        padding: 12px 10px 16px !important;
        margin-top: 8px !important;
        margin-bottom: 18px !important;
    }

    .sf-cat-slider-track {
        gap: 14px !important;
        padding: 10px 4px 8px !important;
        margin-top: 0 !important;
        scroll-padding-inline: 10px;
    }

    .sf-cat-sub-floating {
        min-width: min(280px, calc(100vw - 24px)) !important;
        max-width: calc(100vw - 24px) !important;
        border-radius: 10px !important;
        padding: 8px !important;
    }

    .sf-cat-sub-floating-scroll .sf-cat-sub-item {
        font-size: 14px !important;
        min-height: 44px !important;
        padding: 11px 13px !important;
    }

    .sf-cat-mobile-sub-panel {
        display: block;
        position: relative;
        z-index: 2147483000;
        margin: 8px 4px 2px;
        padding: 10px;
        border: 1px solid #dbeafe;
        border-radius: 12px;
        background: #fff;
        box-shadow: 0 10px 24px rgb(15, 23, 42, 0.1);
    }

    .sf-cat-mobile-sub-panel[hidden] {
        display: none !important;
    }

    .sf-cat-mobile-sub-title {
        margin: 0 0 8px;
        color: #0f172a;
        font-size: 13px;
        font-weight: 900;
    }

    .sf-cat-mobile-sub-scroll {
        display: flex;
        flex-direction: column;
        gap: 4px;
        overflow: visible;
        padding-bottom: 0;
        scrollbar-width: none;
    }

    .sf-cat-mobile-sub-scroll::-webkit-scrollbar {
        display: none;
    }

    .sf-cat-mobile-sub-scroll .sf-cat-sub-item {
        width: 100%;
        min-height: 42px !important;
        padding: 10px 12px !important;
        border-radius: 8px;
        background: #fff;
        color: #334155;
        border: 0;
        font-size: 13px !important;
        font-weight: 700;
        white-space: normal;
        justify-content: flex-start;
    }

    .sf-cat-mobile-sub-scroll .sf-cat-sub-item:hover,
    .sf-cat-mobile-sub-scroll .sf-cat-sub-item:focus,
    .sf-cat-mobile-sub-scroll .sf-cat-sub-item.active {
        background: #f1f5f9;
        color: #0f172a;
    }

    .sf-cat-pill {
        touch-action: manipulation;
    }

    .sf-cat-pill,
    .sf-cat-pill-wrap {
        flex: 0 0 82px !important;
        min-width: 82px !important;
        max-width: 82px !important;
    }

    .sf-cat-pill-circle {
        width: 62px !important;
        height: 62px !important;
        max-width: 62px !important;
    }

    .sf-cat-pill-title {
        margin-top: 6px !important;
        min-height: 28px !important;
        font-size: 11px !important;
        line-height: 1.12 !important;
        overflow-wrap: anywhere;
    }

    .sf-cat-title-desktop {
        display: none;
    }

    .sf-cat-title-mobile {
        display: inline;
    }

    .sf-cat-pill-count {
        display: none !important;
    }

    .sf-cat-arrow {
        display: none !important;
    }

    .sf-cat-slider-wrap + .sf-section {
        margin-top: 8px !important;
    }
}

/* Desktop: ilk görünümde kırpılmış 10. kategori yerine tam 9 kategori göster. */
@media (min-width: 1451px) {
    .sf-global-cat-slider .sf-cat-slider-track {
        overflow-x: hidden !important;
        gap: 10px !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        scroll-padding-inline: 0 !important;
    }

    .sf-global-cat-slider .sf-cat-pill,
    .sf-global-cat-slider .sf-cat-pill-wrap {
        flex: 0 0 calc((100% - 80px) / 9) !important;
        min-width: calc((100% - 80px) / 9) !important;
        max-width: calc((100% - 80px) / 9) !important;
    }
}

@media (min-width: 1201px) and (max-width: 1450px) {
    .sf-global-cat-slider .sf-cat-slider-track {
        overflow-x: hidden !important;
        gap: 6px !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        scroll-padding-inline: 0 !important;
    }

    .sf-global-cat-slider .sf-cat-pill,
    .sf-global-cat-slider .sf-cat-pill-wrap {
        flex: 0 0 calc((100% - 48px) / 9) !important;
        min-width: calc((100% - 48px) / 9) !important;
        max-width: calc((100% - 48px) / 9) !important;
    }
}
