.tdw-brand { padding: 30px 0 60px; }

.tdw-brand__header {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e8e8e8;
}
.tdw-brand__title {
    margin: 0 0 12px;
    font-size: 38px;
    font-weight: 700;
    line-height: 1.15;
    color: #1a1a1a;
}
.tdw-brand__desc { color: #444; font-size: 15px; line-height: 1.65; max-width: 900px; }
.tdw-brand__desc p { margin: 0 0 12px; }
.tdw-brand__desc h2 { font-size: 22px; margin: 18px 0 10px; font-weight: 600; }
.tdw-brand__desc h3 { font-size: 17px; margin: 14px 0 8px; font-weight: 600; }
.tdw-brand__desc h4 { font-size: 15px; margin: 12px 0 6px; font-weight: 600; }
.tdw-brand__desc ul, .tdw-brand__desc ol { margin: 0 0 12px 20px; }
.tdw-brand__desc li { margin: 4px 0; }
.tdw-brand__desc strong { color: #1a1a1a; }

.tdw-brand__desc-toggle {
    display: inline-flex; align-items: center; gap: 6px;
    margin-top: 12px; padding: 8px 14px;
    background: transparent; border: 1px solid #007cba; border-radius: 6px;
    color: #007cba; font-size: 14px; font-weight: 600; cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.tdw-brand__desc-toggle:hover { background: #007cba; color: #fff; }
.tdw-brand__desc-toggle svg { transition: transform 0.2s; }
.tdw-brand__desc--expanded .tdw-brand__desc-toggle svg { transform: rotate(180deg); }

.tdw-brand__layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 32px;
    align-items: start;
}
@media (max-width: 849px) {
    .tdw-brand__layout { grid-template-columns: 1fr; gap: 16px; }
}

.tdw-brand__sidebar { position: sticky; top: var(--tdw-header-h, 80px); }
.tdw-brand__sidebar-toggle {
    display: none; width: 100%;
    align-items: center; justify-content: center; gap: 8px;
    padding: 12px 16px;
    background: #fff; border: 1px solid #ddd; border-radius: 8px;
    color: #2c2c2c; font-size: 14px; font-weight: 600; cursor: pointer;
}
.tdw-brand__filter-form {
    background: #fff; border: 1px solid #e8e8e8; border-radius: 8px;
    padding: 18px 16px;
}
.tdw-brand__filter-group { margin-bottom: 20px; }
.tdw-brand__filter-group:last-child { margin-bottom: 0; }
.tdw-brand__filter-title {
    margin: 0 0 12px;
    font-size: 13px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.04em; color: #1a1a1a;
}
.tdw-brand__filter-list {
    list-style: none; margin: 0; padding: 0;
    max-height: 360px; overflow-y: auto;
}
.tdw-brand__filter-item { margin: 0; list-style: none; }
.tdw-brand__filter-item a {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 7px 10px; border-radius: 6px;
    color: #444; font-size: 14px; text-decoration: none;
    transition: background 0.12s, color 0.12s;
}
.tdw-brand__filter-item a:hover { background: #f5f8fb; color: #007cba; }
.tdw-brand__filter-item.is-active a { background: #007cba; color: #fff; font-weight: 600; }
.tdw-brand__filter-item.is-active .tdw-brand__filter-count { background: rgba(255,255,255,0.25); color: #fff; }
.tdw-brand__filter-count {
    flex-shrink: 0; min-width: 24px; padding: 2px 8px;
    background: #f0f0f0; border-radius: 10px;
    font-size: 12px; font-weight: 500; color: #666; text-align: center;
}
.tdw-brand__filter-checkbox {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 0; cursor: pointer;
    font-size: 14px; color: #444;
}
.tdw-brand__filter-checkbox input {
    width: 16px; height: 16px; margin: 0; cursor: pointer; accent-color: #007cba;
}

.tdw-brand__toolbar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; margin: 0 0 24px;
    padding: 12px 16px;
    background: #fff; border: 1px solid #e8e8e8; border-radius: 8px;
    flex-wrap: wrap;
}
.tdw-brand__count { margin: 0; color: #666; font-size: 14px; font-weight: 500; }
.tdw-brand__sort-form { display: flex; align-items: center; gap: 10px; margin: 0; }
.tdw-brand__sort-label { font-size: 14px; color: #555; margin: 0; font-weight: 500; white-space: nowrap; }
.tdw-brand__sort-select {
    width: auto; max-width: 220px;
    padding: 7px 32px 7px 12px;
    border: 1px solid #d0d0d0; border-radius: 6px;
    background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23555' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>") no-repeat right 10px center;
    font-size: 14px; line-height: 1.4; color: #2c2c2c;
    cursor: pointer; -webkit-appearance: none; -moz-appearance: none; appearance: none;
    height: auto; box-shadow: none;
}
.tdw-brand__sort-select:hover { border-color: #007cba; }
.tdw-brand__sort-select:focus { outline: none; border-color: #007cba; box-shadow: 0 0 0 3px rgba(0,124,186,0.15); }

.tdw-brand__grid.products {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px 16px;
    list-style: none; margin: 0 !important; padding: 0 !important; width: 100%;
}
.tdw-brand__grid.products::before, .tdw-brand__grid.products::after { display: none !important; }
.tdw-brand__grid.products > .product {
    width: auto !important; max-width: none !important;
    float: none !important; margin: 0 !important; padding: 0 !important; clear: none !important;
}
@media (max-width: 1100px) { .tdw-brand__grid.products { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 849px)  { .tdw-brand__grid.products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 12px; } }
@media (max-width: 480px)  { .tdw-brand__grid.products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 10px; } }

.tdw-brand__pagination {
    display: flex; justify-content: center; gap: 4px;
    margin: 40px 0 16px; flex-wrap: wrap;
}
.tdw-brand__pagination .page-numbers {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 38px; height: 38px; padding: 0 12px;
    border: 1px solid #ddd; border-radius: 6px;
    background: #fff; color: #2c2c2c;
    font-size: 14px; text-decoration: none;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.tdw-brand__pagination .page-numbers:hover { background: #f5f8fb; border-color: #007cba; color: #007cba; }
.tdw-brand__pagination .page-numbers.current {
    background: #007cba; border-color: #007cba; color: #fff; font-weight: 600;
}
.tdw-brand__pagination .page-numbers.dots { border: 0; background: transparent; cursor: default; }
.tdw-brand__empty { text-align: center; padding: 60px 20px; color: #888; font-size: 16px; }

@media (max-width: 849px) {
    .tdw-brand__sidebar { position: static; margin-bottom: 16px; }
    .tdw-brand__sidebar-toggle { display: flex; }
    .tdw-brand__filter-form { display: none; margin-top: 12px; }
    .tdw-brand__sidebar.is-open .tdw-brand__filter-form { display: block; }
    .tdw-brand__title { font-size: 28px; }
}

/* ---- Price range slider ----------------------------------- */
.tdw-brand__price-slider {
    padding: 6px 4px 0;
}
.tdw-brand__price-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
}
.tdw-brand__price-sep { color: #999; font-weight: 400; }
.tdw-brand__price-track {
    position: relative;
    height: 20px;
    margin: 0 8px;
}
.tdw-brand__price-track::before {
    content: '';
    position: absolute;
    left: 0; right: 0; top: 50%;
    transform: translateY(-50%);
    height: 4px;
    background: #e8e8e8;
    border-radius: 2px;
}
.tdw-brand__price-track-fill {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    height: 4px;
    background: #007cba;
    border-radius: 2px;
    pointer-events: none;
    z-index: 1;
}
.tdw-brand__price-input {
    position: absolute;
    left: 0; right: 0;
    top: 0;
    width: 100%;
    height: 20px;
    margin: 0;
    background: transparent;
    pointer-events: none;
    -webkit-appearance: none;
    appearance: none;
}
.tdw-brand__price-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: #007cba;
    border: 3px solid #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    pointer-events: auto;
    z-index: 2;
}
.tdw-brand__price-input::-moz-range-thumb {
    width: 18px; height: 18px;
    border-radius: 50%;
    background: #007cba;
    border: 3px solid #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    pointer-events: auto;
}
.tdw-brand__price-input::-webkit-slider-runnable-track { background: transparent; border: none; }
.tdw-brand__price-input::-moz-range-track { background: transparent; border: none; }
.tdw-brand__price-apply {
    margin-top: 12px;
    width: 100%;
    padding: 8px 12px;
    background: #007cba;
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.tdw-brand__price-apply:hover { background: #005a87; }

/* ---- Reset filtre link ------------------------------------ */
.tdw-brand__filter-reset {
    display: inline-block;
    margin-top: 8px;
    color: #c00;
    font-size: 13px;
    text-decoration: underline;
}
.tdw-brand__filter-reset:hover { color: #800; }

/* ---- Active filter count badge på toggle-knap ------------- */
.tdw-brand__sidebar-toggle-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    margin-left: auto;
    background: #007cba;
    color: #fff;
    border-radius: 11px;
    font-size: 12px;
    font-weight: 700;
}

/* ---- Mobile: sticky filter knap --------------------------- */
@media (max-width: 849px) {
    .tdw-brand__sidebar-toggle {
        position: sticky;
        top: var(--tdw-header-h, 64px);
        z-index: 50;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    }
    .tdw-brand__sidebar.is-open .tdw-brand__sidebar-toggle {
        background: #f5f8fb;
        border-color: #007cba;
        color: #007cba;
    }
}

/* Skjul Flatsome's shop-page-title block (egen breadcrumb + count) */
body.tdw-brand-archive .shop-page-title.category-page-title { display: none !important; }

/* Mobile sticky sidebar — hele sidebar er sticky når lukket, normal flow når åben */
@media (max-width: 849px) {
    .tdw-brand__sidebar {
        position: sticky;
        top: var(--tdw-nav-h, 0px);
        z-index: 90;
        margin-bottom: 16px;
        background: #fff;
        transition: box-shadow .2s ease;
    }
    .tdw-brand__sidebar.is-stuck {
        box-shadow: 0 1px 0 rgba(0,0,0,.04), 0 4px 12px rgba(0,0,0,.06);
    }
    /* Når åben: bevar sticky, gør sidebar scrollable inde i sig selv */
    .tdw-brand__sidebar.is-open {
        max-height: calc(100vh - var(--tdw-nav-h, 0px));
        overflow-y: auto;
        overscroll-behavior: contain;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    }
    .tdw-brand__sidebar.is-open .tdw-brand__sidebar-toggle {
        position: sticky;
        top: 0;
        z-index: 1;
        background: #fff;
        border-bottom: 1px solid #eee;
        border-radius: 0;
    }
    .tdw-brand__sidebar-toggle {
        position: static;
        box-shadow: none;
    }
}

/* Fix horisontal scroll på mobil sidebar */
@media (max-width: 849px) {
    .tdw-brand__sidebar.is-open { overflow-x: hidden; }
    .tdw-brand__filter-form { max-width: 100%; box-sizing: border-box; }
    .tdw-brand__filter-form * { max-width: 100%; box-sizing: border-box; }
}

/* Desktop: scroll inde i sidebaren hvis den er højere end viewport */
@media (min-width: 850px) {
    .tdw-brand__sidebar {
        max-height: calc(100vh - var(--tdw-nav-h, 80px) - 20px);
        overflow-y: auto;
        overscroll-behavior: contain;
    }
    /* Pænere scrollbar */
    .tdw-brand__sidebar::-webkit-scrollbar { width: 6px; }
    .tdw-brand__sidebar::-webkit-scrollbar-track { background: transparent; }
    .tdw-brand__sidebar::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
    .tdw-brand__sidebar::-webkit-scrollbar-thumb:hover { background: #999; }
}
