/* ============================================================
   TT Archive Product – Custom Layout CSS
   Place at: assets/css/archive-product.css
   ============================================================ */

/* ── Variables ────────────────────────────────────────────── */
:root {
    --tt-primary: #0d9948;
    --tt-primary-dark: #043318;
    --tt-border:       #e8e8e8;
    --tt-bg-light:     #f8f8f8;
    --tt-text:         #333;
    --tt-text-muted:   #777;
    --tt-radius:       6px;
    --tt-sidebar-w:    280px;
    --tt-gap:          24px;
}

/* ── Page wrapper ─────────────────────────────────────────── */
.tt-archive-product-page {
    padding: 30px 0 60px;
}

/* ── Layout ───────────────────────────────────────────────── */
.tt-archive-layout {
    display: grid;
    grid-template-columns: var(--tt-sidebar-w) 1fr;
    gap: var(--tt-gap);
    align-items: start;
}

@media (max-width: 1024px) {
    .tt-archive-layout {
        grid-template-columns: 240px 1fr;
    }
}

@media (max-width: 768px) {
    .tt-archive-layout {
        grid-template-columns: 1fr;
    }
    .tt-archive-sidebar {
        order: 2;
    }
    .tt-archive-main {
        order: 1;
    }
}

/* ══════════════════════════════════════════════════════════
   SIDEBAR
══════════════════════════════════════════════════════════ */
.tt-archive-sidebar {
    position: sticky;
    top: 80px;
}

.tt-filter-box {
    border: 1px solid var(--tt-border);
    border-radius: var(--tt-radius);
    padding: 18px 20px;
    margin-bottom: 20px;
    background: #fff;
}

.tt-filter-heading {
    font-size: 15px;
    font-weight: 700;
    color: var(--tt-text);
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--tt-primary);
    text-transform: uppercase;
    letter-spacing: .4px;
}

.tt-filter-sub-heading {
    font-size: 13px;
    font-weight: 600;
    color: var(--tt-text-muted);
    text-transform: uppercase;
    letter-spacing: .3px;
    margin: 0 0 10px;
}

/* ── Category list ────────────────────────────────────────── */
.tt-cat-list,
.tt-sub-cat-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.tt-cat-item {
    border-bottom: 1px solid var(--tt-border);
    margin: 0;
}
.tt-cat-item:last-child { border-bottom: none; }

.tt-cat-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 4px;
    font-size: 14px;
    color: var(--tt-text);
    text-decoration: none;
    cursor: pointer;
    transition: color .2s;
}
.tt-cat-link:hover { color: var(--tt-primary); }

.tt-cat-item.is-active > .tt-cat-link {
    color: var(--tt-primary);
    font-weight: 700;
}

.tt-cat-count {
    font-size: 12px;
    color: var(--tt-text-muted);
    margin-left: auto;
}

.tt-cat-arrow {
    font-size: 18px;
    line-height: 1;
    color: var(--tt-text-muted);
    transition: transform .25s;
    margin-left: 4px;
}
.tt-cat-item.has-children.is-open > .tt-cat-link .tt-cat-arrow {
    transform: rotate(90deg);
}

/* Sub category */
.tt-sub-cat-list {
    display: none;
    padding-left: 14px;
    border-top: 1px solid var(--tt-border);
}
.tt-sub-cat-list.is-open { display: block; }
.tt-sub-cat-list li { border-bottom: 1px solid var(--tt-border); }
.tt-sub-cat-list li:last-child { border-bottom: none; }
.tt-sub-cat-list .tt-cat-link { font-size: 13px; padding: 7px 4px; }
.tt-sub-cat-list li.is-active .tt-cat-link {
    color: var(--tt-primary);
    font-weight: 600;
}

/* ── Brand checkboxes ─────────────────────────────────────── */
.tt-brand-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.tt-brand-list li { margin-bottom: 8px; }

.tt-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: var(--tt-text);
    user-select: none;
}
.tt-checkbox-label input[type="checkbox"] {
    display: none;
}
.tt-checkbox-custom {
    width: 16px;
    height: 16px;
    min-width: 16px;
    border: 2px solid var(--tt-border);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s, border-color .2s;
}
.tt-checkbox-label input:checked + .tt-checkbox-custom {
    background: var(--tt-primary);
    border-color: var(--tt-primary);
}
.tt-checkbox-label input:checked + .tt-checkbox-custom::after {
    content: '';
    width: 8px;
    height: 5px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(-45deg) translate(1px, -1px);
}
.tt-checkbox-text { flex: 1; }

/* ── Price slider ─────────────────────────────────────────── */
.tt-price-slider-wrap {
    padding: 10px 4px 16px;
}

#tt-price-slider {
    margin-bottom: 16px;
}

/* noUiSlider overrides */
.noUi-target {
    background: var(--tt-border);
    border: none;
    box-shadow: none;
    height: 4px;
}
.noUi-connect {
    background: var(--tt-primary);
}
.noUi-handle {
    width: 18px !important;
    height: 18px !important;
    top: -7px !important;
    border-radius: 50% !important;
    background: var(--tt-primary) !important;
    border: 3px solid #fff !important;
    box-shadow: 0 1px 4px rgba(0,0,0,.25) !important;
    cursor: pointer;
}
.noUi-handle::before,
.noUi-handle::after { display: none !important; }

.tt-price-range-display {
    font-size: 13px;
    color: var(--tt-text-muted);
}

.tt-filter-btn {
    display: block;
    width: 100%;
    padding: 9px 14px;
    background: var(--tt-primary);
    color: #fff;
    border: none;
    border-radius: var(--tt-radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
    text-align: center;
}
.tt-filter-btn:hover { background: var(--tt-primary-dark); }

/* ══════════════════════════════════════════════════════════
   TOOLBAR
══════════════════════════════════════════════════════════ */
.tt-archive-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    background: var(--tt-bg-light);
    border: 1px solid var(--tt-border);
    border-radius: var(--tt-radius);
    padding: 10px 14px;
    margin-bottom: 20px;
}

.tt-toolbar-left,
.tt-toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* View switcher */
.tt-view-switcher {
    display: flex;
    gap: 4px;
}
.tt-view-btn {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--tt-border);
    border-radius: 4px;
    background: #fff;
    color: var(--tt-text-muted);
    cursor: pointer;
    transition: all .2s;
    margin: 0 !important;
    padding: 0;
    width: 2.4rem;
    height: 2.4rem;
    min-height: unset;
}
.tt-view-btn:hover,
.tt-view-btn.is-active {
    background: var(--tt-primary);
    border-color: var(--tt-primary);
    color: #fff;
}

.tt-result-count {
    font-size: 13px;
    color: var(--body-cl);
}

/* Select */
.tt-select-wrap { position: relative; }
.tt-select {
    appearance: none;
    -webkit-appearance: none;
    padding: 7px 30px 7px 10px;
    border: 1px solid var(--tt-border);
    border-radius: 4px;
    font-size: 13px;
    color: var(--tt-text);
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23777' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 10px center;
    cursor: pointer;
    outline: none;
    transition: border-color .2s;
    height: 2.4rem;
    margin: 0;
}
.tt-select:focus { border-color: var(--tt-primary); }

/* Pagination info */
.tt-pagination-info {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--tt-text-muted);
}
.tt-page-btn {
    width: 2.4rem;
    height: 2.4rem;
    border: 1px solid var(--tt-border);
    border-radius: 4px;
    background: #fff;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s;
    margin: 0;
}
.tt-page-btn:hover:not(:disabled) {
    background: var(--tt-primary);
    border-color: var(--tt-primary);
    color: #fff;
}
.tt-page-btn:disabled {
    opacity: .4;
    cursor: not-allowed;
}

/* ══════════════════════════════════════════════════════════
   PRODUCTS GRID / LIST
══════════════════════════════════════════════════════════ */
.tt-products-wrap {
    min-height: 300px;
    position: relative;
    transition: opacity .25s;
}
.tt-products-wrap.is-loading {
    opacity: .4;
    pointer-events: none;
}
.tt-products-wrap.is-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.6);
    z-index: 5;
}

/* Grid mode - inherit Flatsome grid cols */
.tt-view-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
@media (max-width: 900px) {
    .tt-view-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .tt-view-grid {grid-template-columns: 1fr 1fr;}
}

/* List mode */
.tt-view-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.tt-view-list .product-small.col {
    width: 100% !important;
}
.tt-view-list .product-small .col-inner {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}
.tt-view-list .product-small .box-image {
    width: 200px;
    min-width: 200px;
    flex-shrink: 0;
}
.tt-view-list .product-small .box-text {
    flex: 1;
    text-align: left !important;
    padding: 10px 0 !important;
}
@media (max-width: 600px) {
    .tt-view-list .product-small .box-image { width: 120px; min-width: 120px; }
    .tt-select-wrap:nth-child(1) {
        width: 100%;
    }

    .tt-archive-product-page {
        padding-top: 0;
        padding-bottom: 0 !important;
    }
}

/* No products */
.tt-no-products {
    grid-column: 1 / -1;
    padding: 60px 20px;
    text-align: center;
    color: var(--tt-text-muted);
    font-size: 15px;
    border: 1px dashed var(--tt-border);
    border-radius: var(--tt-radius);
}

/* ══════════════════════════════════════════════════════════
   NUMBERED PAGINATION
══════════════════════════════════════════════════════════ */
.tt-archive-pagination {
    margin-top: 32px;
}
.tt-archive-pagination .page-numbers {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
}
.tt-archive-pagination .page-numbers li { margin: 0; }
.tt-archive-pagination .page-numbers a,
.tt-archive-pagination .page-numbers span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border: 1px solid var(--tt-border);
    border-radius: 4px;
    font-size: 13px;
    color: var(--tt-text);
    text-decoration: none;
    background: #fff;
    transition: all .2s;
}
.tt-archive-pagination .page-numbers a:hover {
    background: var(--tt-primary);
    border-color: var(--tt-primary);
    color: #fff;
}
.tt-archive-pagination .page-numbers .current {
    background: var(--tt-primary);
    border-color: var(--tt-primary);
    color: #fff;
}
.post-type-archive-product .category-filtering [data-open="#shop-sidebar"] {
    display: none;
}

.page-title-inner .flex-col.medium-text-center:last-child {
    display: none;
}

div#tt-products-container {}

.tt-products-wrap.tt-view-list .product-small.box {
    display: flex;
    align-items: center;
}

.tt-products-wrap.tt-view-list .product-small+.product-small {
    border-top: 1px solid #3333333b;
}