/* --- GENEL DÜZEN VE SCROLLBAR SABİTLEME --- */
html {
    overflow-y: scroll;
}

/* --- SAYFA YERLEŞİMİ (FLEX LAYOUT) --- */
.products-page-container {
    max-width: 1350px;
    margin: 0 auto;
    padding: 70px 20px 60px 20px;
    display: flex;
    align-items: flex-start;
    gap: 30px;
}

/* --- SOL KATEGORİ MENÜSÜ (KESİN SABİT - FIXED & İÇTEN KAYDIRILABİLİR & SCROLLBAR GİZLİ) --- */
.filter-drawer {
    width: 280px !important;
    min-width: 280px !important;
    max-width: 280px !important;
    flex-shrink: 0 !important;
    position: fixed !important;
    top: 100px !important;
    left: max(20px, calc((100% - 1350px) / 2 + 20px));
    background: transparent;
    box-shadow: none;
    height: calc(100vh - 100px);
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    z-index: 100;

    scrollbar-width: none;
}

.filter-drawer::-webkit-scrollbar {
    display: none;
}

.filter-drawer-header,
.filter-drawer-footer,
.close-filter-btn {
    display: none !important;
}

.filter-drawer-body {
    padding: 0;
}

.desktop-cat-title {
    font-size: 13px;
    color: #475569;
    letter-spacing: 0.8px;
    margin-bottom: 12px;
    font-weight: 800;
}

.filter-category-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0;
    margin: 0;
    width: 100%;
}

.filter-category-list li a {
    text-decoration: none;
    color: #1e293b;
    font-size: 14.5px;
    display: block;
    padding: 9px 16px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s ease;
    width: 100%;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border: 1px solid transparent;
}

.filter-category-list li a:hover {
    background-color: #fff7ed;
    color: #ea580c;
    border-color: #fed7aa;
}

.filter-category-list li a.active {
    background-color: #ea580c !important;
    color: #ffffff !important;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(234, 88, 12, 0.3);
}

/* --- SAĞ ÜRÜNLER ALANI --- */
.products-main-area {
    flex: 1;
    min-width: 0;
    margin-left: 310px;
}

/* --- TOOLBAR: ORİJİNAL TASARIM VE TURUNCU ALT ÇİZGİ (BOŞLUKLU) --- */
.products-toolbar {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 40px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    
    position: sticky;
    top: 100px;
    z-index: 102;
    border-bottom: 3px solid #ea580c;
}

.toolbar-left-group {
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 0;
    flex: 1;
}

/* KATEGORİ BAŞLIĞI */
.toolbar-left-group h2 {
    font-size: 17px !important;
    color: #0f172a !important;
    font-weight: 700 !important;
    margin: 0 !important;
    width: 250px !important;
    min-width: 250px !important;
    max-width: 250px !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.toolbar-right-group {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

.search-box {
    display: flex;
    align-items: center;
    background-color: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 8px 14px;
    gap: 8px;
    width: 240px;
    flex-shrink: 0;
}

.search-box input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
    width: 100%;
    color: #1e293b;
}

.product-count-badge {
    background-color: #f1f5f9;
    color: #475569;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    width: 90px;
    min-width: 90px;
    text-align: center;
    flex-shrink: 0;
}

.filter-toggle-btn {
    display: none;
}

/* --- ÜRÜN KARTLARI SABİT GRID YAPISI (3 Sütun) --- */
.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.product-card {
    background-color: #fff;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.06);
}

.product-img-wrapper {
    width: 100%;
    height: 200px;
    background-color: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    border-bottom: 1px solid #f1f5f9;
}

.product-img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

.product-info {
    padding: 18px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    justify-content: space-between;
    gap: 14px;
}

.product-title {
    font-size: 15px;
    color: #1e293b;
    font-weight: 600;
    line-height: 1.4;
    margin: 0;
    min-height: 42px;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.add-to-cart-btn {
    width: 100%;
    background-color: #ea580c;
    color: #fff;
    border: none;
    padding: 10px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.add-to-cart-btn:hover {
    background-color: #c2410c;
}

/* --- MOBİL UYUMLULUK & S22 / DAR EKRAN OPTİMİZASYONU --- */
@media (max-width: 991px) {
    .products-page-container {
        display: block;
        padding: 85px 8px 40px 8px;
    }

    .products-main-area {
        width: 100%;
        margin-left: 0;
    }

    .filter-drawer {
        position: fixed !important;
        top: 0 !important;
        left: -300px;
        width: 270px !important;
        min-width: 270px !important;
        height: 100vh;
        max-height: 100vh;
        background-color: #fff;
        box-shadow: 5px 0 25px rgba(0,0,0,0.15);
        z-index: 4000;
        transition: left 0.3s ease;
        display: flex;
        flex-direction: column;
        overflow-y: auto;
    }

    .filter-drawer.open {
        left: 0;
    }

    .filter-drawer-header,
    .close-filter-btn {
        display: flex !important;
    }

    .filter-drawer-footer {
        display: none !important;
    }

    .filter-drawer-header {
        justify-content: space-between;
        align-items: center;
        padding: 12px 15px;
        border-bottom: 1px solid #eee;
    }

    .filter-drawer-header h3 {
        font-size: 16px;
        color: #0f172a;
        margin: 0;
    }

    .close-filter-btn {
        background: none;
        border: none;
        font-size: 22px;
        cursor: pointer;
        color: #666;
    }

    .filter-drawer-body {
        padding: 8px 12px;
        overflow-y: auto;
        flex: 1;
        display: flex;
        flex-direction: column;
    }

    .filter-section {
        flex: 1;
        display: flex;
        flex-direction: column;
    }

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

    .filter-category-list {
        gap: 3px !important;
        flex: 1;
        justify-content: space-between;
    }

    .filter-category-list li a {
        padding: 7px 10px !important;
        font-size: 12.5px !important;
    }

    .filter-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0,0,0,0.5);
        z-index: 3500;
        visibility: hidden;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .filter-overlay.active {
        visibility: visible;
        opacity: 1;
    }

    .products-toolbar {
        top: 60px;
        padding: 8px 10px;
        gap: 8px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        border-bottom: 2px solid #ea580c;
        margin-bottom: 20px;
    }

    .toolbar-left-group {
        display: flex;
        align-items: center;
        gap: 8px;
        flex: 0.7;
        min-width: 0;
    }

    .toolbar-left-group h2 {
        display: none !important;
    }

    .toolbar-right-group {
        display: flex;
        align-items: center;
        gap: 8px;
        flex: 2;
        min-width: 0;
    }

    .filter-toggle-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        gap: 4px;
        background-color: #f8fafc;
        color: #1e293b;
        border: 1px solid #cbd5e1;
        padding: 6px 8px;
        border-radius: 6px;
        font-weight: 600;
        font-size: 12px;
        cursor: pointer;
        white-space: nowrap;
        flex: 0 0 auto;
        min-width: 0;
        height: 36px;
        box-sizing: border-box;
    }

    .search-box {
        display: flex;
        align-items: center;
        background-color: #f8fafc;
        border: 1px solid #cbd5e1;
        border-radius: 6px;
        padding: 6px 8px;
        gap: 6px;
        flex: 1.5;
        min-width: 0;
        height: 36px;
        box-sizing: border-box;
    }

    .search-box svg {
        width: 14px;
        height: 14px;
        flex-shrink: 0;
    }

    .search-box input {
        border: none;
        background: transparent;
        outline: none;
        font-size: 12px;
        width: 100%;
        color: #1e293b;
    }

    .product-count-badge {
        display: flex;
        align-items: center;
        justify-content: center;
        background-color: #f1f5f9;
        color: #475569;
        border: 1px solid #e2e8f0;
        padding: 6px 8px;
        border-radius: 6px;
        font-size: 11px;
        font-weight: 600;
        white-space: nowrap;
        flex: 0 0 auto;
        min-width: 0;
        text-align: center;
        height: 36px;
        box-sizing: border-box;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }

    .product-img-wrapper {
        height: 120px;
    }

    .product-info {
        padding: 6px;
        gap: 5px;
    }

    .product-title {
        font-size: 11px;
        min-height: 32px;
    }

    .add-to-cart-btn {
        padding: 12px 5px;
        font-size: 11px;
    }
}

/* --- BAŞARI MODALI --- */
.cart-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.cart-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.cart-modal-card {
    background: #fff;
    border-radius: 16px;
    padding: 25px;
    max-width: 360px;
    width: 90%;
    text-align: center;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.cart-modal-overlay.active .cart-modal-card {
    transform: translateY(0);
}

.cart-modal-icon {
    width: 55px;
    height: 55px;
    background: #fff7ed;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px auto;
    color: #ea580c;
    box-shadow: 0 0 20px rgba(234, 88, 12, 0.15);
}

.cart-modal-card h3 {
    font-size: 18px;
    color: #0f172a;
    margin: 0 0 6px 0;
    font-weight: 800;
}

.cart-modal-card p {
    font-size: 13px;
    color: #64748b;
    margin: 0 0 16px 0;
    line-height: 1.4;
}

.cart-modal-actions {
    display: flex;
    gap: 8px;
}

.modal-btn-continue {
    flex: 1;
    background: #f1f5f9;
    color: #334155;
    border: none;
    padding: 10px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

.modal-btn-continue:hover {
    background: #e2e8f0;
}

.modal-btn-go-cart {
    flex: 1;
    background: linear-gradient(135deg, #ea580c, #c2410c);
    color: #fff;
    text-decoration: none;
    padding: 10px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(234, 88, 12, 0.25);
    transition: transform 0.2s;
}

.modal-btn-go-cart:hover {
    transform: translateY(-1px);
}