/* Genel Stil Değişkenleri */

/* Mobile First Approach */
:root {
    --primary-color: #e53935; /* Kırmızı */
    --secondary-color: #212121; /* Koyu Gri/Siyah */
    --white-color: #ffffff;
    --text-color: #424242;
    --light-bg: #f5f5f5;
    --border-color: #e0e0e0;

    /* SABİT SOL BOŞLUK: Kategorilerin olduğu kısmın solundaki boşluk */
    --sidebar-left-offset: 0px; /* Removed left offset */

    /* SAĞ TARAF İÇİN BOŞLUK: Ürünlerin sağındaki boşluk (bu da sol taraftaki boşluğa eşitlenmeli) */
    --products-right-offset: 0px; /* Removed right offset */

    /* Sidebar'ın sabit genişliği */
    --sidebar-width: 280px; /* Increased width for better filter display */
    /* Sidebar ile ürün gridi arasındaki boşluk */
    --sidebar-gap: 30px; /* Increased gap */
    /* Ürün kartları arasındaki boşluk */
    --product-card-gap: 20px; /* Increased gap for better visual separation */
    /* Bir satırdaki hedef ürün sayısı */
    --target-product-columns: 4; 
    /* Ürün kartının yaklaşık minimum genişliği (4 ürüne göre ayarlanacak) */
    --min-product-card-width: 220px; /* Adjusted for new grid */
}

/* Red-White-Black Theme Overrides */
.filters-sidebar {
    background-color: var(--primary-color);
    color: var(--white-color);
}
.filters-sidebar h3,
.filters-sidebar label {
    color: var(--white-color);
}
.filters-sidebar input,
.filters-sidebar select {
    background-color: var(--white-color);
    color: var(--black-color);
    border: 1px solid var(--black-color);
}
.products-content {
    background-color: var(--white-color);
    color: var(--black-color);
}
.product-card {
    background-color: var(--white-color);
    border: 1px solid var(--black-color);
    color: var(--black-color);
}

/* Sayfa Bannerı (Tüm sayfa genişliğini kaplayacak) */
.page-banner {
    background-color: var(--light-bg);
    padding: 20px 0; 
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    width: 100%; /* Tam genişliği kapla */
    box-sizing: border-box;
}

/* products-content-wrapper (Sayfanın genel içeriğini sarar, boşlukları içerideki elementler yönetir) */
.products-content-wrapper {
    padding-top: 40px; /* Adjusted padding */
    padding-bottom: 40px; /* Adjusted padding */
    padding-left: 20px; /* Added padding for overall page content */
    padding-right: 20px; /* Added padding for overall page content */
    max-width: 1200px; /* Max width for content */
    margin: 0 auto; /* Center the content */
    overflow-x: hidden;
    box-sizing: border-box;
}

/* Ana ürünler kısmı: Sidebar ve Grid için flex konteyner */
.products-main {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-start;
    margin-left: 0; /* Removed margin */
    margin-right: 0; /* Removed margin */
    padding: 0;
    max-width: none;
    width: 100%; /* Full width within wrapper */
    box-sizing: border-box;
    gap: var(--sidebar-gap); /* Explicit gap between sidebar and grid */
}

/* Ürünler kenar çubuğu (sidebar) */
.products-sidebar {
    flex: 0 0 var(--sidebar-width);
    background-color: var(--white-color);
    border-radius: 8px; /* Slightly smaller border-radius */
    padding: 20px; /* Adjusted padding */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08); /* Adjusted shadow */
    height: fit-content;
    position: sticky;
    top: 20px;
    z-index: 10;
    order: 1;
    box-sizing: border-box;
}

.sidebar-widget {
    margin-bottom: 20px;
}

.sidebar-widget h3 {
    font-size: 1.2em; /* Adjusted font size */
    color: var(--secondary-color);
    margin-bottom: 15px; /* Adjusted margin */
    border-bottom: 1px solid var(--border-color); /* Adjusted border */
    padding-bottom: 10px; /* Adjusted padding */
    font-weight: 600; /* Adjusted font weight */
}

.category-list {
    list-style: none;
    padding: 0;
}

.category-list li {
    margin-bottom: 8px;
}

.category-list li a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1em; /* Slightly larger font size */
    padding: 8px 0; /* Increased padding */
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: color 0.3s ease, transform 0.2s ease; /* Added transform transition */
}

.category-list li a:hover {
    color: var(--primary-color);
    transform: translateX(5px); /* Slight hover effect */
}

.category-list li a span {
    color: var(--primary-color);
    font-weight: bold;
}

.category-list li a:hover {
    color: var(--primary-color);
}

/* Fiyat Filtresi */
.price-filter .price-slider {
    position: relative;
    height: 6px;
    background: var(--light-bg);
    border-radius: 3px;
    margin-bottom: 15px;
}

.price-filter .price-slider input[type="range"] {
    position: absolute;
    width: 100%;
    height: 6px;
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
    pointer-events: none;
}

.price-filter .price-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: grab;
    border: 2px solid var(--white-color);
    margin-top: -5px;
    pointer-events: all;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.2);
}

.price-filter .price-inputs {
    display: flex;
    align-items: center;
    gap: 10px; /* Increased gap */
}

.price-filter input[type="number"] { /* Changed to number type */
    width: 100%; /* Full width within its container */
    padding: 8px 12px; /* Adjusted padding */
    border: 1px solid var(--border-color);
    border-radius: 4px; /* Adjusted border-radius */
    text-align: left; /* Aligned text to left */
    color: var(--text-color);
    font-size: 0.9em; /* Adjusted font size */
    background-color: var(--light-bg);
}

.price-filter span {
    color: var(--text-color);
    font-size: 0.9em;
}

.price-filter .filter-price-btn {
    background-color: var(--primary-color);
    color: var(--white-color);
    border: none;
    padding: 8px 12px; /* Increased padding */
    border-radius: 5px; /* Slightly larger border-radius */
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease; /* Added transform transition */
    font-weight: 600; /* Bolder font */
    font-size: 0.95em; /* Slightly larger font size */
}

.price-filter .filter-price-btn:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px); /* Slight hover effect */
}

.price-filter .filter-price-btn:hover {
    background-color: var(--secondary-color);
}

/* Marka Filtresi */
.brand-filter .filter-item {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}

.brand-filter input[type="checkbox"] {
    margin-right: 10px; /* Increased margin */
    accent-color: var(--primary-color);
    transform: scale(1.1); /* Slightly larger checkbox */
}

.brand-filter label {
    color: var(--text-color);
    font-size: 1em; /* Slightly larger font size */
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px; /* Increased gap */
}

.brand-filter label span {
    color: var(--primary-color);
    font-weight: bold;
    font-size: 0.8em;
}

/* Ürün Gridini ve Sayfalamayı saran wrapper (Main content area) */
.products-grid-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-left: 0; /* Gap is now handled by products-main */
    padding-right: 0;
    order: 2;
    box-sizing: border-box;
    width: auto;
}

/* Ürün araç çubuğu (toolbar) */
.products-toolbar {
    display: none;
}

/* Ürün Grid Alanı */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(var(--min-product-card-width), 1fr));
    gap: var(--product-card-gap);
    transition: all 0.3s ease;
    width: 100%;
    box-sizing: border-box;
    align-items: stretch;
}

/* Yeni Ürün Kartı Stili */
.product-card {
    background-color: var(--white-color);
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%; /* Ensure cards in a row have equal height */
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.product-image {
    position: relative;
    width: 100%;
    padding-top: 75%; /* 4:3 Aspect Ratio (height / width * 100) */
    overflow: hidden;
    background-color: var(--light-bg);
    border-bottom: 1px solid var(--border-color);
}

.product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.discount-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: var(--primary-color);
    color: var(--white-color);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: bold;
    z-index: 2;
}

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

.product-title {
    font-size: 1.1em;
    color: var(--secondary-color);
    margin-bottom: 10px;
    font-weight: 600;
    min-height: 50px; /* Ensure consistent height for titles */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-price {
    display: flex;
    align-items: baseline; /* Align prices at the bottom */
    gap: 8px;
    margin-top: auto; /* Push prices to the bottom */
    margin-bottom: 15px;
}

.current-price {
    font-size: 1.4em;
    color: var(--primary-color);
    font-weight: bold;
}

.old-price {
    font-size: 1em;
    color: var(--text-color);
    text-decoration: line-through;
}

.product-buttons {
    margin-top: auto; /* Push buttons to the bottom */
}

.product-buttons .contact-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    background-color: var(--secondary-color);
    color: var(--white-color);
    padding: 10px 15px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease;
    font-size: 0.95em;
}

.product-buttons .contact-btn:hover {
    background-color: var(--primary-color);
}

.product-buttons .contact-btn i {
    margin-right: 8px;
    font-size: 1.1em;
}

.product-brand {
    font-size: 0.9em;
    color: var(--text-color);
    margin-bottom: 5px;
}


/* Sayfalama */
.pagination {
    display: flex;
    justify-content: center; /* Center pagination */
    align-items: center;
    margin-top: 30px;
    padding: 0;
    gap: 8px;
    width: 100%; /* Full width */
    box-sizing: border-box;
    margin-left: 0;
    margin-right: 0;
    max-width: none;
}

.pagination a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 30px;
    background-color: var(--white-color);
    color: var(--text-color);
    text-decoration: none;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.8em;
}

.pagination a.active,
.pagination a:hover {
    background-color: var(--primary-color);
    color: var(--white-color);
    border-color: var(--primary-color);
}

.pagination a.prev,
.pagination a.next {
    border-radius: 3px;
}


/* Responsive Düzenlemeler */
/* Geniş ekranlar (min-width: 993px - daha büyük ekranlarda eşit boşluk ve 4 sütun) */
@media (min-width: 993px) {
    /* products-main'in genel sayfa boşluklarını koru */
    .products-main {
        width: auto; /* Otomatik genişlik */
    }
    .products-grid {
        grid-template-columns: repeat(var(--target-product-columns), 1fr); 
    }
}

/* Responsive Düzenlemeler */
/* Tablet ve daha küçük ekranlar (max-width: 992px) */
@media (max-width: 992px) {
    .products-content-wrapper {
        padding-left: 15px;
        padding-right: 15px;
    }

    .products-main {
        flex-direction: column;
        gap: 20px;
    }

    .products-sidebar {
        position: static;
        width: 100%;
        padding: 15px;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); /* Adjusted for tablet */
        gap: 15px;
    }
}

/* Çok küçük mobil cihazlar (768px altı) */
@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: 1fr; /* Single column layout */
        gap: 15px; /* Adjust gap for single column */
        padding: 0 15px; /* Add horizontal padding to the grid itself */
    }

    .products-grid .product-card {
        width: 100%; /* Make cards take full width */
        max-width: 300px; /* Optional: limit max width for very large screens in mobile view */
        margin: 0 auto; /* Center the cards */
    }

    .products-content-wrapper {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .product-title {
        font-size: 1em;
        min-height: 45px;
    }
    
    .current-price {
        font-size: 1.2em;
    }
    
    .product-buttons .contact-btn {
        padding: 8px 12px;
        font-size: 0.9em;
    }
}

/* Extra Small Devices (480px altı) */
@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr; /* Single column on very small screens */
        gap: 10px;
    }

    .products-grid .product-card {
        width: 100%; /* Make cards take full width */
        max-width: 250px; /* Adjusted for smaller mobile */
        margin: 0 auto; /* Center the cards */
    }

    .products-content-wrapper {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .page-banner {
        padding: 15px 0;
    }
    
    .page-banner h1 {
        font-size: 1.5em;
    }
    
    .page-banner p {
        font-size: 0.9em;
    }
    
    .products-sidebar {
        padding: 15px;
    }
    
    .sidebar-widget h3 {
        font-size: 1.1em;
    }
    
    .category-list li a {
        font-size: 0.9em;
        padding: 8px 0;
    }
    
    .discount-badge {
        top: 5px;
        left: 5px;
        padding: 2px 4px;
        font-size: 0.65em;
    }

    .product-card {
        padding: 10px;
    }
    
    .product-image {
        height: 150px; /* Adjusted for mobile */
        padding-top: 0; /* Remove padding-top when height is fixed */
    }
    
    .product-info {
        padding: 8px;
    }

    .product-title {
        font-size: 0.9em;
        min-height: 35px;
        margin-bottom: 8px;
    }
    
    .current-price {
        font-size: 1.1em;
    }
    
    .product-buttons .contact-btn {
        padding: 8px 12px;
        font-size: 0.8em;
    }
    
.pagination a {
        padding: 6px 10px;
        font-size: 0.8em;
    }
}
