/* =========================
   PRODUCTS LIST PAGE (SCOPED / NO-CONFLICT) - FINAL (FIXED)
   - Mobilde 2'li grid
   - Desktop/large grid bozulmaz
   ========================= */

/* Desktop / Genel hizalama */
/* =========================================
   PREMIUM CATEGORY PANEL (no sidebar)
   ========================================= */

.products-page {
    display: block !important;
}

    /* varsa eski sidebar kapansın */
    .products-page .cat-side {
        display: none !important;
    }

    /* panel */
    .products-page .cat-panel {
        border: 1px solid rgba(15,23,42,.10);
        background: linear-gradient(180deg,#ffffff,#f8fafc);
        border-radius: 14px;
        padding: 12px;
        box-shadow: 0 14px 34px rgba(15,23,42,.06);
        margin: 0 0 14px;
    }

    .products-page .cat-panel-top {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        margin-bottom: 10px;
    }

    .products-page .cat-panel-title {
        display: flex;
        align-items: center;
        gap: 10px;
        font-weight: 950;
        letter-spacing: -.02em;
        color: #0f172a;
    }

    .products-page .cat-icon {
        width: 34px;
        height: 34px;
        display: grid;
        place-items: center;
        border-radius: 10px;
        border: 1px solid rgba(15,23,42,.10);
        background: #fff;
        box-shadow: 0 8px 18px rgba(15,23,42,.06);
        font-size: 15px;
    }

    .products-page .cat-selected {
        margin-left: 10px;
        font-weight: 850;
        font-size: .88rem;
        color: rgba(15,23,42,.65);
        padding: 6px 10px;
        border-radius: 10px;
        border: 1px dashed rgba(15,23,42,.18);
        background: rgba(255,255,255,.75);
    }

    /* search */
    .products-page .cat-search {
        position: relative;
        min-width: 240px;
        flex: 0 0 auto;
    }

        .products-page .cat-search input {
            width: 100%;
            height: 40px;
            padding: 0 40px 0 12px;
            border-radius: 12px;
            border: 1px solid rgba(15,23,42,.12);
            background: #fff;
            outline: none;
            font-weight: 700;
        }

            .products-page .cat-search input:focus {
                border-color: rgba(37,99,235,.35);
                box-shadow: 0 0 0 4px rgba(37,99,235,.10);
            }

    .products-page .cat-search-ico {
        position: absolute;
        right: 10px;
        top: 50%;
        transform: translateY(-50%);
        opacity: .7;
        pointer-events: none;
    }

    /* tabs */
    .products-page .cat-tabs {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
    }

    /* tab style (yuvarlak değil, daha “efektif”) */
    .products-page .cat-tab {
        display: inline-flex;
        align-items: center;
        height: 38px;
        padding: 0 14px;
        border-radius: 10px;
        text-decoration: none;
        font-weight: 900;
        color: #0f172a;
        background: #fff;
        border: 1px solid rgba(15,23,42,.10);
        box-shadow: 0 10px 22px rgba(15,23,42,.04);
        transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease, background .12s ease;
        white-space: nowrap;
    }

        .products-page .cat-tab:hover {
            transform: translateY(-1px);
            border-color: rgba(37,99,235,.28);
            box-shadow: 0 16px 34px rgba(15,23,42,.08);
        }

        .products-page .cat-tab.active {
            background: linear-gradient(135deg,#0f172a,#1f2937);
            border-color: transparent;
            color: #fff;
            box-shadow: 0 18px 40px rgba(2,6,23,.18);
        }

/* MOBILE */
@media (max-width: 768px) {
    .products-page .cat-panel-top {
        flex-direction: column;
        align-items: stretch;
    }

    .products-page .cat-search {
        min-width: 0;
        width: 100%;
    }

    .products-page .cat-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 6px;
        scrollbar-width: none;
    }

        .products-page .cat-tabs::-webkit-scrollbar {
            display: none;
        }
}
/* =========================
   CATEGORY PANEL - COLLAPSE
   ========================= */

.cat-panel {
    width: 100%;
}

.cat-panel-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 900;
}

/* Toggle button */
.cat-toggle {
    width: 40px;
    height: 40px;
    display: inline-grid;
    place-items: center;
    border: 1px solid rgba(15,23,42,.12);
    background: #fff;
    color: #0f172a;
    border-radius: 12px;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

    .cat-toggle:hover {
        box-shadow: 0 12px 26px rgba(15,23,42,.08);
        transform: translateY(-1px);
    }

    .cat-toggle.is-active {
        background: #0f172a;
        color: #fff;
        border-color: transparent;
    }

/* Varsayılan: masaüstünde açık */
.cat-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Her ekranda kapatma */
.cat-panel.is-collapsed .cat-tabs {
    display: none !important;
}

/* Arama da kapansın istiyorsan (isteğe bağlı) */
.cat-panel.is-collapsed .cat-search {
    display: none !important;
}

/* Mobilde sadece görünüm/padding ufaltma gibi şeyler kalsın */
@media (max-width: 768px) {
    .cat-toggle {
        width: 38px;
        height: 38px;
        border-radius: 12px;
    }
}



    /* Right head */
    .products-page .products-main {
        min-width: 0;
    }

    .products-page .products-head {
        margin: 0 0 14px;
    }

    .products-page .products-title {
        margin: 0;
        font-weight: 950;
        letter-spacing: -.02em;
        font-size: 2rem;
    }

    .products-page .products-sub {
        margin: 6px 0 0;
        color: rgba(15,23,42,.65);
        font-weight: 600;
    }

    /* =========================
   GRID (DÜZELTİLDİ)
   ========================= */
    /* Desktop varsayılan: 4 kolon (net) */
    .products-page .product-grid {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 18px;
        align-items: stretch;
    }

    /* Card */
    .products-page .product-card {
        border-radius: 22px;
        overflow: hidden;
        background: #fff;
        border: 1px solid rgba(15,23,42,.10);
        box-shadow: 0 12px 34px rgba(15,23,42,.06);
        transition: transform .16s ease, box-shadow .16s ease;
    }

    .products-page .product-link {
        display: block;
        text-decoration: none;
        color: #0f172a;
    }

    .products-page .product-media {
        aspect-ratio: 4/3;
        background: #f3f4f6;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 16px;
    }

        .products-page .product-media img {
            width: 100%;
            height: 100%;
            object-fit: contain;
            display: block;
            transform: scale(1.03);
            transition: transform .35s ease;
        }

    .products-page .product-body {
        padding: 16px 16px 18px;
    }

    .products-page .product-title {
        font-weight: 950;
        margin: 0 0 6px;
        font-size: 1.08rem;
    }

    .products-page .product-desc {
        margin: 0;
        color: rgba(15,23,42,.70);
        font-size: .96rem;
        line-height: 1.35;
    }

    .products-page .glow-hover:hover {
        transform: translateY(-2px);
        box-shadow: 0 26px 70px rgba(37,99,235,.16), 0 0 0 1px rgba(37,99,235,.18);
    }

        .products-page .glow-hover:hover .product-media img {
            transform: scale(1.06);
        }

    /* Pagination (içerideyse) */
    .products-page .pagination {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: .5rem;
        margin: 1.25rem 0 .25rem;
        padding: .75rem 0;
        flex-wrap: wrap;
    }

    .products-page .page-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 42px;
        height: 38px;
        padding: 0 .9rem;
        border-radius: 999px;
        border: 1px solid rgba(15,23,42,.10);
        background: #fff;
        color: #0f172a;
        text-decoration: none;
        font-weight: 700;
        font-size: .92rem;
        transition: transform .15s ease, box-shadow .15s ease, background .15s ease, color .15s ease;
    }

        .products-page .page-btn:hover {
            transform: translateY(-1px);
            box-shadow: 0 12px 26px rgba(15,23,42,.08);
        }

        .products-page .page-btn.active {
            background: rgb(0 0 0 / 28%);
            color: #fff;
            border-color: transparent;
        }

        .products-page .page-btn.disabled {
            opacity: .45;
            pointer-events: none;
        }

/* GLOBAL Pagination fallback */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    margin: 18px 0 6px;
    padding: 10px 0;
    flex-wrap: wrap;
}

.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 38px;
    padding: 0 .9rem;
    border-radius: 999px;
    border: 1px solid rgba(15,23,42,.10);
    background: #fff;
    color: #0f172a;
    text-decoration: none;
    font-weight: 700;
    font-size: .92rem;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease, color .15s ease;
}

    .page-btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 12px 26px rgba(15,23,42,.08);
    }


    .page-btn.active {
        background: rgb(0 0 0 / 28%);
        color: black;
        border-color: transparent;
    }

    .page-btn.disabled {
        opacity: .45;
        pointer-events: none;
    }
/* canlı arama boş mesajı */
.products-empty-live {
    margin-top: 16px;
    padding: 14px 16px;
    border: 1px dashed rgba(15,23,42,.18);
    border-radius: 14px;
    background: rgba(15,23,42,.03);
    font-weight: 700;
    color: rgba(15,23,42,.75);
}

/* panel kapalıyken sadece üst bar kalsın */
.cat-panel.is-collapsed #catTabs {
    display: none;
}


/* ===== Büyük ekran: 4 kolon sabit kalsın (hata düzeltildi) ===== */
@media (min-width: 1400px) {
    .products-page .product-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* TABLET */
@media (max-width: 1100px) {
    .products-page .product-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 992px) {
    .products-page {
        grid-template-columns: 1fr;
        gap: 16px;
    }

        .products-page .cat-side {
            position: static;
            top: auto;
            width: 100%;
        }

        .products-page .cat-list {
            max-height: 260px;
        }
}

/* MOBILE (kategori + ürün hizası) */
@media (max-width: 768px) {
    .products-page {
        display: block;
        padding: 0;
    }

        .products-page .cat-side {
            width: 100%;
            margin: 0 0 12px;
        }

        .products-page .cat-card {
            width: 100%;
            padding: 12px;
            margin-left: 0;
            margin-right: 0;
            border-radius: 18px;
        }

        /* Kategori listesi: yatay scroll chip bar */
        .products-page .cat-list {
            display: flex !important;
            gap: 10px;
            overflow-x: auto;
            overflow-y: hidden;
            padding: 6px 4px 10px;
            max-height: none !important;
            scrollbar-width: none;
            -webkit-overflow-scrolling: touch;
        }

            .products-page .cat-list::-webkit-scrollbar {
                display: none;
            }

        .products-page .cat-item {
            flex: 0 0 auto;
            white-space: nowrap;
            min-width: max-content;
            border-radius: 999px;
            padding: 10px 14px;
            font-size: .9rem;
        }

        /* ? Ürünler: mobilde 2 kolon */
        .products-page .product-grid {
            grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
            gap: 12px !important;
        }

        .products-page .product-card {
            border-radius: 16px;
        }

        .products-page .product-media {
            aspect-ratio: 1/1; /* 2'li gridde daha iyi */
            padding: 10px;
        }

            .products-page .product-media img {
                max-height: 150px;
                object-fit: contain;
            }

        .products-page .product-body {
            padding: 10px 12px 12px;
        }

        .products-page .product-title {
            font-size: .98rem;
        }

        .products-page .product-desc {
            font-size: .88rem;
        }
}

/* Çok küçük telefonlar */
@media (max-width: 380px) {
    .products-page .cat-item {
        padding: 9px 12px;
        font-size: .86rem;
    }

    .products-page .product-grid {
        gap: 10px !important;
    }

    .products-page .product-media img {
        max-height: 130px;
    }
}
