/* ===== Furniture Index Page ===== */

.furniture-index-container {
    max-width: 1430px;
    margin: 0 auto;
    padding: 0 15px 30px;
}

.furniture-index-container .home-categories-header {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin: 10px 0 30px 0;
    padding: 0 0 15px 0;
    border-bottom: 1px solid #e5e5e5;
}

.furniture-index-container .home-categories-title {
    margin: 0;
    font-weight: 600;
    line-height: 1.2;
    text-align: left;
}

/* Furniture types — circular icon grid (like homepage departments) */
.furniture-types-grid {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 18px 12px;
}

.furniture-type-item {
    text-align: center;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.furniture-type-item:hover {
    text-decoration: none;
    color: inherit;
}

.furniture-type-icon {
    width: 120px;
    height: 120px;
    border: 3px solid #e5e5e5;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: border-color 0.25s ease, transform 0.25s ease;
}

.furniture-type-item:hover .furniture-type-icon {
    border-color: #febd69;
    transform: translateY(-2px);
}

.furniture-type-icon img {
    width: 82%;
    height: 82%;
    object-fit: contain;
    display: block;
}

.furniture-type-name {
    display: inline-block;
    margin-top: 8px;
    text-align: center;
    font-size: 14px;
    line-height: 1.25;
    color: #222;
}

.furniture-type-item:hover .furniture-type-name {
    color: #000;
    text-decoration: underline;
}

/* Categories section (Pomieszczenia) */
.furniture-categories-section {
    margin-top: 40px;
}

.furniture-categories-section .row {
    margin-top: 0;
}

/* Category cards — same styles as category/index (.category-grid .category-card) */
.furniture-categories-section .category-card {
    margin-bottom: 30px;
}

.furniture-categories-section .category-card a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.furniture-categories-section .category-card .category-card-img {
    width: 100%;
    aspect-ratio: 5 / 3;
    object-fit: cover;
    border-radius: 4px;
    transition: opacity 0.2s ease;
    display: block;
}

.furniture-categories-section .category-card a:hover .category-card-img {
    opacity: 0.85;
}

.furniture-categories-section .category-card .category-card-name {
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    margin-top: 12px;
    margin-bottom: 0;
}

/* SEO section for index page — reuse show page styles */
.furniture-index-container .furniture-seo-section {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid #eee;
}

/* Mobile collapsible SEO text */
.furniture-seo-collapse {
    transition: max-height 0.4s ease;
}

.furniture-seo-toggle {
    display: none;
}

/* ===== Furniture Index Responsive ===== */
@media (max-width: 991px) {
    .furniture-types-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 14px 10px;
    }

    .furniture-type-icon {
        width: 92px;
        height: 92px;
    }

    .furniture-index-container .home-categories-header {
        flex-wrap: wrap;
        row-gap: 4px;
    }

    .furniture-seo-collapse {
        max-height: 200px;
        overflow: hidden;
        position: relative;
    }

    .furniture-seo-collapse::after {
        content: "";
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        height: 60px;
        background: linear-gradient(to bottom, rgba(255,255,255,0), #fff);
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    .furniture-seo-collapse.is-expanded {
        max-height: none;
    }

    .furniture-seo-collapse.is-expanded::after {
        opacity: 0;
    }

    .furniture-seo-toggle {
        display: inline-block;
        margin-top: 10px;
        font-size: 14px;
        font-weight: 600;
        color: #f97130;
        cursor: pointer;
        background: none;
        border: none;
        padding: 0;
    }

    .furniture-seo-toggle:hover {
        text-decoration: underline;
    }
}

@media (max-width: 480px) {
    .furniture-types-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 12px 10px;
    }

    .furniture-type-icon {
        width: 80px;
        height: 80px;
    }

    .furniture-type-name {
        font-size: 12px;
    }
}

/* ===== Furniture Type Show Page ===== */

.furniture-container {
    padding-top: 24px;
    padding-bottom: 40px;
}

/* Section header – reused from homepage */
.furniture-container .home-categories-header {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin: 0 0 20px;
    padding: 0 0 15px;
    border-style: solid;
    border-width: 0 0 1px 0;
    border-color: #e5e5e5;
}

.furniture-container .home-categories-title {
    margin: 0;
    font-weight: 600;
    line-height: 1.2;
    text-align: left;
}

.furniture-product-count {
    font-weight: 400;
    font-size: 14px;
    color: #888;
}

/* Toolbar: filter button + sort dropdown (inside header) */
.furniture-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.btn-filter-open {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}

.btn-filter-open:hover {
    border-color: #333;
    color: #000;
}

.btn-filter-open svg {
    width: 16px;
    height: 16px;
}

.furniture-toolbar .sort-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px 32px 8px 12px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.furniture-toolbar .sort-select:hover {
    border-color: #333;
}

.furniture-toolbar .sort-select:focus {
    outline: none;
    border-color: #333;
}

/* ===== Filter Sidebar ===== */
.filter-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.filter-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 340px;
    max-width: 90vw;
    height: 100%;
    background: #fff;
    z-index: 9999;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.filter-sidebar.active {
    transform: translateX(0);
}

.filter-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.filter-sidebar-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.filter-sidebar-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.filter-sidebar-close:hover {
    color: #000;
}

.filter-sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.filter-sidebar-footer {
    display: flex;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid #eee;
    flex-shrink: 0;
}

.btn-filter-apply {
    flex: 1;
    padding: 10px 20px;
    background: #333;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-filter-apply:hover {
    background: #000;
}

.btn-filter-clear {
    padding: 10px 20px;
    background: transparent;
    color: #666;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}

.btn-filter-clear:hover {
    border-color: #333;
    color: #333;
}

/* Filter items inside sidebar (vertical layout) */
.filter-sidebar-body .filter-item {
    margin-bottom: 24px;
}

.filter-sidebar-body .filter-box-heading {
    color: #333;
    text-transform: uppercase;
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filter-sidebar-body .filter-range-text {
    font-weight: 400;
    color: #888;
}

.filter-sidebar-body .filter-content {
    width: 100%;
}

.filter-sidebar-body .filter-checkboxes {
    max-height: 200px;
    overflow-y: auto;
}

.filter-sidebar-body .filter-checkbox-item {
    margin-bottom: 6px;
    font-size: 13px;
}

.filter-sidebar-body .filter-checkbox-item label {
    display: flex;
    align-items: center;
    cursor: pointer;
    gap: 6px;
}

.filter-sidebar-body .filter-checkbox-item a {
    color: #333;
    text-decoration: none;
}

.filter-sidebar-body .filter-checkbox-item a:hover {
    color: #fe696a;
}

.filter-sidebar-body .filter-count {
    color: #999;
    font-size: 12px;
}

.filter-sidebar-body .range-slider {
    width: 100%;
    margin-top: 8px;
}

/* jQuery UI slider overrides */
.filter-sidebar-body .ui-slider {
    background: #e5e5e5;
    border: none;
    height: 4px;
    border-radius: 2px;
}

.filter-sidebar-body .ui-slider .ui-slider-range {
    background: #333;
}

.filter-sidebar-body .ui-slider .ui-slider-handle {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #333;
    top: -7px;
    cursor: pointer;
}

.filter-sidebar-body .ui-slider .ui-slider-handle:focus {
    outline: none;
}

/* ===== Related categories tags ===== */
.furniture-related {
    padding: 30px 0 0;
    margin-top: 16px;
    border-top: 1px solid #eee;
}

.furniture-related .home-categories-header {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin: 0 0 16px;
    padding: 0 0 12px;
    border-bottom: 1px solid #e5e5e5;
}

.furniture-related .home-categories-title {
    margin: 0;
    font-weight: 600;
    line-height: 1.2;
}

.furniture-related-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.furniture-related-tag {
    display: inline-block;
    padding: 8px 16px;
    background-color: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    color: #555;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.furniture-related-tag:hover {
    background-color: #fff;
    border-color: #333;
    color: #333;
    text-decoration: none;
}

/* ===== SEO section ===== */
.furniture-seo-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #eee;
}

.furniture-seo-section h2 {
    font-size: 19px;
    font-weight: 600;
    color: #333;
    margin-top: 24px;
    margin-bottom: 14px;
}

.furniture-seo-section p {
    margin-bottom: 14px;
    font-size: 14px;
    line-height: 1.75;
    color: #555;
}

.furniture-seo-section ul,
.furniture-seo-section ol {
    list-style: disc;
    padding-left: 40px;
    margin-bottom: 1em;
}

.furniture-seo-section ol {
    list-style: decimal;
}

.furniture-seo-section li {
    margin-bottom: 6px;
    font-size: 14px;
    line-height: 1.7;
    color: #555;
}

.furniture-seo-section table {
    border-collapse: collapse;
    width: 100%;
    margin: 1em 0;
}

.furniture-seo-section table th,
.furniture-seo-section table td {
    border: 1px solid #ccc;
    padding: 8px;
    text-align: left;
}

.furniture-seo-section table th {
    background-color: #f5f5f5;
    font-weight: bold;
}

.furniture-seo-section strong {
    color: #333;
}

/* ===== Responsive ===== */
@media (max-width: 767px) {
    .furniture-container .home-categories-header {
        flex-wrap: wrap;
        row-gap: 4px;
    }

    .filter-sidebar {
        width: 100%;
        max-width: 100%;
    }
}
