/**
 * Produkti Page Styles
 * Ürün listeleme sayfası için özel stiller
 */

/* ============================================
   BASE LAYOUT
   ============================================ */
.produkti-page-wrapper {
    padding: 0 0 80px;
    background: #f8f9fa;
    min-height: 100vh;
}

.produkti-page-header {
    padding: 30px 0 20px;
}

.produkti-page-title {
    font-size: 32px;
    font-weight: 700;
    color: #0c1e21;
    margin: 0;
}

@media (max-width: 768px) {
    .produkti-page-title {
        font-size: 24px;
    }
}

/* ============================================
   FILTER SIDEBAR
   ============================================ */
.filter-sidebar {
    position: relative;
}

.filter-panel-inner {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.filter-header {
    padding-bottom: 15px;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.filter-section {
    margin-bottom: 20px;
}

.filter-section:last-child {
    margin-bottom: 0;
}

/* Accordion */
.accordion-item {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
}

.accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 15px;
    background: #fff;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: background-color 0.2s;
}

.accordion-header:hover {
    background: #f8f9fa;
}

.accordion-header[aria-expanded="true"] {
    background: #f8f9fa;
}

.accordion-header[aria-expanded="true"] .accordion-icon {
    transform: rotate(180deg);
}

.filter-title {
    font-size: 15px;
    font-weight: 600;
    color: #222;
    margin-bottom: 4px;
}

.filter-selection {
    font-size: 13px;
    color: #666;
}

.accordion-icon {
    font-size: 12px;
    color: #666;
    transition: transform 0.3s;
}

.accordion-content {
    padding: 0 15px 15px;
    background: #f8f9fa;
    display: none;
}

.accordion-item.is-open .accordion-content {
    display: block;
}

/* Search Input */
.search-input-wrapper {
    position: relative;
}

.search-input-wrapper input {
    padding-right: 45px;
}

.search-btn {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 8px 12px;
    color: #666;
    cursor: pointer;
}

/* Range Slider */
.range-slider-wrapper {
    padding: 10px 0;
}

.range-slider {
    height: 6px;
    background: #ddd;
    border-radius: 3px;
    position: relative;
    margin: 20px 10px;
}

.range-slider .ui-slider-range {
    background: #c8102e;
    height: 100%;
    border-radius: 3px;
    position: absolute;
}

.range-slider .ui-slider-handle {
    width: 20px;
    height: 20px;
    background: #c8102e;
    border: 2px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

.range-slider .ui-slider-handle:hover,
.range-slider .ui-slider-handle:focus {
    transform: translate(-50%, -50%) scale(1.1);
}

.range-values {
    text-align: center;
    margin-top: 15px;
    font-size: 14px;
    color: #666;
}

.range-value-display {
    font-weight: 600;
    color: #222;
}

/* Price Inputs */
.price-inputs {
    padding-top: 10px;
}

.price-inputs .form-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
}

/* Category List - Tree View */
.category-list {
    padding: 5px 0;
}

.category-list .form-check {
    padding: 0;
    margin: 0;
    border-bottom: none;
    position: relative;
}

.category-tree {
    position: relative;
}

/* Category item row */
.category-item {
    display: flex;
    align-items: center;
    padding: 10px 0 10px 5px;
    position: relative;
    min-height: 40px;
}

/* Parent categories */
.form-check.parent-category .category-item {
    padding-left: 5px;
}

/* Child categories with tree lines */
.form-check.child-category {
    position: relative;
}

.form-check.child-category .category-item {
    padding-left: 30px;
    position: relative;
}

/* Horizontal connector line */
.form-check.child-category .category-item::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 50%;
    width: 15px;
    height: 1px;
    background: #ddd;
}

/* Vertical tree line - Level 1 */
.form-check.level-1 {
    position: relative;
}

.form-check.level-1::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: #ddd;
}

/* Remove vertical line from last item in each parent group */
.form-check.level-1:last-of-type::before {
    bottom: auto;
    height: 20px;
}

/* Level 2 specific */
.form-check.level-2 .category-item {
    padding-left: 50px;
}

.form-check.level-2 .category-item::before {
    left: 28px;
    width: 15px;
}

.form-check.level-2::before {
    left: 28px;
}

/* Radio buttons - Custom circular styling */
.category-list .form-check-input {
    width: 20px;
    height: 20px;
    margin: 0 12px 0 0;
    cursor: pointer;
    border: 2px solid #bbb;
    border-radius: 50%;
    appearance: none;
    -webkit-appearance: none;
    background: #fff;
    transition: all 0.2s ease;
    flex-shrink: 0;
    position: relative;
}

.category-list .form-check-input:hover {
    border-color: #888;
}

/* Checked state - Dark blue with white dot */
.category-list .form-check-input:checked {
    background: #1a3d7c;
    border-color: #1a3d7c;
}

.category-list .form-check-input:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
}

.category-list .form-check-label {
    font-size: 14px;
    color: #333;
    cursor: pointer;
    flex: 1;
    line-height: 1.3;
    transition: color 0.2s;
}

/* Child category labels */
.form-check.child-category .form-check-label {
    font-size: 13px;
    color: #555;
}

/* Selected item highlight */
.category-list .form-check-input:checked + .form-check-label {
    color: #1a3d7c;
    font-weight: 500;
}

/* Remove old sub-category styles */
.sub-category-list {
    margin-top: 8px;
    padding-left: 5px;
}

.sub-category-list .form-check {
    border-bottom: none;
    padding: 5px 0;
}

.sub-category-list .form-check-label {
    font-size: 13px;
    color: #666;
}

/* Reset Button */
.btn-reset {
    background: #c8102e;
    color: #fff;
    border: none;
    padding: 12px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    transition: background-color 0.3s;
}

.btn-reset:hover {
    background: #a00d25;
    color: #fff;
}

.btn-reset i {
    margin-right: 8px;
}

/* ============================================
   PRODUCT LISTING AREA
   ============================================ */
.product-listing-area {
    padding-left: 30px;
}

/* Toolbar */
.product-toolbar {
    background: #fff;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.results-count {
    font-size: 14px;
    color: #666;
}

.results-count span {
    font-weight: 600;
    color: #222;
}

.toolbar-right {
    gap: 15px;
}

.sort-dropdown {
    display: flex;
    align-items: center;
}

.sort-dropdown label {
    font-size: 14px;
    color: #666;
    white-space: nowrap;
}

.sort-dropdown select {
    min-width: 180px;
}

/* View Switcher */
.view-switcher {
    display: flex;
    gap: 5px;
}

.view-btn {
    width: 38px;
    height: 38px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
}

.view-btn:hover {
    background: #f8f9fa;
    border-color: #c8102e;
    color: #c8102e;
}

.view-btn.active {
    background: #c8102e;
    border-color: #c8102e;
    color: #fff;
}

/* ============================================
   PRODUCTS GRID
   ============================================ */
.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.products-grid.view-list {
    grid-template-columns: 1fr;
}

/* Product Card */
.product-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.products-grid.view-list .product-card {
    display: flex;
    flex-direction: row;
}

.product-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4/3;
}

.products-grid.view-list .product-image {
    width: 300px;
    flex-shrink: 0;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

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

.product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #c8102e;
    color: #fff;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    z-index: 2;
}

.product-content {
    padding: 15px;
    flex: 1;
}

.product-category {
    font-size: 12px;
    color: #c8102e;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.product-title {
    font-size: 16px;
    font-weight: 600;
    color: #222;
    margin-bottom: 12px;
    line-height: 1.4;
}

.product-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.product-title a:hover {
    color: #c8102e;
}

.product-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.spec-tag {
    font-size: 12px;
    color: #666;
    background: #f5f5f5;
    padding: 4px 10px;
    border-radius: 4px;
}

/* List View Specific Styles */
.products-grid.view-list .product-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.products-grid.view-list .product-specs {
    margin-bottom: 15px;
}

.products-grid.view-list .product-description {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
    display: block;
}

/* Loading Indicator */
.loading-indicator {
    padding: 40px 0;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.2rem;
    color: #c8102e !important;
}

/* No Results */
.no-results {
    background: #fff;
    border-radius: 8px;
    padding: 60px 20px;
}

.no-results i {
    color: #ddd;
}

/* Load More Button */
#load-more-btn {
    background: #c8102e;
    border-color: #c8102e;
    padding: 12px 40px;
    font-weight: 600;
}

#load-more-btn:hover {
    background: #a00d25;
    border-color: #a00d25;
}

/* ============================================
   MOBILE FILTER OVERLAY
   ============================================ */
.filter-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

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

/* ============================================
   RESPONSIVE STYLES
   ============================================ */

/* Large Desktop */
@media (min-width: 1400px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Desktop */
@media (max-width: 1399px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Tablet */
@media (max-width: 991px) {
    .produkti-page-wrapper {
        padding: 20px 0 60px;
    }

    .product-listing-area {
        padding-left: 15px;
    }

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

    .filter-sidebar {
        position: fixed;
        top: 0;
        left: -320px;
        width: 320px;
        height: 100%;
        z-index: 999;
        transition: left 0.3s ease;
        padding: 0;
    }

    .filter-sidebar.active {
        left: 0;
    }

    .filter-panel-inner {
        height: 100%;
        border-radius: 0;
        padding: 20px;
        overflow-y: auto;
    }

    .toolbar-right {
        margin-top: 10px;
        justify-content: flex-start !important;
    }
}

/* Mobile */
@media (max-width: 767px) {
    .produkti-page-wrapper {
        padding: 15px 0 40px;
    }

    .product-listing-area {
        padding-left: 0;
    }

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

    .products-grid.view-list {
        grid-template-columns: 1fr;
    }

    .products-grid.view-list .product-card {
        flex-direction: column;
    }

    .products-grid.view-list .product-image {
        width: 100%;
    }

    .product-title {
        font-size: 14px;
    }

    .product-price {
        font-size: 16px;
    }

    .product-toolbar {
        padding: 12px 15px;
    }

    .sort-dropdown label {
        display: none;
    }

    .sort-dropdown select {
        min-width: 140px;
    }

    .view-switcher {
        display: none;
    }
}

/* Small Mobile */
@media (max-width: 575px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .filter-sidebar {
        width: 280px;
        left: -280px;
    }

    .product-image {
        aspect-ratio: 16/10;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card {
    animation: fadeIn 0.4s ease forwards;
}

/* Stagger animation for grid items */
.products-grid .product-card:nth-child(1) { animation-delay: 0.05s; }
.products-grid .product-card:nth-child(2) { animation-delay: 0.1s; }
.products-grid .product-card:nth-child(3) { animation-delay: 0.15s; }
.products-grid .product-card:nth-child(4) { animation-delay: 0.2s; }
.products-grid .product-card:nth-child(5) { animation-delay: 0.25s; }
.products-grid .product-card:nth-child(6) { animation-delay: 0.3s; }
.products-grid .product-card:nth-child(7) { animation-delay: 0.35s; }
.products-grid .product-card:nth-child(8) { animation-delay: 0.4s; }
.products-grid .product-card:nth-child(9) { animation-delay: 0.45s; }
.products-grid .product-card:nth-child(10) { animation-delay: 0.5s; }
.products-grid .product-card:nth-child(11) { animation-delay: 0.55s; }
.products-grid .product-card:nth-child(12) { animation-delay: 0.6s; }

/* ============================================
   SEO PAGINATION
   ============================================ */
.seo-pagination {
    margin-top: 30px;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    text-align: center;
}

.pagination-info {
    margin-bottom: 15px;
    color: #666;
    font-size: 14px;
}

.pagination-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 6px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.page-link:hover {
    background: #e8e8e8;
    border-color: #ccc;
    color: #c8102e;
    text-decoration: none;
}

.page-link.active {
    background: #c8102e;
    border-color: #c8102e;
    color: #fff;
}

.page-dots {
    color: #999;
    padding: 0 5px;
}

/* Hide SEO pagination when using AJAX filters */
.seo-pagination.ajax-filtering {
    display: none;
}

/* ============================================
   NICE-SELECT FIX
   ============================================ */

/* Hide original select when nice-select is active */
.sort-dropdown select.form-select {
    display: none !important;
}

/* Nice-select styling for produkti page */
.sort-dropdown .nice-select {
    float: none;
    display: inline-block;
    min-width: 180px;
    height: 38px;
    line-height: 15px;
    padding-left: 15px;
    padding-right: 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    color: #333;
}

.sort-dropdown .nice-select .list {
    width: 100%;
    border-radius: 6px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    margin-top: 5px;
}

.sort-dropdown .nice-select .option {
    font-size: 14px;
    padding: 8px 15px;
    line-height: 1.5;
}

.sort-dropdown .nice-select .option:hover,
.sort-dropdown .nice-select .option.focus,
.sort-dropdown .nice-select .option.selected.focus {
    background-color: #f8f9fa;
    color: #c8102e;
}

.sort-dropdown .nice-select .current {
    display: block;
    text-align: center;
}

/* Mobile nice-select */
@media (max-width: 767px) {
    .sort-dropdown .nice-select {
        min-width: 140px;
        font-size: 13px;
    }
}

