/* Product list: filter panel (.ttf-*) and results (.ttr-*) — Views/Content/List.cshtml */

/* list-specific names mapped onto the site tokens (site.css), so filters and results share the storefront colours */
:root {
    --tt-primary: var(--tt-accent);
    --tt-primary-dark: var(--tt-accent-dark);
    --tt-primary-soft: var(--tt-accent-soft);
    --tt-primary-ring: rgba(255, 107, 53, .25);
    --tt-text: var(--tt-ink);
    --tt-surface: #fff;
    --tt-subtle: var(--tt-bg-soft);
}

/* ---------- Page header ---------- */
.pl-header {
    background: #fff;
    border-bottom: 1px solid var(--tt-border);
    padding: 18px 0 22px;
}

.pl-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    margin-bottom: 14px;
    font-size: 13px;
    color: var(--tt-muted);
}

.pl-breadcrumb a { color: var(--tt-muted); text-decoration: none; }
.pl-breadcrumb a:hover { color: var(--tt-accent); }
.pl-breadcrumb i { font-size: 12px; color: #b5bec7; }
.pl-breadcrumb span { color: var(--tt-ink); font-weight: 600; }

.pl-header-main {
    display: flex;
    align-items: center;
    gap: 18px;
}

.pl-header-media {
    flex-shrink: 0;
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: var(--tt-bg-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.pl-header-media img {
    max-width: 72%;
    max-height: 72%;
    object-fit: contain;
}

.pl-title {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
    margin: 0;
    padding-right: 14px;
    font-size: 28px;
    font-weight: 800;
    color: var(--tt-ink);
}

.pl-title::before {
    content: "";
    position: absolute;
    right: 0;
    top: 15%;
    bottom: 15%;
    width: 5px;
    border-radius: 3px;
    background: var(--tt-accent);
}

.pl-title-brand {
    padding: 4px 14px;
    border-radius: 999px;
    background: var(--tt-accent-soft);
    color: var(--tt-accent-dark);
    font-size: 15px;
    font-weight: 700;
}

.pl-subtitle {
    margin: 6px 0 0;
    max-width: 760px;
    font-size: 15px;
    line-height: 1.7;
    color: var(--tt-muted);
}

/* brand page: "shop this brand by section" links (Views/Content/Brand.cshtml) */
.pl-sections { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.pl-section-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border-radius: 18px;
    background: #fff;
    border: 1px solid #e5e7eb;
    color: var(--tt-ink, #1f2937);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all .15s ease;
}
.pl-section-link:hover { border-color: #ffd2bf; background: var(--tt-primary-soft); color: var(--tt-primary-dark); text-decoration: none; }
.pl-section-count { min-width: 22px; padding: 1px 7px; border-radius: 11px; background: #f3f4f6; color: var(--tt-muted); font-size: 12px; text-align: center; }
.pl-section-link:hover .pl-section-count { background: #fff; }

@media (max-width: 575.98px) {
    .pl-header { padding: 12px 0 16px; }
    .pl-breadcrumb { margin-bottom: 10px; }
    .pl-header-media { width: 52px; height: 52px; }
    .pl-title { font-size: 21px; }
    .pl-subtitle {
        font-size: 13px;
        /* long category intros push the products down on a phone */
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
}

.products-main-content {
    padding: 24px 0 32px;
    background: var(--tt-bg-soft);
    min-height: 60vh;
}

.tt-sr {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* ---------- Filter panel ---------- */

.ttf-panel {
    background: var(--tt-surface);
    border-radius: var(--tt-radius);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .06), 0 6px 24px rgba(0, 0, 0, .04);
    display: flex;
    flex-direction: column;
}

.ttf-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--tt-border);
}

.ttf-title {
    flex: 1;
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--tt-text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.ttf-title i { color: var(--tt-primary); }

.ttf-clear {
    font-size: 13px;
    font-weight: 600;
    color: var(--tt-primary);
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 6px;
}

.ttf-clear:hover,
.ttf-clear:focus-visible { background: var(--tt-primary-soft); color: var(--tt-primary-dark); text-decoration: none; }

.ttf-close {
    display: none;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: var(--tt-subtle);
    color: var(--tt-text);
    font-size: 16px;
    cursor: pointer;
}

.ttf-body { padding: 4px 18px; }

.ttf-sec { border-bottom: 1px solid var(--tt-border); }
.ttf-sec:last-child { border-bottom: 0; }

.ttf-sec-h { margin: 0; font-size: inherit; }

.ttf-sec-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 0;
    border: 0;
    background: none;
    color: var(--tt-text);
    font-size: 14px;
    font-weight: 700;
    text-align: start;
    cursor: pointer;
}

.ttf-sec-btn > span:first-child { flex: 1; }

.ttf-sec-btn .fa-chevron-down {
    font-size: 11px;
    color: var(--tt-muted);
    transition: transform .2s ease;
}

.ttf-sec-btn[aria-expanded="false"] .fa-chevron-down { transform: rotate(90deg); }
[dir="rtl"] .ttf-sec-btn[aria-expanded="false"] .fa-chevron-down { transform: rotate(-90deg); }

.ttf-sec-badge {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: var(--tt-primary);
    color: #fff;
    font-size: 11px;
    line-height: 20px;
    text-align: center;
}

.ttf-sec-body { padding-bottom: 14px; }
.ttf-sec-body[hidden] { display: none; }

.ttf-note {
    margin: -4px 0 8px;
    font-size: 12px;
    color: var(--tt-muted);
}

/* options (checkbox rows) */
.ttf-opts {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ttf-opts.is-collapsed .ttf-opt.is-extra:not(.is-match) { display: none; }
.ttf-opt.is-hidden { display: none; }

.ttf-opt label {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 7px 8px;
    border-radius: 8px;
    font-weight: 400;
    cursor: pointer;
    transition: background-color .15s ease;
}

.ttf-opt label:hover { background: var(--tt-subtle); }

.ttf-opt input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.ttf-box {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    border: 2px solid #c7ccd6;
    border-radius: 5px;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all .15s ease;
}

.ttf-opt input:checked + .ttf-box {
    background: var(--tt-primary);
    border-color: var(--tt-primary);
}

.ttf-opt input:checked + .ttf-box::after {
    content: '';
    width: 5px;
    height: 9px;
    margin-top: -2px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.ttf-opt input:focus-visible + .ttf-box { box-shadow: 0 0 0 3px var(--tt-primary-ring); }

.ttf-label {
    flex: 1;
    font-size: 14px;
    color: #374151;
    line-height: 1.4;
}

.ttf-opt input:checked ~ .ttf-label { color: var(--tt-text); font-weight: 600; }

.ttf-count {
    font-size: 12px;
    color: var(--tt-muted);
    background: var(--tt-subtle);
    border-radius: 10px;
    padding: 1px 8px;
    font-variant-numeric: tabular-nums;
}

.ttf-opt.is-empty label { cursor: not-allowed; }
.ttf-opt.is-empty .ttf-label,
.ttf-opt.is-empty .ttf-count { opacity: .45; }
.ttf-opt.is-empty label:hover { background: none; }

/* switch rows (availability & offers) */
.ttf-switch .ttf-box {
    width: 34px;
    height: 20px;
    border-radius: 10px;
    border: 0;
    background: #d1d5db;
    position: relative;
}

.ttf-switch .ttf-box::before {
    content: '';
    position: absolute;
    top: 2px;
    inset-inline-start: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
    transition: inset-inline-start .15s ease;
}

.ttf-switch input:checked + .ttf-box { background: var(--tt-primary); }
.ttf-switch input:checked + .ttf-box::after { content: none; }
.ttf-switch input:checked + .ttf-box::before { inset-inline-start: 16px; }

/* brand search + show more */
.ttf-search {
    position: relative;
    margin-bottom: 8px;
}

.ttf-search input {
    width: 100%;
    height: 38px;
    padding-block: 0;
    padding-inline: 34px 12px;
    border: 1px solid var(--tt-border);
    border-radius: 8px;
    font-size: 13px;
    background: var(--tt-subtle);
}

.ttf-search input:focus {
    outline: none;
    border-color: var(--tt-primary);
    background: #fff;
    box-shadow: 0 0 0 3px var(--tt-primary-ring);
}

.ttf-search i {
    position: absolute;
    top: 50%;
    inset-inline-start: 12px;
    transform: translateY(-50%);
    color: var(--tt-muted);
    font-size: 13px;
    pointer-events: none;
}

.ttf-nomatch {
    font-size: 13px;
    color: var(--tt-muted);
    padding: 6px 8px;
}

.ttf-more {
    margin-top: 4px;
    padding: 6px 8px;
    border: 0;
    background: none;
    color: var(--tt-primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.ttf-more:hover { text-decoration: underline; }

/* price */
.ttf-range {
    position: relative;
    height: 28px;
    margin: 4px 9px 10px;
}

.ttf-range-track {
    position: absolute;
    top: 12px;
    inset-inline: 0;
    height: 4px;
    border-radius: 2px;
    background: var(--tt-border);
}

.ttf-range-fill {
    position: absolute;
    top: 0;
    bottom: 0;
    border-radius: 2px;
    background: var(--tt-primary);
}

.ttf-range input[type=range] {
    position: absolute;
    inset-inline: -9px;
    top: 4px;
    width: calc(100% + 18px);
    height: 20px;
    margin: 0;
    background: none;
    pointer-events: none;
    -webkit-appearance: none;
    appearance: none;
}

.ttf-range input[type=range]::-webkit-slider-runnable-track { background: none; height: 20px; }
.ttf-range input[type=range]::-moz-range-track { background: none; }

.ttf-range input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    pointer-events: auto;
    width: 18px;
    height: 18px;
    margin-top: 1px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--tt-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
    cursor: grab;
}

.ttf-range input[type=range]::-moz-range-thumb {
    pointer-events: auto;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--tt-primary);
    cursor: grab;
}

.ttf-range input[type=range]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--tt-primary-ring); }

.ttf-price-inputs {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.ttf-price-inputs label {
    flex: 1;
    margin: 0;
    font-size: 12px;
    color: var(--tt-muted);
    font-weight: 400;
}

.ttf-price-inputs input {
    display: block;
    width: 100%;
    height: 38px;
    margin-top: 4px;
    padding: 0 10px;
    border: 1px solid var(--tt-border);
    border-radius: 8px;
    font-size: 14px;
    color: var(--tt-text);
    -moz-appearance: textfield;
}

.ttf-price-inputs input::-webkit-outer-spin-button,
.ttf-price-inputs input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.ttf-price-inputs input:focus {
    outline: none;
    border-color: var(--tt-primary);
    box-shadow: 0 0 0 3px var(--tt-primary-ring);
}

.ttf-price-cur {
    padding-bottom: 10px;
    font-size: 12px;
    color: var(--tt-muted);
}

/* footer: apply (no-JS everywhere, bottom sheet on mobile) */
.ttf-foot {
    padding: 14px 18px;
    border-top: 1px solid var(--tt-border);
    display: flex;
    gap: 10px;
}

.ttf-apply,
.ttf-reset {
    height: 46px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ttf-apply {
    flex: 1;
    border: 0;
    background: var(--tt-primary);
    color: #fff;
}

.ttf-apply:hover { background: var(--tt-primary-dark); }

.ttf-reset {
    padding: 0 18px;
    border: 1px solid var(--tt-border);
    background: #fff;
    color: var(--tt-text);
    text-decoration: none;
}

.ttf-reset:hover { color: var(--tt-text); text-decoration: none; background: var(--tt-subtle); }

.ttf-backdrop { display: none; }

/* with JS on desktop the filters apply instantly: no footer */
@media (min-width: 768px) {
    .ttf-js .ttf-foot { display: none; }

    .ttf-js .ttf-panel {
        position: sticky;
        top: 16px;
        max-height: calc(100vh - 32px);
    }

    .ttf-js .ttf-body {
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-width: thin;
    }
}

/* with JS on mobile the panel is a bottom sheet opened from the floating button */
@media (max-width: 767.98px) {
    .ttf-js .ttf-aside { padding-bottom: 0 !important; }

    .ttf-js .ttf-panel {
        position: fixed;
        inset-inline: 0;
        bottom: 0;
        z-index: 1050;
        max-height: 88vh;
        max-height: 88dvh;
        border-radius: 18px 18px 0 0;
        transform: translateY(105%);
        visibility: hidden;
        transition: transform .28s ease, visibility 0s linear .28s;
    }

    .ttf-js .ttf-open .ttf-panel {
        transform: none;
        visibility: visible;
        transition: transform .28s ease;
    }

    .ttf-js .ttf-head { position: relative; padding-top: 22px; }

    .ttf-js .ttf-head::before {
        content: '';
        position: absolute;
        top: 8px;
        left: 50%;
        width: 40px;
        height: 4px;
        margin-left: -20px;
        border-radius: 2px;
        background: #d1d5db;
    }

    .ttf-js .ttf-close { display: inline-flex; align-items: center; justify-content: center; }

    /* the sheet footer already has "clear all" next to the apply button */
    .ttf-js .ttf-clear { display: none; }

    .ttf-js .ttf-body {
        flex: 1;
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .ttf-js .ttf-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1049;
        background: rgba(17, 24, 39, .45);
        opacity: 0;
        visibility: hidden;
        transition: opacity .28s ease, visibility 0s linear .28s;
    }

    .ttf-js .ttf-open .ttf-backdrop {
        opacity: 1;
        visibility: visible;
        transition: opacity .28s ease;
    }

    .ttf-js .ttf-opt label { padding-block: 10px; }
}

@media (prefers-reduced-motion: reduce) {
    .ttf-panel, .ttf-backdrop, .ttf-box, .ttf-box::before { transition: none !important; }
}

/* ---------- Results ---------- */

.ttr {
    background: var(--tt-surface);
    border-radius: var(--tt-radius);
    padding: 18px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
    transition: opacity .15s ease;
}

.ttr.is-loading { opacity: .55; pointer-events: none; }

.ttr-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding-bottom: 14px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--tt-border);
}

.ttr-count {
    flex: 1;
    font-size: 15px;
    color: var(--tt-muted);
}

.ttr-count strong {
    font-size: 22px;
    color: var(--tt-text);
    margin-inline-end: 4px;
}

.ttr-sort {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 13px;
    color: var(--tt-muted);
    font-weight: 400;
}

.ttr-sort select {
    height: 38px;
    padding-block: 0;
    padding-inline: 12px 32px;
    border: 1px solid var(--tt-border);
    border-radius: 8px;
    font-size: 14px;
    color: var(--tt-text);
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E") no-repeat;
    background-position: left 12px center;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

[dir="ltr"] .ttr-sort select { background-position: right 12px center; }

.ttr-sort select:focus {
    outline: none;
    border-color: var(--tt-primary);
    box-shadow: 0 0 0 3px var(--tt-primary-ring);
}

.ttr-view {
    display: flex;
    gap: 6px;
}

.ttr-view button {
    width: 38px;
    height: 38px;
    border: 1px solid var(--tt-border);
    border-radius: 8px;
    background: #fff;
    color: #9ca3af;
    cursor: pointer;
}

.ttr-view button:hover { color: var(--tt-primary); border-color: var(--tt-primary); }
.ttr-view button[aria-pressed="true"] { background: var(--tt-primary); border-color: var(--tt-primary); color: #fff; }

.ttr-view-mobile { display: none; }

/* active filter chips */
.ttr-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.ttr-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 18px;
    background: var(--tt-primary-soft);
    border: 1px solid #ffd2bf;
    color: var(--tt-primary-dark);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all .15s ease;
}

.ttr-chip i { font-size: 11px; opacity: .7; }

.ttr-chip:hover,
.ttr-chip:focus-visible {
    background: #fff;
    border-color: var(--tt-primary);
    color: var(--tt-primary-dark);
    text-decoration: none;
}

.ttr-chip-clear {
    font-size: 13px;
    font-weight: 600;
    color: var(--tt-muted);
    text-decoration: underline;
    padding: 6px 4px;
}

.ttr-chip-clear:hover { color: var(--tt-text); }

/* grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

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

/* the card lifts itself on hover (developer-ar.css); the grid cell only gives it full height */
.product-grid-item .product-card { margin-bottom: 0; height: 100%; }

/* empty state */
.ttr-empty {
    text-align: center;
    padding: 48px 16px;
}

.ttr-empty-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: var(--tt-primary-soft);
    color: var(--tt-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.ttr-empty h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--tt-text);
    margin: 0 0 6px;
}

.ttr-empty p {
    color: var(--tt-muted);
    font-size: 14px;
    margin: 0 0 18px;
}

.ttr-empty .ttr-chips { justify-content: center; }

.ttr-empty-clear {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: 10px;
    background: var(--tt-primary);
    color: #fff;
    font-weight: 700;
    text-decoration: none;
}

.ttr-empty-clear:hover { background: var(--tt-primary-dark); color: #fff; text-decoration: none; }

/* floating "filter & sort" button (mobile, JS only) */
.ttr-fab { display: none; }

@media (max-width: 767.98px) {
    .ttf-js .ttr-fab {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        position: fixed;
        bottom: 18px;
        left: 50%;
        z-index: 1000;
        transform: translateX(-50%);
        max-width: calc(100% - 150px);
        padding: 0 20px;
        height: 46px;
        border: 0;
        border-radius: 23px;
        background: var(--tt-text);
        color: #fff;
        font-size: 14px;
        font-weight: 700;
        white-space: nowrap;
        box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
        cursor: pointer;
    }

    .ttr-fab-badge {
        min-width: 20px;
        height: 20px;
        padding: 0 6px;
        border-radius: 10px;
        background: var(--tt-accent);
        font-size: 12px;
        line-height: 20px;
        text-align: center;
    }

    .ttf-js .ttr { padding-bottom: 70px; }
}

@media (max-width: 1199.98px) {
    .products-grid.grid-4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 991.98px) {
    .products-grid,
    .products-grid.grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* phones: two columns like the homepage; one column is the opt-in (product-list.js adds grid-1) */
@media (max-width: 575.98px) {
    .ttr { padding: 12px; }
    .ttr-count strong { font-size: 18px; }
    .ttr-sort > span { display: none; }
    .ttr-view-desktop { display: none; }
    .ttr-view-mobile { display: flex; }
    .products-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .products-grid.grid-1 { grid-template-columns: 1fr; gap: 16px; }
}

/* category guide text under the grid */
.content-type-details {
    background: #fff;
    border-radius: var(--tt-radius);
    padding: 28px 32px;
    margin: 30px 10px 0;
    line-height: 1.9;
    color: #374151;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
}

.content-type-details h2 { font-size: 22px; margin: 0 0 12px; color: #111827; }
.content-type-details h3 { font-size: 18px; margin: 20px 0 8px; color: #111827; }
.content-type-details ul { padding-inline-start: 20px; }
.content-type-details p { margin-bottom: 10px; line-height: 1.8; color: #555; }

@media (max-width: 575.98px) {
    .content-type-details { padding: 20px; margin-inline: 0; }
}
