/**
 * K360 Trailervælger - "Find udstyr til din trailer"
 * Bruges i megamenuen (menu), mobilmenuen (drawer) og udstyrsbutikken (bar).
 * Knapper og felter har høj specificitet, så temaets/Elementors knap-styling ikke slår igennem.
 */

.k360-tp {
    --k360-tp-navy: #1F3065;
    --k360-tp-navy-dark: #162449;
    --k360-tp-red: #E62229;
    --k360-tp-ink: #151a2d;
    --k360-tp-muted: #6b7285;
    --k360-tp-line: #e6e9f0;
    --k360-tp-soft: #f4f6fb;
    position: relative;
    font-family: 'Work Sans', sans-serif;
    color: var(--k360-tp-ink);
    text-align: left;
    box-sizing: border-box;
}
.k360-tp *, .k360-tp *::before, .k360-tp *::after { box-sizing: border-box; }
.k360-tp [hidden] { display: none !important; }

.k360-tp__icon { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; line-height: 0; }

/* ---------- Valgt trailer ---------- */
.k360-tp__current { display: flex; align-items: center; gap: 14px; }
.k360-tp__thumb {
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    width: 52px; height: 52px; overflow: hidden;
    background: #fff; border: 1px solid var(--k360-tp-line); border-radius: 10px;
    color: var(--k360-tp-navy);
}
.k360-tp__thumb img { width: 100%; height: 100%; margin: 0; object-fit: contain; border-radius: 0; }
.k360-tp__current-text { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.k360-tp__current-label { color: var(--k360-tp-muted); font-size: 13px; font-weight: 500; line-height: 1.3; }
.k360-tp__current-name {
    display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    color: var(--k360-tp-ink); font-size: 16px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere;
}
.k360-tp__current-meta { color: var(--k360-tp-muted); font-size: 13px; line-height: 1.35; }
.k360-tp__current-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; flex-shrink: 0; }

/* ---------- Knapper ---------- */
.k360-tp .k360-tp__btn,
.k360-tp a.k360-tp__btn,
.k360-tp button.k360-tp__btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-height: 40px; margin: 0; padding: 0 16px;
    border: 1.5px solid transparent; border-radius: 8px; box-shadow: none;
    font-family: 'Work Sans', sans-serif; font-size: 14px; font-weight: 600; line-height: 1.2;
    text-decoration: none; text-transform: none; letter-spacing: normal; white-space: nowrap;
    cursor: pointer; transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.k360-tp a.k360-tp__btn--primary,
.k360-tp a.k360-tp__btn--primary:focus { background: var(--k360-tp-red); border-color: var(--k360-tp-red); color: #fff; }
.k360-tp a.k360-tp__btn--primary:hover { background: #c81d23; border-color: #c81d23; color: #fff; }
.k360-tp button.k360-tp__btn--ghost,
.k360-tp button.k360-tp__btn--ghost:focus { background: #fff; border-color: #cfd6ea; color: var(--k360-tp-navy); }
.k360-tp button.k360-tp__btn--ghost:hover { background: var(--k360-tp-soft); border-color: var(--k360-tp-navy); color: var(--k360-tp-navy); }
.k360-tp button.k360-tp__btn--link,
.k360-tp button.k360-tp__btn--link:hover,
.k360-tp button.k360-tp__btn--link:focus {
    min-height: 32px; padding: 0 6px; background: transparent; border-color: transparent;
    color: var(--k360-tp-muted); font-weight: 500; text-decoration: underline; text-underline-offset: 3px;
}
.k360-tp button.k360-tp__btn--link:hover { color: var(--k360-tp-navy); }
.k360-tp .k360-tp__btn:focus-visible,
.k360-tp .k360-tp__input:focus-visible,
.k360-tp .k360-tp__reset:focus-visible { outline: 3px solid rgba(31, 48, 101, 0.35); outline-offset: 2px; }

/* ---------- Søgning ---------- */
.k360-tp__search { display: flex; flex-direction: column; gap: 10px; }
.k360-tp__intro { display: flex; flex-direction: column; gap: 2px; }
.k360-tp__title { color: var(--k360-tp-ink); font-size: 16px; font-weight: 600; line-height: 1.3; }
.k360-tp__hint { color: var(--k360-tp-muted); font-size: 13.5px; line-height: 1.4; }
.k360-tp__combo { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.k360-tp__field { position: relative; display: flex; align-items: center; flex: 1 1 260px; min-width: 0; }
.k360-tp__field-icon { position: absolute; left: 14px; color: var(--k360-tp-muted); pointer-events: none; }
.k360-tp input.k360-tp__input,
.k360-tp input.k360-tp__input:focus {
    width: 100%; height: 46px; margin: 0; padding: 0 40px 0 42px;
    background: #fff; border: 1.5px solid #d5dae6; border-radius: 10px; box-shadow: none;
    color: var(--k360-tp-ink); font-family: 'Work Sans', sans-serif; font-size: 15px; font-weight: 400; line-height: 1.2;
    -webkit-appearance: none; appearance: none;
}
.k360-tp input.k360-tp__input:focus { border-color: var(--k360-tp-navy); box-shadow: 0 0 0 3px rgba(31, 48, 101, 0.1); outline: none; }
.k360-tp input.k360-tp__input::placeholder { color: #9aa0af; }
.k360-tp input.k360-tp__input::-webkit-search-cancel-button { -webkit-appearance: none; }
.k360-tp button.k360-tp__reset,
.k360-tp button.k360-tp__reset:hover,
.k360-tp button.k360-tp__reset:focus {
    position: absolute; right: 8px; display: flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; margin: 0; padding: 0;
    background: var(--k360-tp-soft); border: 0; border-radius: 50%; box-shadow: none;
    color: var(--k360-tp-muted); cursor: pointer;
}
.k360-tp button.k360-tp__reset:hover { color: var(--k360-tp-navy); }

/* ---------- Resultater ---------- */
.k360-tp__results {
    flex-basis: 100%; max-height: 320px; margin: 0; padding: 6px; overflow-y: auto; list-style: none;
    background: #fff; border: 1px solid var(--k360-tp-line); border-radius: 12px;
    overscroll-behavior: contain;
}
.k360-tp__results li { margin: 0; list-style: none; }
.k360-tp__results li::before, .k360-tp__results li::marker { content: none; display: none; }
.k360-tp__group { padding: 10px 10px 4px; color: var(--k360-tp-muted); font-size: 12.5px; font-weight: 600; line-height: 1.3; }
.k360-tp__group:first-child { padding-top: 4px; }
.k360-tp__option {
    display: flex; align-items: center; gap: 12px; padding: 7px 10px;
    border-radius: 8px; cursor: pointer; transition: background 0.12s ease;
}
.k360-tp__option .k360-tp__thumb { width: 44px; height: 44px; border-radius: 8px; }
.k360-tp__option.is-active { background: var(--k360-tp-soft); }
.k360-tp__option-text { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.k360-tp__option-name { overflow: hidden; color: var(--k360-tp-ink); font-size: 14.5px; font-weight: 600; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.k360-tp__option-meta { color: var(--k360-tp-muted); font-size: 12.5px; line-height: 1.35; }
.k360-tp__option-arrow { color: #c4c7cf; transition: color 0.12s ease, transform 0.12s ease; }
.k360-tp__option.is-active .k360-tp__option-arrow { color: var(--k360-tp-red); transform: translateX(2px); }
.k360-tp__option-check { color: #10b981; }
.k360-tp__option.is-current .k360-tp__option-name { color: var(--k360-tp-navy); }
.k360-tp__status { display: flex; flex-direction: column; gap: 2px; padding: 14px 12px; color: var(--k360-tp-muted); font-size: 14px; line-height: 1.45; }
.k360-tp__status strong { color: var(--k360-tp-ink); font-weight: 600; }

/* =====================================================
   MENU: megamenuens Trailerudstyr-fane
   ===================================================== */
.k360-tp--menu {
    margin: 0 0 20px; padding: 16px 18px;
    background: var(--k360-tp-soft); border: 1px solid var(--k360-tp-line); border-radius: 12px;
}
.k360-tp--menu.has-trailer:not(.is-editing) { background: #fff; border-color: #cfd6ea; }
.k360-tp--menu .k360-tp__search { flex-direction: row; align-items: flex-start; flex-wrap: wrap; gap: 10px 18px; }
/* Overskriften flugter med søgefeltet, også når listen er åben */
.k360-tp--menu .k360-tp__intro { flex: 0 1 250px; min-height: 46px; justify-content: center; }
.k360-tp--menu .k360-tp__combo { flex: 1 1 320px; }

/* =====================================================
   DRAWER: mobilmenuen
   ===================================================== */
.k360-tp--drawer { margin: 0 0 14px; padding: 14px; background: var(--k360-tp-soft); border-radius: 12px; }
.k360-tp--drawer.has-trailer:not(.is-editing) { background: #fff; border: 1px solid #cfd6ea; }
.k360-tp--drawer .k360-tp__title { font-size: 15px; }
.k360-tp--drawer .k360-tp__hint { font-size: 13px; }
.k360-tp--drawer .k360-tp__current { flex-wrap: wrap; }
.k360-tp--drawer .k360-tp__current-actions { flex-basis: 100%; }
.k360-tp--drawer .k360-tp__current-actions .k360-tp__btn--primary { flex: 1; }
.k360-tp--drawer .k360-tp__results { max-height: 50vh; }
/* 16px forhindrer at iOS zoomer ind på feltet */
.k360-tp--drawer input.k360-tp__input, .k360-tp--drawer input.k360-tp__input:focus { font-size: 16px; }

/* =====================================================
   BAR: øverst i udstyrsbutikken
   ===================================================== */
.k360-tp-mount--bar { margin: 0 0 18px; }
.k360-tp--bar {
    padding: 14px 18px; background: #fff;
    border: 1.5px solid var(--k360-tp-line); border-radius: 14px;
}
.k360-tp--bar.has-trailer:not(.is-editing) { border-color: var(--k360-tp-navy); box-shadow: 0 6px 22px rgba(31, 48, 101, 0.08); }
.k360-tp--bar .k360-tp__search { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 10px 20px; }
.k360-tp--bar .k360-tp__intro { flex: 1 1 240px; }
.k360-tp--bar .k360-tp__combo { flex: 1 1 360px; max-width: 520px; }
/* Resultaterne ligger oven på produkterne */
.k360-tp--bar .k360-tp__results {
    position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 50;
    max-height: 380px; box-shadow: 0 16px 40px rgba(21, 26, 45, 0.16);
}
.k360-tp--bar .k360-tp__current-name { font-size: 17px; }
.k360-tp--bar .k360-tp__thumb { width: 60px; height: 60px; }

@media (max-width: 768px) {
    .k360-tp--menu { padding: 14px; }
    .k360-tp--menu .k360-tp__intro,
    .k360-tp--menu .k360-tp__combo,
    .k360-tp--bar .k360-tp__intro,
    .k360-tp--bar .k360-tp__combo { flex-basis: 100%; max-width: none; }
    .k360-tp--bar { padding: 12px; border-radius: 12px; }
    .k360-tp--bar .k360-tp__current,
    .k360-tp--menu .k360-tp__current { flex-wrap: wrap; gap: 10px 12px; }
    .k360-tp--bar .k360-tp__current-actions,
    .k360-tp--menu .k360-tp__current-actions { flex-basis: 100%; }
    .k360-tp--bar .k360-tp__current-actions .k360-tp__btn--ghost { flex: 1; }
    .k360-tp--bar .k360-tp__thumb { width: 48px; height: 48px; }
    .k360-tp--bar .k360-tp__current-name { font-size: 15.5px; }
    .k360-tp input.k360-tp__input, .k360-tp input.k360-tp__input:focus { font-size: 16px; }
    .k360-tp--bar .k360-tp__results { max-height: 60vh; }
}

/* =====================================================
   Udstyrsfilterets kategorier når en trailer er valgt
   ===================================================== */
.tf-cat-nav li.k360-tp-zero > a { opacity: 0.45; }
.tf-cat-nav li.k360-tp-zero > a:hover { opacity: 0.8; }

.tf-no-products .k360-tp-empty-link {
    display: inline-flex; margin-top: 12px; padding: 10px 18px;
    background: #1F3065; border-radius: 8px; color: #fff; font-weight: 600; text-decoration: none;
}
.tf-no-products .k360-tp-empty-link:hover { background: #162449; color: #fff; }
