/* Catalog Page Styles */

/* Global Text Overflow Fix */
.catalog-content h1, 
.catalog-content h2, 
.catalog-content h3, 
.catalog-content p,
.catalog-content span,
.catalog-content a,
.catalog-content label {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* Catalog Hero Section */
.catalog-hero {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    color: white;
    padding: 80px 0 60px;
    text-align: center;
}

.catalog-hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.catalog-hero p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

/* Search Container */
.search-container {
    max-width: 600px;
    margin: 0 auto;
}

.search-box {
    display: flex;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.search-box input {
    flex: 1;
    padding: 15px 20px;
    border: none;
    font-size: 1rem;
    outline: none;
    color: #333;
}

.search-box input::placeholder {
    color: #999;
}

.search-btn {
    background: #f59e0b;
    color: white;
    border: none;
    padding: 15px 30px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.search-btn:hover {
    background: #d97706;
}

/* Catalog Content Layout */
.catalog-content {
    padding: 40px 0;
    background: #f8fafc;
}

/* Filter Overlay - Varsayılan gizli */
.filter-overlay {
    display: none;
}

.catalog-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
    align-items: start;
}

/* Sidebar Styles */
.catalog-sidebar {
    background: white;
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 20px;
}

.filters-section {
    padding: 25px;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e5e7eb;
}

.filter-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
}

.close-filters {
    display: none;
    background: #ef4444;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
}

.clear-all {
    background: none;
    border: none;
    color: #3b82f6;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: underline;
}

.filter-group {
    margin-bottom: 30px;
    width: 100%;
    overflow: hidden; /* Prevent content overflow */
}

.filter-group h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Category Tree - Accordion Style */
.category-tree {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.category-item {
    margin-bottom: 0;
    border-radius: 6px;
    overflow: hidden;
}

.category-item.active {
    background: #eff6ff;
}

/* Category Header (Ana Kategori - Tıklanabilir) */
.category-header {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 10px 12px;
    font-size: 0.9rem;
    transition: all 0.2s;
    border-radius: 6px;
    user-select: none;
}

.category-header:hover {
    background: #f3f4f6;
}

.category-item.open > .category-header {
    background: #e0e7ff;
}

.category-toggle {
    margin-right: 8px;
    font-size: 0.75rem;
    color: #6b7280;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.category-header label {
    display: flex;
    align-items: center;
    cursor: pointer;
    flex: 1;
    margin: 0;
    padding: 0;
}

/* Alt Kategori Label (Sadece checkbox) */
.category-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px 12px 8px 28px;
    font-size: 0.9rem;
    transition: background 0.2s;
    border-radius: 6px;
}

.category-label:hover {
    background: #f3f4f6;
}

.category-item input[type="radio"] {
    margin-right: 10px;
    accent-color: #3b82f6;
    cursor: pointer;
    flex-shrink: 0;
}

.category-name {
    color: #374151;
    font-weight: 500;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.4;
}

/* Subcategories - Accordion Animation */
.subcategories {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    margin-left: 0;
    padding-left: 0;
    border-left: none;
}

.category-item.open > .subcategories {
    margin-top: 4px;
    padding-left: 20px;
    border-left: 2px solid #cbd5e0;
}

/* Manufacturer Filter */
.manufacturer-list label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    cursor: pointer;
}

.manufacturer-list input[type="checkbox"] {
    margin-right: 10px;
    accent-color: #3b82f6;
}

/* Price Range Filter */
.price-range {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.price-slider {
    width: 100%;
    margin-bottom: 15px;
    accent-color: #3b82f6;
}

.price-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.price-input {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
    min-width: 0; /* Important for flex items */
    max-width: calc(50% - 15px); /* Ensure it doesn't overflow */
}

.price-inputs span {
    color: #6b7280;
    font-weight: 500;
    flex-shrink: 0;
}

/* Expert Help Section */
.expert-help {
    background: #1e3a8a;
    color: white;
    padding: 25px;
    border-radius: 0 0 12px 12px;
    text-align: center;
}

.expert-help h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.expert-help p {
    font-size: 0.9rem;
    margin-bottom: 20px;
    opacity: 0.9;
    line-height: 1.5;
}

.contact-sales {
    background: #f59e0b;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.3s;
    width: 100%;
}

.contact-sales:hover {
    background: #d97706;
}

/* Main Content */
.catalog-main {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.catalog-header {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.catalog-header h1 {
    margin: 0;
    font-size: 2rem;
    color: #1a365d;
}

.catalog-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.results-count {
    font-size: 0.95rem;
    color: #6b7280;
    margin: 0;
}

.sort-by {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sort-by label {
    font-size: 0.9rem;
    color: #374151;
    font-weight: 500;
    white-space: nowrap;
}

.sort-by select {
    padding: 8px 35px 8px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #374151;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23374151' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.sort-by select:hover {
    border-color: #4299e1;
}

.sort-by select:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

.sort-by select {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
    background: white;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.product-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.product-card .product-link {
    display: block;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

.product-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    cursor: pointer;
}

.product-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
}

/* Placeholder image styling */
.product-image img[src*="placeholder"] {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image img[src*="placeholder"]::before {
    content: "📷";
    font-size: 3rem;
    color: #9ca3af;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-badges {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    gap: 8px;
}

.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge.in-stock {
    background: #10b981;
    color: white;
}

.badge.quote-only {
    background: #f59e0b;
    color: white;
}

.badge.limited {
    background: #ef4444;
    color: white;
}

.product-actions {
    position: absolute;
    top: 12px;
    right: 12px;
}

.btn-favorite {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-favorite:hover {
    background: white;
    color: #ef4444;
}

.product-info {
    padding: 20px;
}

.product-info h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.product-code {
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 12px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.product-features {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.feature {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
}

.feature.new {
    background: #dbeafe;
    color: #1e40af;
}

.feature.certified {
    background: #d1fae5;
    color: #065f46;
}

.feature.top-tier {
    background: #fef3c7;
    color: #92400e;
}

.feature.oem {
    background: #e0e7ff;
    color: #3730a3;
}

.feature.electric {
    background: #dcfce7;
    color: #166534;
}

.feature.eco {
    background: #ecfdf5;
    color: #047857;
}

.feature.heavy-duty {
    background: #fecaca;
    color: #991b1b;
}

.feature.warranty {
    background: #f3e8ff;
    color: #6b21a8;
}

.product-description {
    font-size: 0.9rem;
    color: #6b7280;
    line-height: 1.5;
    margin-bottom: 15px;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.product-price .price {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1f2937;
}

.btn-details {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-details:hover {
    background: #2563eb;
}

.btn-quote-request {
    background: #f59e0b;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s;
    flex: 1;
    margin-right: 8px;
}

.btn-quote-request:hover {
    background: #d97706;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-bottom: 30px;
}

.page-btn {
    background: white;
    border: 1px solid #d1d5db;
    color: #374151;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.page-btn:hover {
    background: #f3f4f6;
}

.page-btn.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.page-dots {
    color: #6b7280;
    padding: 0 8px;
}

/* Load More Section */
.load-more-section {
    text-align: center;
}

.load-more-btn {
    background: #1e3a8a;
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.load-more-btn:hover {
    background: #1e40af;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .catalog-layout {
        grid-template-columns: 250px 1fr;
        gap: 20px;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .catalog-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .catalog-sidebar {
        position: static;
        order: 2;
    }
    
    .catalog-main {
        order: 1;
    }
    
    .catalog-header {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .catalog-controls {
        justify-content: space-between;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .sort-by {
        width: 100%;
        justify-content: space-between;
    }
    
    .sort-by select {
        flex: 1;
        max-width: 200px;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 15px;
    }
    
    .catalog-hero h1 {
        font-size: 2rem;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    .search-btn {
        border-radius: 0 0 8px 8px;
    }
}

@media (max-width: 480px) {
    .catalog-hero {
        padding: 60px 0 40px;
    }
    
    .catalog-hero h1 {
        font-size: 1.8rem;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .product-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .btn-quote-request {
        margin-right: 0;
        margin-bottom: 8px;
    }
    
    /* Price inputs mobile fix */
    .price-inputs {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .price-input {
        max-width: 100%;
        width: 100%;
    }
    
    .price-inputs span {
        text-align: center;
        order: -1;
    }
}

/* Mobile Catalog Filters */
.mobile-filter-toggle {
    display: none;
    background: #4299e1;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 20px;
    width: 100%;
    font-size: 1rem;
}

.mobile-filter-toggle i {
    margin-right: 8px;
}

/* Catalog Layout Responsive */
@media (max-width: 768px) {
    .catalog-layout {
        display: block;
    }
    
    .catalog-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 85%;
        height: 100vh;
        background: white;
        z-index: 1001;
        overflow-y: auto;
        padding: 20px;
        transition: left 0.3s ease;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    }
    
    .catalog-sidebar.mobile-active {
        left: 0;
    }
    
    .catalog-sidebar .filters-section {
        margin-top: 60px;
    }
    
    .mobile-filter-toggle {
        display: block;
    }
    
    .catalog-main {
        width: 100%;
        padding: 0;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .catalog-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .catalog-controls {
        width: 100%;
    }
    
    .sort-by {
        width: 100%;
    }
    
    .sort-by select {
        width: 100%;
        padding: 12px;
    }
    
    .results-info {
        text-align: center;
        margin-bottom: 10px;
    }
    
    /* Filter Groups Mobile */
    .filter-group {
        margin-bottom: 25px;
    }
    
    .filter-group h4 {
        font-size: 1.1rem;
        margin-bottom: 15px;
        padding-bottom: 8px;
        border-bottom: 2px solid #4299e1;
    }
    
    .category-tree {
        max-height: none;
    }
    
    .category-item label {
        padding: 12px 0;
        font-size: 1rem;
    }
    
    .manufacturer-list label {
        padding: 10px 0;
        font-size: 1rem;
    }
    
    .price-range {
        padding: 15px 0;
    }
    
    .price-inputs {
        flex-direction: column;
        gap: 10px;
    }
    
    .price-input {
        width: 100%;
        padding: 12px;
        font-size: 1rem;
    }
    
    /* Expert Help Mobile */
    .expert-help {
        margin-top: 30px;
        padding: 20px;
    }
    
    .expert-help h4 {
        font-size: 1.2rem;
        margin-bottom: 15px;
    }
    
    .contact-sales {
        width: 100%;
        padding: 15px;
        font-size: 1.1rem;
    }
    
    /* Product Cards Mobile */
    .product-card {
        border-radius: 12px;
        overflow: hidden;
    }
    
    .product-image {
        height: 200px;
    }
    
    .product-info {
        padding: 20px;
    }
    
    .product-info h3 {
        font-size: 1.2rem;
        margin-bottom: 10px;
    }
    
    .product-footer {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .btn-details,
    .btn-quote-request {
        width: 100%;
        text-align: center;
        padding: 12px;
    }
    
    .product-price {
        text-align: center;
        margin-bottom: 10px;
    }
    
    .product-price .price {
        font-size: 1.3rem;
    }
    
    /* Pagination Mobile */
    .pagination {
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .page-btn {
        min-width: 44px;
        height: 44px;
    }
    
    .load-more-btn {
        width: 100%;
        padding: 15px;
        font-size: 1.1rem;
    }
}

/* Mobile Filter Overlay */
@media (max-width: 768px) {
    .filter-overlay {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1000;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    .filter-overlay.active {
        opacity: 1;
        visibility: visible;
    }
    
    .catalog-sidebar .filter-header {
        position: sticky;
        top: 0;
        background: white;
        padding: 15px 0;
        border-bottom: 1px solid #eee;
        margin-bottom: 20px;
        z-index: 10;
    }
    
    .filter-header .close-filters {
        display: block;
    }
    
    .filter-header .clear-all {
        display: none;
    }
    
    .filter-header .close-filters {
        display: block;
        background: #ef4444;
        color: white;
        border: none;
        padding: 8px 15px;
        border-radius: 4px;
        cursor: pointer;
        float: right;
    }
}

/* Desktop - Hide mobile elements */
@media (min-width: 769px) {
    .mobile-filter-toggle {
        display: none !important;
    }
    
    .filter-overlay {
        display: none !important;
    }
    
    .close-filters {
        display: none !important;
    }
}


/* Catalog Search Dropdown */
.catalog-search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    margin-top: 5px;
}

.catalog-search-dropdown .search-loading,
.catalog-search-dropdown .search-no-results,
.catalog-search-dropdown .search-error {
    padding: 20px;
    text-align: center;
    color: #6b7280;
}

.catalog-search-dropdown .search-loading i {
    font-size: 1.5rem;
    color: #3b82f6;
    margin-bottom: 10px;
}

.catalog-search-dropdown .search-no-results i,
.catalog-search-dropdown .search-error i {
    font-size: 2rem;
    margin-bottom: 10px;
    display: block;
}

.catalog-search-dropdown .search-results-list {
    padding: 8px 0;
}

.catalog-search-dropdown .search-result-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    text-decoration: none;
    color: #1f2937;
    transition: background 0.2s;
    border-bottom: 1px solid #f3f4f6;
}

.catalog-search-dropdown .search-result-item:last-child {
    border-bottom: none;
}

.catalog-search-dropdown .search-result-item:hover {
    background: #f9fafb;
}

.catalog-search-dropdown .search-result-image {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    overflow: hidden;
    margin-right: 12px;
    flex-shrink: 0;
    background: #f3f4f6;
}

.catalog-search-dropdown .search-result-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.catalog-search-dropdown .search-result-info {
    flex: 1;
    min-width: 0;
}

.catalog-search-dropdown .search-result-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.catalog-search-dropdown .search-result-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #6b7280;
}

.catalog-search-dropdown .search-result-sku {
    font-family: monospace;
}

.catalog-search-dropdown .search-result-price {
    font-weight: 600;
    color: #3b82f6;
}

.catalog-search-dropdown .search-results-footer {
    padding: 12px 15px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

.catalog-search-dropdown .view-all-results {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #3b82f6;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.catalog-search-dropdown .view-all-results:hover {
    color: #2563eb;
}

.catalog-search-dropdown .view-all-results i {
    font-size: 0.8rem;
}
