/* ========================================
   Tablet Archive
======================================== */

.tt-wrapper {
    width: 100%;
    max-width: 1300px;
    margin: 40px auto;
    padding: 20px;
    box-sizing: border-box;
}


/* ========================================
   Tablet Grid
======================================== */

.tt-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    align-items: stretch;
}


/* ========================================
   Tablet Card
======================================== */

.tt-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 16px;
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 0;
    height: 100%;
    min-width: 0;
    box-sizing: border-box;
    transition: transform .2s ease, box-shadow .2s ease;
}

.tt-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, .07);
}


/* ========================================
   Card Image
======================================== */

.tt-image {
    width: 100%;
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    overflow: hidden;
}

.tt-image img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}


/* ========================================
   Card Title
======================================== */

.tt-card h2 {
    margin: 0 0 16px;
    min-height: 72px;
    font-size: 25px;
    line-height: 1.25;
    overflow-wrap: anywhere;
}


/* ========================================
   Brand + Price
======================================== */

.tt-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    min-height: 40px;
    margin: 0 0 20px;
    flex-wrap: nowrap;
}

.tt-brand {
    display: inline-flex;
    align-items: center;
    max-width: 50%;
    padding: 7px 12px;
    border-radius: 20px;
    background: #f3f4f6;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tt-price {
    margin-left: auto;
    color: #0b8f3b;
    font-size: 21px;
    font-weight: 700;
    white-space: nowrap;
}


/* ========================================
   Specs
======================================== */

.tt-specs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 0 0 20px;
}

.tt-specs span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 68px;
    padding: 8px 6px;
    background: #f8f8f8;
    border: 1px solid #ececec;
    border-radius: 10px;
    text-align: center;
    font-size: 13px;
    line-height: 1.35;
    overflow-wrap: anywhere;
    box-sizing: border-box;
}


/* ========================================
   View Specs
======================================== */

.tt-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    margin-top: auto;
    padding: 10px 18px;
    background: #2563eb;
    color: #fff !important;
    border-radius: 10px;
    text-align: center;
    text-decoration: none;
    font-weight: 600;
    box-sizing: border-box;
}

.tt-button:hover {
    background: #1d4ed8;
}


/* ========================================
   Main Layout
======================================== */

.tt-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 32px;
}

.tt-sidebar {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 16px;
    padding: 20px;
    position: sticky;
    top: 20px;
    margin-bottom: 16px;
    box-sizing: border-box;
}

.tt-content {
    min-width: 0;
}


/* ========================================
   Filters
======================================== */

.tt-filter-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    cursor: pointer;
}

.tt-filter-item input {
    width: 18px;
    height: 18px;
}


/* ========================================
   Toolbar
======================================== */

.tt-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 25px;
    padding: 15px 20px;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    box-sizing: border-box;
}

.tt-results {
    flex: 1;
    min-width: 0;
    font-size: 15px;
    font-weight: 600;
}


/* ========================================
   Search
======================================== */

.tt-search {
    flex: 1;
    width: 100%;
    max-width: 420px;
    min-width: 0;
}

.tt-search input {
    display: block;
    width: 100%;
    min-width: 0;
    padding: 11px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    outline: none;
    box-sizing: border-box;
}

.tt-search input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.08);
}


/* ========================================
   Sort
======================================== */

.tt-sort {
    flex: 0 0 200px;
    width: 200px;
    min-width: 200px;
    box-sizing: border-box;
}

.tt-sort select,
#tt-sort {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    color: #1f2937;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    box-sizing: border-box;
    cursor: pointer;
}


/* ========================================
   Price Filter
======================================== */

.tt-price-filter {
    margin-top: 15px;
    width: 100%;
    box-sizing: border-box;
}

.tt-price-filter input[type="range"] {
    width: 100%;
    margin: 10px 0;
    cursor: pointer;
}

.tt-price-values {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 10px;
    font-size: 14px;
    font-weight: 600;
}

.tt-price-values span {
    background: #f5f5f5;
    padding: 6px 10px;
    border-radius: 8px;
    white-space: nowrap;
}


/* ========================================
   Price Slider
======================================== */

#price-slider {
    margin: 20px 8px 30px;
}

#price-slider .noUi-connect {
    background: #2563eb;
}

#price-slider .noUi-handle {
    width: 18px;
    height: 18px;
    right: -9px;
    top: -7px;
    border-radius: 50%;
    border: 2px solid #2563eb;
    background: #fff;
    box-shadow: none;
    cursor: grab;
}

#price-slider .noUi-handle::before,
#price-slider .noUi-handle::after {
    display: none;
}

#price-slider .noUi-handle:active {
    cursor: grabbing;
}

#price-slider .noUi-target {
    border: 0;
    box-shadow: none;
}

#price-slider .noUi-base {
    background: #e5e7eb;
    border-radius: 10px;
}


/* ========================================
   Clear Filters
======================================== */

.tt-clear-filters {
    width: 100%;
    padding: 10px 14px;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    color: #333;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: .2s ease;
    box-sizing: border-box;
}

.tt-clear-filters:hover {
    background: #f5f5f5;
    border-color: #bbb;
}


/* ========================================
   Pagination
======================================== */

.tt-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 40px 0;
    flex-wrap: wrap;
}

.tt-pagination button {
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    color: #333;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: .2s ease;
}

.tt-pagination button:hover {
    border-color: #2563eb;
    color: #2563eb;
}

.tt-pagination button.active {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}


/* ========================================
   Mobile Filter Toggle
======================================== */

.tt-filter-toggle {
    display: none;
}


/* ========================================
   Mobile Archive
======================================== */

@media (max-width: 767px) {

    /* Wrapper */

    .tt-wrapper {
        width: 100%;
        max-width: 100%;
        margin: 20px 0;
        padding: 15px;
        box-sizing: border-box;
        overflow-x: hidden;
    }


    /* Layout */

    .tt-layout {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
    }


    /* Sidebar */

    .tt-sidebar {
        position: static !important;
        float: none !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        margin: 0 0 25px 0 !important;
        padding: 0 !important;
        box-sizing: border-box !important;
        z-index: auto !important;
    }


    /* Content */

    .tt-content {
        position: static !important;
        float: none !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        box-sizing: border-box !important;
    }


    /* Grid */

    .tt-grid {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        width: 100% !important;
        max-width: 100% !important;
        gap: 16px;
        margin: 0 !important;
        padding: 0 !important;
    }


    /* Cards */

    .tt-card {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        padding: 18px;
        border-radius: 12px;
        box-sizing: border-box !important;
    }


    /* Images */

    .tt-image {
        height: 200px;
        margin-bottom: 14px;
    }

    .tt-image img {
        display: block;
        width: auto;
        max-width: 100%;
        max-height: 200px;
        height: auto;
        margin: 0 auto;
        object-fit: contain;
    }


    /* Card Title */

    .tt-card h2 {
        min-height: 0;
        margin: 0 0 16px;
        font-size: 22px;
        line-height: 1.3;
    }


    /* Brand + Price */

    .tt-meta {
        margin-bottom: 16px;
        gap: 10px;
        flex-wrap: wrap;
    }

    .tt-brand {
        max-width: 50%;
    }

    .tt-price {
        font-size: 20px;
    }


    /* Specs */

    .tt-specs {
        gap: 7px;
        margin-bottom: 16px;
    }

    .tt-specs span {
        min-height: 60px;
        padding: 7px 5px;
        font-size: 12px;
    }


    /* Button */

    .tt-button {
        min-height: 46px;
    }


    /* ========================================
       Mobile Toolbar
    ======================================== */

    .tt-toolbar {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
        width: 100% !important;
        max-width: 100% !important;
        margin-bottom: 20px !important;
        padding: 15px !important;
        box-sizing: border-box !important;
    }


    .tt-results {
        display: block;
        width: 100%;
        padding: 0;
        margin: 0;
        font-size: 14px;
        box-sizing: border-box;
    }


    /* Search */

    .tt-search {
        display: block;
        flex: none;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        margin: 0;
        box-sizing: border-box;
    }

    .tt-search input {
        display: block;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        height: 44px;
        box-sizing: border-box;
    }


    /* Sort */

    .tt-sort {
        display: block;
        flex: none !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 0;
        box-sizing: border-box;
    }

    .tt-sort select,
    #tt-sort {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        height: 44px;
        padding: 10px 14px;
        box-sizing: border-box;
    }


    /* Price */

    .tt-price-filter {
        width: 100%;
        box-sizing: border-box;
    }


    /* Clear button */

    .tt-clear-filters {
        margin-bottom: 10px;
    }


    /* ========================================
       Mobile Filter Toggle
    ======================================== */

    .tt-filter-toggle {
        display: flex;
        width: 100%;
        align-items: center;
        justify-content: space-between;
        padding: 12px 14px;
        margin-bottom: 12px;
        border: 1px solid #ddd;
        border-radius: 8px;
        background: #fff;
        color: #1f2937;
        font-family: inherit;
        font-size: 15px;
        font-weight: 600;
        cursor: pointer;
        box-sizing: border-box;
    }

    .tt-filter-toggle span {
        font-size: 20px;
        line-height: 1;
    }

    .tt-filter-panel {
        display: none;
    }

    .tt-filter-panel.is-open {
        display: block;
    }


    /* ========================================
       Mobile Filter Groups
    ======================================== */

    .tt-filter-group {
        padding: 16px 14px;
        border-bottom: 1px solid #eee;
        box-sizing: border-box;
    }

    .tt-filter-group h3 {
        margin: 0 0 12px;
        font-size: 16px;
        line-height: 1.4;
    }

    .tt-filter-item {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 7px 0;
        margin-bottom: 0;
        font-size: 14px;
    }

    .tt-filter-item input[type="checkbox"] {
        width: 18px;
        height: 18px;
        flex: 0 0 18px;
    }


    /* ========================================
       Mobile Pagination
    ======================================== */

    .tt-pagination {
        gap: 6px;
        margin: 30px 0;
    }

    .tt-pagination button {
        min-width: 36px;
        height: 36px;
        padding: 0 9px;
        font-size: 13px;
    }

}


/* ========================================
   Desktop Sort Width
======================================== */

@media (min-width: 768px) {

    .tt-sort {
        flex: 0 0 200px;
        width: 200px;
        min-width: 200px;
    }

    .tt-sort select,
    #tt-sort {
        width: 100%;
        min-width: 0;
    }

}


/* ========================================
   No Results
======================================== */

.tt-no-results {
    padding: 50px 20px;
    text-align: center;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    background: #fff;
    margin-bottom: 24px;
}

.tt-no-results h3 {
    margin: 0 0 8px;
    font-size: 20px;
}

.tt-no-results p {
    margin: 0;
    color: #666;
    font-size: 14px;
}


/* ========================================
   Selected Filter Count
======================================== */

.tt-filter-count {
    float: right;
    font-size: 12px;
    font-weight: 500;
    color: #666;
}

@media (max-width: 767px) {

    .tt-filter-count {
        font-size: 11px;
    }

}


/* ========================================
   Desktop Filter Spacing
======================================== */

@media (min-width: 768px) {

    /* Filter sidebar */

    .tt-sidebar {
        padding: 20px;
    }


    /* Filter groups */

    .tt-filter-group {
        padding: 0 0 18px;
        margin: 0 0 18px;
        border-bottom: 1px solid #eee;
    }


    /* Filter headings */

    .tt-filter-group h3 {
        margin: 0 0 12px;
        font-size: 20px;
        line-height: 1.4;
        font-weight: 700;
    }


    /* Selected count */

    .tt-filter-count {
        float: right;
        margin-top: 4px;
        font-size: 12px;
        line-height: 1.4;
        font-weight: 500;
        color: #666;
    }


    /* Checkbox rows */

    .tt-filter-item {
        display: flex;
        align-items: center;
        gap: 9px;
        margin: 0;
        padding: 6px 0;
        min-height: 30px;
        line-height: 1.4;
        box-sizing: border-box;
    }


    /* Checkboxes */

    .tt-filter-item input[type="checkbox"] {
        width: 18px;
        height: 18px;
        margin: 0;
        flex: 0 0 18px;
    }


    /* Price group */

    .tt-filter-group[data-filter="price"] {
        padding-bottom: 4px;
        margin-bottom: 0;
        border-bottom: 0;
    }


    .tt-filter-group[data-filter="price"] h3 {
        margin-bottom: 14px;
    }


    /* Price slider */

    .tt-price-filter {
        margin-top: 0;
    }


    #price-slider {
        margin: 18px 8px 26px;
    }


    /* Price values */

    .tt-price-values {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 10px;
        margin-top: 0;
    }


    .tt-price-values span {
        padding: 7px 10px;
        font-size: 13px;
        line-height: 1.3;
    }

}