/* Mermak catalog filter frontend static CSS. Dynamic dimensions stay inline in filters.php. */
/* v1.5.0: Panel geç görünmez. İlk paint sırasında yerini ayırır; JS sadece class düzenler. */
.mm-af-panel{
    display:block!important;
}
@media (min-width: 922px){
    body:not(.mm-af-layout-ready) #primary:has(#mm-af-panel){
        position:relative!important;
        padding-left:calc(var(--mm-af-width) + 24px)!important;
    }
    body:not(.mm-af-layout-ready) #primary > .mm-af-panel{
        position:absolute!important;
        left:0!important;
        top:0!important;
        width:var(--mm-af-width)!important;
        max-width:var(--mm-af-width)!important;
        margin:0!important;
    }
}
body.tax-product_cat #secondary,
body.post-type-archive-product #secondary{
    display:none!important;
}
/* Sadece ürün arşivi içerik sarmalayıcısını flex yap. Header/menu .ast-container etkilenmez. */
.mm-af-archive-wrap{
    display:flex!important;
    align-items:flex-start!important;
    gap:24px!important;
    max-width:1420px!important;
    margin-left:auto!important;
    margin-right:auto!important;
}
.mm-af-archive-wrap > #primary{
    order:2!important;
    flex:1 1 auto!important;
    width:auto!important;
    max-width:none!important;
    float:none!important;
    padding-left:0!important;
    padding-right:0!important;
}
/* Filtre paneli sayfa ile birlikte aksın; sticky/fixed değil. */
.mm-af-archive-wrap > .mm-af-panel{
    order:1;
    flex:0 0 var(--mm-af-width);
    width:var(--mm-af-width);
    max-width:var(--mm-af-width);
    margin:0;
    padding:0;
    position:relative;
    top:auto;
    align-self:flex-start;
    z-index:12;
    opacity:1;
    transform:none;
}
.mm-af-inner{
    background:#fff;
    border:1px solid #e5e7eb;
    border-radius:12px;
    box-shadow:0 8px 24px rgba(15,23,42,.06);
    padding:12px;
}
.mm-af-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:8px;
    font-size:16px;
    font-weight:900;
    color:#0f172a;
    margin-bottom:10px;
}
.mm-af-clear{
    background:#fee2e2;
    color:#991b1b!important;
    border-radius:999px;
    padding:5px 9px;
    text-decoration:none!important;
    font-size:11px;
    font-weight:900;
}
.mm-af-chips{
    display:flex;
    flex-wrap:wrap;
    gap:6px;
    margin-bottom:9px;
}
.mm-af-chip{
    display:inline-flex;
    align-items:center;
    border-radius:999px;
    background:#eff6ff;
    border:1px solid #bfdbfe;
    color:#1d4ed8!important;
    padding:5px 8px;
    font-size:11px;
    font-weight:800;
    text-decoration:none!important;
}
.mm-af-group{
    border-top:1px solid #eef2f7;
    padding:9px 0;
}
.mm-af-group:first-of-type{
    border-top:0;
}
.mm-af-group summary{
    list-style:none;
    cursor:pointer;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:8px;
    font-size:13px;
    font-weight:900;
    color:#0f172a;
}
.mm-af-group summary::-webkit-details-marker{display:none;}
.mm-af-group summary:after{
    content:'›';
    transform:rotate(90deg);
    color:#f97316;
    font-size:17px;
    line-height:1;
}
.mm-af-group:not([open]) summary:after{
    transform:rotate(0deg);
}
.mm-af-group summary em{
    font-style:normal;
    color:#64748b;
    font-size:11px;
    margin-left:auto;
    margin-right:5px;
}
.mm-af-options{
    margin-top:8px;
    max-height:var(--mm-af-list-max);
    overflow-y:auto;
    display:flex;
    flex-direction:column;
    gap:5px;
    padding-right:2px;
}
.mm-af-options::-webkit-scrollbar{width:6px;}
.mm-af-options::-webkit-scrollbar-thumb{background:#fdba74;border-radius:999px;}
.mm-af-option{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:8px;
    min-height:34px;
    background:#f8fafc;
    border:1px solid #e2e8f0;
    border-radius:8px;
    color:#334155!important;
    text-decoration:none!important;
    padding:7px 8px;
    font-size:12px;
    line-height:1.25;
    transition:.15s ease;
}
.mm-af-option:hover{
    border-color:#f97316;
    background:#fff7ed;
    color:#c2410c!important;
}
.mm-af-option.is-active{
    background:#f97316;
    color:#fff!important;
    border-color:#ea580c;
    font-weight:900;
}
.mm-af-option-name{
    min-width:0;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}
.mm-af-count{
    flex:0 0 auto;
    min-width:26px;
    height:20px;
    padding:0 7px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    border-radius:999px;
    background:#e5e7eb;
    color:#475569;
    border:1px solid #cbd5e1;
    font-size:11px;
    line-height:1;
    font-weight:900;
    font-variant-numeric:tabular-nums;
}
.mm-af-option:hover .mm-af-count{
    background:#ffedd5;
    border-color:#fed7aa;
    color:#9a3412;
}
.mm-af-option.is-active .mm-af-count{
    background:rgba(255,255,255,.22);
    border-color:rgba(255,255,255,.42);
    color:#fff;
}

.mm-af-admin-category-maker{
    border:1px dashed #fb923c;
    background:#fff7ed;
    border-radius:9px;
    padding:6px 8px;
}
.mm-af-admin-category-maker summary{
    cursor:pointer;
    color:#9a3412;
    font-size:12px;
    font-weight:900;
}
.mm-af-admin-category-maker form{
    margin-top:8px;
    display:grid;
    gap:6px;
}
.mm-af-admin-category-maker label{
    font-size:11px;
    font-weight:900;
    color:#334155;
}
.mm-af-admin-category-maker input[type='text'],
.mm-af-admin-category-maker textarea{
    width:100%;
    border:1px solid #fdba74;
    border-radius:7px;
    padding:7px;
    font-size:12px;
    background:#fff;
}
.mm-af-admin-category-maker textarea{
    min-height:54px;
}
.mm-af-admin-category-maker .mm-af-check{
    display:flex;
    align-items:center;
    gap:6px;
    font-weight:700;
}
.mm-af-cat-preview{
    background:#fff;
    border:1px solid #fed7aa;
    border-radius:8px;
    padding:7px;
    font-size:11px;
    color:#475569;
    line-height:1.45;
    overflow-wrap:anywhere;
}
.mm-af-admin-category-maker button{
    border:0;
    background:#16a34a;
    color:#fff;
    border-radius:7px;
    padding:8px 10px;
    font-size:12px;
    font-weight:900;
    cursor:pointer;
}

.mm-af-cat-result{
    background:#ecfdf5;
    border:1px solid #86efac;
    color:#166534;
    border-radius:8px;
    padding:8px 10px;
    font-size:12px;
    font-weight:700;
    margin:0 0 8px;
}
.mm-af-admin-series-maker{
    background:#f8fafc;
    border-color:#94a3b8;
}
.mm-af-series-head{
    display:flex;
    flex-direction:column;
    gap:2px;
    background:#fff;
    border:1px solid #e2e8f0;
    border-radius:8px;
    padding:8px;
    font-size:12px;
}
.mm-af-series-head small{
    color:#64748b;
    font-weight:600;
}
.mm-af-series-scroll{
    max-height:330px;
    overflow:auto;
    background:#fff;
    border:1px solid #e2e8f0;
    border-radius:8px;
}
.mm-af-series-table{
    width:100%;
    border-collapse:collapse;
    font-size:11px;
}
.mm-af-series-table th,
.mm-af-series-table td{
    padding:7px 8px;
    border-bottom:1px solid #f1f5f9;
    text-align:left;
    vertical-align:top;
}
.mm-af-series-table th{
    position:sticky;
    top:0;
    background:#f8fafc;
    z-index:1;
    font-weight:900;
    color:#334155;
}
.mm-af-series-table tr.is-existing{
    opacity:.62;
    background:#f8fafc;
}
.mm-af-series-table tr.is-active-filter{
    outline:2px solid #fed7aa;
    outline-offset:-2px;
}
.mm-af-series-table code{
    font-size:10px;
    color:#475569;
    word-break:break-all;
}
.mm-af-badge-ok,
.mm-af-badge-warn{
    display:inline-flex;
    border-radius:999px;
    padding:2px 7px;
    font-size:10px;
    font-weight:900;
}
.mm-af-badge-ok{background:#dcfce7;color:#166534;}
.mm-af-badge-warn{background:#fee2e2;color:#991b1b;}

.mm-af-admin-tools{
    border:1px dashed #fdba74;
    background:#fff7ed;
    border-radius:10px;
    padding:8px;
    margin:0 0 10px 0;
    display:flex;
    flex-direction:column;
    gap:7px;
}
.mm-af-admin-export{
    display:flex;
    align-items:center;
    justify-content:center;
    min-height:32px;
    background:#0f172a;
    color:#fff!important;
    text-decoration:none!important;
    border-radius:8px;
    font-size:12px;
    font-weight:900;
}
.mm-af-admin-import summary{
    cursor:pointer;
    font-size:12px;
    font-weight:900;
    color:#9a3412;
}
.mm-af-admin-import form{
    display:flex;
    flex-direction:column;
    gap:6px;
    margin-top:7px;
}
.mm-af-admin-import input[type=file]{
    font-size:11px;
    max-width:100%;
}
.mm-af-admin-import button{
    border:0;
    border-radius:8px;
    background:#f97316;
    color:#fff;
    min-height:30px;
    font-weight:900;
}
.mm-af-admin-import small{
    color:#64748b;
    line-height:1.35;
}

.mm-af-empty{
    background:#fff7ed;
    border:1px solid #fdba74;
    color:#9a3412;
    border-radius:10px;
    padding:10px;
    font-size:12px;
    font-weight:700;
}
.mm-af-sort-select-wrap select{
    width:100%;
    min-height:36px;
    border:1px solid #e2e8f0;
    border-radius:8px;
    font-size:12px;
}
.mm-af-mobile-bar{
    display:none;
}
/* Tek sıralama sistemi: WooCommerce'in eski orderby alanını gizle. Sıralama panel içinden yönetilir. */
body.mm-af-layout-ready.tax-product_cat .woocommerce-ordering,
body.mm-af-layout-ready.post-type-archive-product .woocommerce-ordering,
body.mm-af-layout-ready.woocommerce-shop .woocommerce-ordering{
    display:none!important;
}

.mm-af-drawer{
    display:none;
}
.mm-af-mini-status{
    display:none;
    position:fixed;
    right:18px;
    bottom:18px;
    z-index:999998;
    background:#0f172a;
    color:#fff;
    border-radius:999px;
    padding:9px 13px;
    font-size:12px;
    font-weight:900;
    box-shadow:0 12px 30px rgba(15,23,42,.20);
}
.mm-af-loading .mm-af-mini-status{
    display:block;
}
.mm-af-loading ul.products{
    opacity:.42;
    pointer-events:none;
    transition:opacity .12s ease;
}
.mm-af-loading .mm-af-panel,
.mm-af-loading #mm-af-drawer .mm-af-inner{
    pointer-events:none;
}
.mm-af-loading .mm-af-option{
    opacity:.72;
}
.mm-af-loading ul.products li.product{
    position:relative;
    overflow:hidden;
}
.mm-af-loading ul.products li.product:after{
    content:'';
    position:absolute;
    inset:0;
    background:linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,.62), rgba(255,255,255,0));
    transform:translateX(-100%);
    animation:mmAfShimmer .72s infinite;
}
@keyframes mmAfShimmer{
    to{transform:translateX(100%);}
}
.mm-af-sort-list{
    display:flex;
    flex-direction:column;
    gap:8px;
    padding:12px;
}
.mm-af-sort-item{
    border:1px solid #e5e7eb;
    background:#fff;
    color:#0f172a!important;
    border-radius:10px;
    padding:12px;
    text-decoration:none!important;
    font-weight:800;
}
.mm-af-sort-item.is-active{
    border-color:#f97316;
    background:#fff7ed;
    color:#c2410c!important;
}
@media (max-width: 921px){
    .mm-af-archive-wrap{
        display:block!important;
        max-width:none!important;
    }
    /* Mobilde masaüstü paneli kesinlikle görünmez.
       body.mm-af-layout-ready daha yüksek specificity ile paneli tekrar açıyordu. */
    .mm-af-panel,
    body.mm-af-layout-ready #mm-af-panel,
    body.mm-af-layout-ready .mm-af-archive-wrap > .mm-af-panel{
        display:none!important;
        visibility:hidden!important;
        opacity:0!important;
        height:0!important;
        max-height:0!important;
        overflow:hidden!important;
        margin:0!important;
        padding:0!important;
    }
    .mm-af-mobile-bar{
        display:grid;
        grid-template-columns:1fr 1fr;
        gap:10px;
        margin:0 0 14px 0;
    }
    .mm-af-open,
    .mm-af-sort-open{
        width:100%;
        min-height:42px;
        border:1px solid #f97316;
        background:#fff;
        color:#f97316;
        border-radius:8px;
        font-weight:900;
        display:flex;
        justify-content:space-between;
        align-items:center;
        padding:0 12px;
    }
    .mm-af-sort-open{
        border-color:#334155;
        color:#0f172a;
    }
    .mm-af-drawer{
        position:fixed;
        inset:0;
        display:none;
        z-index:999999;
    }
    .mm-af-drawer.is-open{
        display:block;
    }
    .mm-af-drawer-bg{
        position:absolute;
        inset:0;
        background:rgba(15,23,42,.48);
    }
    .mm-af-drawer-box{
        position:absolute;
        left:0;
        top:0;
        bottom:0;
        width:min(88vw,360px);
        background:#fff;
        overflow:auto;
        box-shadow:20px 0 45px rgba(0,0,0,.20);
        animation:mmAfSlide .18s ease-out;
    }
    .mm-af-sort-box{
        left:auto;
        right:0;
    }
    @keyframes mmAfSlide{from{transform:translateX(-100%)}to{transform:translateX(0)}}
    .mm-af-drawer-head{
        position:sticky;
        top:0;
        z-index:2;
        display:flex;
        align-items:center;
        justify-content:space-between;
        background:#fff;
        border-bottom:1px solid #e5e7eb;
        padding:14px;
        font-size:17px;
        font-weight:900;
    }
    .mm-af-drawer-head button{
        width:34px;
        height:34px;
        border:0;
        border-radius:50%;
        background:#f1f5f9;
        font-size:24px;
        line-height:1;
    }
    .mm-af-drawer .mm-af-inner{
        box-shadow:none;
        border:0;
        border-radius:0;
        padding:12px;
    }
    .mm-af-options{
        max-height:310px;
    }
    .mm-af-mobile-apply{
        position:sticky;
        bottom:0;
        width:100%;
        min-height:46px;
        border:0;
        border-radius:10px;
        background:#f97316;
        color:#fff;
        font-weight:900;
        margin-top:10px;
    }
}

/* v1.6.5: Masaüstü/mobil ortak filtre barı. Ürün alanını daraltan sol panel artık ilk yükte yok. */
.mm-af-topbar,
.mm-af-mobile-bar{
    display:grid!important;
    grid-template-columns:minmax(150px,220px) minmax(150px,220px);
    gap:10px;
    align-items:center;
    margin:0 0 14px 0;
    max-width:480px;
}
.mm-af-open,
.mm-af-sort-open{
    width:100%;
    min-height:46px;
    border:1px solid #f97316;
    background:#fff;
    color:#f97316;
    border-radius:10px;
    font-weight:900;
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:0 14px;
    line-height:1;
}
.mm-af-sort-open{
    border-color:#334155;
    color:#0f172a;
}
.mm-af-drawer{
    position:fixed;
    inset:0;
    display:none;
    z-index:999999;
}
.mm-af-drawer.is-open{
    display:block;
}
.mm-af-drawer-bg{
    position:absolute;
    inset:0;
    background:rgba(15,23,42,.48);
}
.mm-af-drawer-box{
    position:absolute;
    left:0;
    top:0;
    bottom:0;
    width:min(92vw,420px);
    background:#fff;
    overflow:auto;
    box-shadow:20px 0 45px rgba(0,0,0,.20);
    animation:mmAfSlide .18s ease-out;
}
.mm-af-sort-box{
    left:auto;
    right:0;
}
@keyframes mmAfSlide{from{transform:translateX(-100%)}to{transform:translateX(0)}}
.mm-af-drawer-head{
    position:sticky;
    top:0;
    z-index:2;
    display:flex;
    align-items:center;
    justify-content:space-between;
    background:#fff;
    border-bottom:1px solid #e5e7eb;
    padding:14px;
    font-size:17px;
    font-weight:900;
}
.mm-af-drawer-head button{
    width:34px;
    height:34px;
    border:0;
    border-radius:50%;
    background:#f1f5f9;
    font-size:24px;
    line-height:1;
}
.mm-af-drawer .mm-af-inner{
    box-shadow:none;
    border:0;
    border-radius:0;
    padding:12px;
}
.mm-af-lazy-loading{
    padding:16px;
    font-size:13px;
    font-weight:800;
    color:#64748b;
}

@media (min-width: 922px){
    /*
     * v1.6.9 masaüstü düzeltme:
     * v1.6.8'de panel normal akış/float gibi yer kapladığı için ürünler aşağı düşebiliyordu.
     * Bu sürümde panel sayfanın içinde, kendi gerçek sol konumunda görünür; fakat absolute olduğu için
     * dikey yükseklik ayırıp ürünleri alta itmez. Ürün alanı sadece soldan güvenli boşluk alır.
     */
    body.tax-product_cat #primary,
    body.post-type-archive-product #primary,
    body.woocommerce-shop #primary,
    body.tax-product_cat .site-main,
    body.post-type-archive-product .site-main,
    body.woocommerce-shop .site-main{
        position:relative;
    }
    html.mm-af-desktop-panel-open #mm-af-drawer{
        display:block!important;
        position:absolute!important;
        inset:auto!important;
        left:0!important;
        top:auto!important;
        width:var(--mm-af-drawer-width)!important;
        max-width:var(--mm-af-drawer-width)!important;
        height:auto!important;
        margin:0!important;
        padding:0!important;
        z-index:20;
        pointer-events:auto;
    }
    html.mm-af-desktop-panel-open #mm-af-drawer .mm-af-drawer-bg{
        display:none!important;
    }
    html.mm-af-desktop-panel-open #mm-af-drawer .mm-af-drawer-box{
        position:relative!important;
        left:auto!important;
        right:auto!important;
        top:auto!important;
        bottom:auto!important;
        width:100%!important;
        max-width:100%!important;
        max-height:calc(100vh - 170px);
        background:#fff;
        border:1px solid #e5e7eb;
        border-radius:14px;
        box-shadow:0 10px 28px rgba(15,23,42,.10);
        overflow:auto;
        transform:none!important;
        animation:none!important;
    }
    html.mm-af-desktop-panel-open #mm-af-drawer .mm-af-drawer-head{
        padding:12px;
    }
    html.mm-af-desktop-panel-open #mm-af-drawer .mm-af-inner{
        padding:10px;
    }

    /* Panel açıkken ürün/sonuç alanı panelin arkasına girmesin; yer baştan belli olsun. */
    html.mm-af-desktop-panel-open body.tax-product_cat .woocommerce-result-count,
    html.mm-af-desktop-panel-open body.post-type-archive-product .woocommerce-result-count,
    html.mm-af-desktop-panel-open body.woocommerce-shop .woocommerce-result-count,
    html.mm-af-desktop-panel-open body.tax-product_cat ul.products,
    html.mm-af-desktop-panel-open body.post-type-archive-product ul.products,
    html.mm-af-desktop-panel-open body.woocommerce-shop ul.products,
    html.mm-af-desktop-panel-open body.tax-product_cat nav.woocommerce-pagination,
    html.mm-af-desktop-panel-open body.post-type-archive-product nav.woocommerce-pagination,
    html.mm-af-desktop-panel-open body.woocommerce-shop nav.woocommerce-pagination,
    html.mm-af-desktop-panel-open body.tax-product_cat .woocommerce-info,
    html.mm-af-desktop-panel-open body.post-type-archive-product .woocommerce-info,
    html.mm-af-desktop-panel-open body.woocommerce-shop .woocommerce-info{
        margin-left:calc(var(--mm-af-drawer-width) + 18px)!important;
        width:auto!important;
    }

    /* Panel açık/kapalı buton durumu. */
    html.mm-af-desktop-panel-open .mm-af-open{
        background:#f97316;
        color:#fff;
        border-color:#ea580c;
    }
    html.mm-af-desktop-panel-open .mm-af-open span{
        transform:rotate(180deg);
    }

    /* Sıralama drawer'ı ayrı overlay kalır; filtre panel akış içindedir. */
    #mm-af-sort-drawer.is-open{
        position:fixed!important;
        inset:0!important;
    }

    /*
     * v1.6.10 akıllı sol boşluk modu:
     * JS yalnızca gerçekten yeterli sol boşluk varsa html'e mm-af-gutter-panel class'ı verir.
     * Bu durumda filtre paneli ürün grid'ini daraltmaz; içerik alanının sol boşluğunda durur.
     * Sol boşluk yetmezse v1.6.9 güvenli davranışı korunur.
     */
    html.mm-af-desktop-panel-open.mm-af-gutter-panel #mm-af-drawer{
        left:calc((var(--mm-af-drawer-width) + 18px) * -1)!important;
    }
    html.mm-af-desktop-panel-open.mm-af-gutter-panel body.tax-product_cat .woocommerce-result-count,
    html.mm-af-desktop-panel-open.mm-af-gutter-panel body.post-type-archive-product .woocommerce-result-count,
    html.mm-af-desktop-panel-open.mm-af-gutter-panel body.woocommerce-shop .woocommerce-result-count,
    html.mm-af-desktop-panel-open.mm-af-gutter-panel body.tax-product_cat ul.products,
    html.mm-af-desktop-panel-open.mm-af-gutter-panel body.post-type-archive-product ul.products,
    html.mm-af-desktop-panel-open.mm-af-gutter-panel body.woocommerce-shop ul.products,
    html.mm-af-desktop-panel-open.mm-af-gutter-panel body.tax-product_cat nav.woocommerce-pagination,
    html.mm-af-desktop-panel-open.mm-af-gutter-panel body.post-type-archive-product nav.woocommerce-pagination,
    html.mm-af-desktop-panel-open.mm-af-gutter-panel body.woocommerce-shop nav.woocommerce-pagination,
    html.mm-af-desktop-panel-open.mm-af-gutter-panel body.tax-product_cat .woocommerce-info,
    html.mm-af-desktop-panel-open.mm-af-gutter-panel body.post-type-archive-product .woocommerce-info,
    html.mm-af-desktop-panel-open.mm-af-gutter-panel body.woocommerce-shop .woocommerce-info{
        margin-left:0!important;
    }
}

@media (max-width: 921px){
    .mm-af-topbar,
    .mm-af-mobile-bar{
        grid-template-columns:1fr 1fr;
        max-width:none;
    }
    .mm-af-drawer-box{
        width:min(88vw,360px);
    }
}
