/* Tekid Filters Styles */
.tekid-epood {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
}

.tekid-filters-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

.tekid-filters-container {
    display: flex;
    gap: 1.5rem !important;
    max-width: 100%;
}

/* SIDEBAR LAIUS - KÕIGE TÄHTSAMAD REEGLID */
.tekid-filters-sidebar,
.filters-sidebar {
    flex: 0 0 200px !important;
    min-width: 200px !important;
    max-width: 200px !important;
    width: 200px !important;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    height: fit-content;
    position: sticky;
    top: 2rem;
}

.tekid-products-area {
    flex: 1;
    min-width: 0;
}

/* PEIDA KÕIK (Tekid) TEKSTID */
em {
    display: none !important;
}

/* PEIDA HINNAVAHEMIK - AGRESSIIVSEMALT */
*[class*="price"],
*[id*="price"],
*[class*="hind"],
*[id*="hind"],
.price-range,
.price-inputs,
.price-filter,
.hind-filter,
input[type="range"] {
  
}

/* PEIDA HINNA PEALKIRJAD */
h3:contains("Hind"),
h4:contains("Hind"),
h3:contains("Price"),
h4:contains("Price") {

}

.filter-group,
.filter-section,
.tekid-filter-section {
    margin-bottom: 2rem;
}

.filter-group h3,
.filter-section h3,
.tekid-filter-section h3,
.tekid-filter-section h4 {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 0.5rem;
}

.filter-checkboxes,
.filter-list,
.tekid-filter-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* KERIMISRIBA KÕIGILE FILTER SEKTSIOONIDELE */
.tekid-filter-options,
.filter-list,
.filter-checkboxes {
    max-height: 350px !important;
    overflow-y: auto !important;
    padding-right: 8px;
}

/* WEBKIT SCROLLBAR */
.tekid-filter-options::-webkit-scrollbar,
.filter-list::-webkit-scrollbar,
.filter-checkboxes::-webkit-scrollbar {
    width: 6px !important;
}

.tekid-filter-options::-webkit-scrollbar-track,
.filter-list::-webkit-scrollbar-track,
.filter-checkboxes::-webkit-scrollbar-track {
    background: #f1f1f1 !important;
    border-radius: 3px;
}

.tekid-filter-options::-webkit-scrollbar-thumb,
.filter-list::-webkit-scrollbar-thumb,
.filter-checkboxes::-webkit-scrollbar-thumb {
    background: #c1c1c1 !important;
    border-radius: 3px;
}

.tekid-filter-options::-webkit-scrollbar-thumb:hover,
.filter-list::-webkit-scrollbar-thumb:hover,
.filter-checkboxes::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8 !important;
}

/* FIREFOX SCROLLBAR */
.tekid-filter-options,
.filter-list,
.filter-checkboxes {
    scrollbar-width: thin !important;
    scrollbar-color: #c1c1c1 #f1f1f1 !important;
}

.filter-checkbox,
.filter-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: #4b5563;
}

.filter-checkbox input[type="checkbox"],
.filter-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #2563eb;
}

.filter-checkbox label {
    font-size: 0.9rem;
    color: #4b5563;
    cursor: pointer;
    flex: 1;
}

.search-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.clear-filters,
.btn-reset {
    background: #ef4444;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    margin-top: 1rem;
    width: 100%;
}

.clear-filters:hover,
.btn-reset:hover {
    background: #dc2626;
}

.mobile-filters-toggle {
    display: none;
    margin-bottom: 1rem;
}

.btn-filters {
    width: 100%;
    padding: 0.75rem 1rem;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
}

.btn-filters:hover {
    background: #1d4ed8;
}

.products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.results-count,
.results-info {
    color: #6b7280;
    font-size: 0.9rem;
}

.sort-filter label {
    margin-right: 0.5rem;
    font-size: 0.9rem;
    color: #4b5563;
}

.sort-select {
    padding: 0.5rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.9rem;
    background: white;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.products-per-row-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.products-per-row-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.products-per-row-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.products-per-row-5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.product-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.product-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.product-image {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
}

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

.sale-badge {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    background: #ef4444;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.product-info,
.product-content {
    padding: 1rem;
}

.product-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    color: #1f2937;
    text-decoration: none;
}

.product-title:hover,
.product-title a:hover {
    color: #2563eb;
}

.product-title a {
    color: #1f2937;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 600;
}

.product-rating {
    margin: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stars {
    color: #fbbf24;
}

.rating-count {
    font-size: 0.8rem;
    color: #6b7280;
}

.product-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: #059669;
}

.price-crossed {
    text-decoration: line-through;
    color: #9ca3af;
    margin-right: 0.5rem;
}

.product-actions {
    margin-top: 1rem;
}

.btn-view-product {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #2563eb;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9rem;
}

.btn-view-product:hover {
    background: #1d4ed8;
    color: white;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.pagination-btn,
.page-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #d1d5db;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.pagination-btn:hover:not(:disabled):not(.active),
.page-btn:hover:not(.active) {
    background: #f3f4f6;
}

.pagination-btn.active,
.page-btn.active {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.spinner {
    width: 2rem;
    height: 2rem;
    border: 2px solid #e5e7eb;
    border-top: 2px solid #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.no-results,
.no-products {
    text-align: center;
    padding: 3rem 1rem;
    color: #6b7280;
}

.no-results h3 {
    margin-bottom: 1rem;
    color: #1f2937;
}

/* Mobile responsiveness */
@media (max-width: 1200px) {
    .tekid-filters-sidebar {
        flex: 0 0 180px !important;
        min-width: 180px !important;
        max-width: 180px !important;
        width: 180px !important;
    }
}

@media (max-width: 768px) {
    .mobile-filters-toggle {
        display: block;
    }

    .tekid-filters-container {
        flex-direction: column;
    }

    .tekid-filters-sidebar {
        display: none;
        flex: none !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: auto !important;
        position: static;
        order: -1;
    }

    .tekid-filters-sidebar.mobile-open {
        display: block;
    }

    .products-per-row-3,
    .products-per-row-4,
    .products-per-row-5 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .products-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
}

@media (max-width: 480px) {
    .products-grid,
    .products-per-row-2,
    .products-per-row-3,
    .products-per-row-4,
    .products-per-row-5 {
        grid-template-columns: 1fr;
    }

    .tekid-filters-wrapper {
        padding: 0.5rem;
    }

    .tekid-filters-sidebar {
        padding: 1rem;
    }
}
renderProduct(product) {
    const saleBadge = product.on_sale && this.settings.show_sale_badge === '1' ?
        '<span class="sale-badge">SOODUSTUS</span>' : '';

    const image = product.image ?
        `<img src="${product.image}" alt="${product.title}" loading="lazy">` : '';

    const price = this.settings.show_product_price === '1' ?
        `<div class="product-price">${product.price_html}</div>` : '';

    const rating = product.average_rating > 0 ? `
        <div class="product-rating">
            <div class="stars">${'★'.repeat(Math.round(product.average_rating))}${'☆'.repeat(5 - Math.round(product.average_rating))}</div>
            <span class="rating-count">(${product.rating_count})</span>
        </div>
    ` : '';

    return `
        <div class="product-card">
            <div class="product-image">
                ${image}
                ${saleBadge}
            </div>
            <div class="product-content">
                <h3 class="product-title">
                    <a href="${product.permalink}">${product.title}</a>
                </h3>
                ${rating}
                <div class="product-footer">
                    ${price}
                    <div class="product-actions">
                        <a href="${product.permalink}" class="btn-view-product">Vaata toodet</a>
                    </div>
                </div>
            </div>
        </div>
    `;
}
