/* --- ÜRÜNLER SAYFASI ANA YAPI --- */
.products-page-container {
    padding-top: 120px;
    padding-bottom: 60px;
}

.products-main-area {
    width: 100%;
}

/* --- ÜST KONTROL ÇUBUĞU (TOOLBAR) --- */
.products-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #fff;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.toolbar-left, .toolbar-right {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* Filtre Açma Butonu */
.filter-toggle-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: #2c3e50;
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.filter-toggle-btn:hover {
    background-color: #34495e;
}

/* Sıralama Seçim Kutusu */
.sort-select {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background-color: #fff;
    font-size: 14px;
    color: #333;
    outline: none;
    cursor: pointer;
}

/* Arama Kutusu */
.search-box {
    display: flex;
    align-items: center;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 8px 12px;
    gap: 8px;
}

.search-box input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
    color: #333;
}

/* Görünüm Butonları (Grid / Liste) */
.view-options {
    display: flex;
    gap: 5px;
}

.view-btn {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: all 0.2s;
}

.view-btn.active, .view-btn:hover {
    background-color: #f39c12;
    color: #fff;
    border-color: #f39c12;
}

/* --- KATEGORİ BAŞLIĞI VE SAYACI --- */
.products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.products-header h2 {
    font-size: 24px;
    color: #2c3e50;
}

.product-count-badge {
    background-color: #e67e22;
    color: #fff;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

/* --- ÜRÜN KARTLARI GRID YAPISI --- */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
}

.product-card {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.product-img-wrapper {
    width: 100%;
    height: 180px;
    background-color: #fdfdfd;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.product-img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

.product-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    justify-content: space-between;
    gap: 15px;
}

.product-title {
    font-size: 16px;
    color: #2c3e50;
    font-weight: 600;
}

.add-to-cart-btn {
    width: 100%;
    background-color: #f39c12;
    color: #fff;
    border: none;
    padding: 10px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.add-to-cart-btn:hover {
    background-color: #e67e22;
}

/* --- LİSTE GÖRÜNÜMÜ (LIST VIEW) --- */
.products-grid.list-view {
    grid-template-columns: 1fr;
}

.products-grid.list-view .product-card {
    flex-direction: row;
    align-items: center;
}

.products-grid.list-view .product-img-wrapper {
    width: 150px;
    height: 120px;
    border-bottom: none;
    border-right: 1px solid #eee;
}

.products-grid.list-view .product-info {
    flex-direction: row;
    align-items: center;
    width: 100%;
}

.products-grid.list-view .add-to-cart-btn {
    width: 160px;
}

/* --- FİLTRE ÇEKMECESİ (DRAWER) & OVERLAY --- */
.filter-drawer {
    position: fixed;
    top: 0;
    left: -350px;
    width: 320px;
    height: 100%;
    background-color: #fff;
    box-shadow: 2px 0 15px rgba(0,0,0,0.15);
    z-index: 4000;
    transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.filter-drawer.open {
    left: 0;
}

.filter-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.filter-drawer-header h3 {
    font-size: 18px;
    color: #2c3e50;
}

.close-filter-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.filter-drawer-body {
    padding: 20px;
    overflow-y: auto;
    flex-grow: 1;
}

.filter-section h4 {
    font-size: 16px;
    color: #2c3e50;
    margin-bottom: 15px;
}

.filter-category-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.filter-category-list li a {
    text-decoration: none;
    color: #555;
    font-size: 15px;
    display: block;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s;
}

.filter-category-list li a:hover,
.filter-category-list li a.active {
    background-color: #fef5e7;
    color: #f39c12;
    font-weight: 600;
}

.filter-drawer-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
}

.apply-filter-btn, .reset-filter-btn {
    flex: 1;
    padding: 10px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    border: none;
}

.apply-filter-btn {
    background-color: #f39c12;
    color: #fff;
}

.apply-filter-btn:hover {
    background-color: #e67e22;
}

.reset-filter-btn {
    background-color: #f1f1f1;
    color: #333;
}

.reset-filter-btn:hover {
    background-color: #e4e4e4;
}

/* Arka Plan Karartması (Overlay) */
.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, visibility 0.3s ease;
}

.filter-overlay.active {
    visibility: visible;
    opacity: 1;
}

/* --- MOBİL UYUMLULUK --- */
@media (max-width: 768px) {
    .products-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .toolbar-left, .toolbar-right {
        width: 100%;
        justify-content: space-between;
    }

    .search-box {
        flex-grow: 1;
    }

    .products-grid.list-view .product-card {
        flex-direction: column;
    }

    .products-grid.list-view .product-img-wrapper {
        width: 100%;
        height: 150px;
        border-right: none;
        border-bottom: 1px solid #eee;
    }

    .products-grid.list-view .product-info {
        flex-direction: column;
        align-items: stretch;
    }

    .products-grid.list-view .add-to-cart-btn {
        width: 100%;
    }
}

/* --- ÜRÜN KARTI ADET KONTROLÜ VE BUTON ETKİLEŞİMİ --- */
.product-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.initial-add-btn {
    width: 100%;
    background-color: #f39c12;
    color: #fff;
    border: none;
    padding: 10px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.initial-add-btn:hover {
    background-color: #e67e22;
}

.qty-selection-area {
    display: none;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.qty-selection-area.active {
    display: flex;
}

.card-qty-controller {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    overflow: hidden;
    background: #f8fafc;
}

.card-qty-btn {
    background: transparent;
    border: none;
    padding: 6px 12px;
    cursor: pointer;
    color: #334155;
    font-weight: 700;
    font-size: 14px;
    transition: background 0.2s;
}

.card-qty-btn:hover {
    background: #e2e8f0;
}

.card-qty-input {
    width: 40px;
    text-align: center;
    border: none;
    font-size: 14px;
    font-weight: 700;
    background: transparent;
    color: #0f172a;
    outline: none;
}

.confirm-add-btn {
    width: 100%;
    background-color: #27ae60;
    color: #fff;
    border: none;
    padding: 8px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.confirm-add-btn:hover {
    background-color: #219653;
}

/* --- BAŞARI MODALI (MODAL) --- */
.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: 30px;
    max-width: 400px;
    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: 65px;
    height: 65px;
    background: #fff7ed;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px auto;
    color: #ea580c;
    box-shadow: 0 0 20px rgba(234, 88, 12, 0.15);
}

.cart-modal-card h3 {
    font-size: 20px;
    color: #0f172a;
    margin: 0 0 8px 0;
    font-weight: 800;
}

.cart-modal-card p {
    font-size: 14px;
    color: #64748b;
    margin: 0 0 20px 0;
    line-height: 1.5;
}

.cart-modal-actions {
    display: flex;
    gap: 10px;
}

.modal-btn-continue {
    flex: 1;
    background: #f1f5f9;
    color: #334155;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-weight: 700;
    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: 12px;
    border-radius: 8px;
    font-weight: 700;
    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);
}