.tie-search-widget,
.tie-listing,
.tie-quick-links {
    --tie-accent: #ff7d18;
    --tie-card: #222;
    --tie-page: #191919;
    --tie-text: #fff;
    --tie-muted: #b8b8b8;
    --tie-border: #414141;
    --tie-gap: 16px;
    --tie-columns: 4;
    color: var(--tie-text);
    box-sizing: border-box;
}

.tie-search-widget *,
.tie-listing *,
.tie-quick-links * { box-sizing: border-box; }

.tie-search-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 12px 20px;
    border: 0;
    background: #fff;
    color: #222;
    font: inherit;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
}
.tie-search-trigger:hover { background: var(--tie-accent); color: #fff; }
.tie-search-trigger svg { width: 20px; height: 20px; fill: currentColor; }

.tie-modal[hidden], .tie-tab-panel[hidden] { display: none !important; }
.tie-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: grid;
    place-items: center;
    padding: 22px;
}
.tie-modal-backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: rgba(0,0,0,.78);
    cursor: default;
}
.tie-dialog {
    position: relative;
    z-index: 1;
    width: min(760px, 100%);
    max-height: calc(100vh - 44px);
    overflow: auto;
    padding: 48px;
    border: 1px solid var(--tie-accent);
    background: #222;
    color: #fff;
    box-shadow: 0 24px 80px rgba(0,0,0,.45);
}
.tie-dialog-close {
    position: absolute;
    right: 0;
    top: 0;
    width: 44px;
    height: 44px;
    border: 0;
    background: var(--tie-accent);
    color: #fff;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
}
.tie-dialog h2 {
    max-width: 590px;
    margin: 0 auto 28px;
    color: var(--tie-accent);
    font-size: clamp(1.55rem, 4vw, 2.1rem);
    line-height: 1.16;
    text-align: center;
    text-transform: uppercase;
}
.tie-tabs { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 32px; }
.tie-tabs button {
    min-height: 50px;
    border: 0;
    background: #eee;
    color: #222;
    font: inherit;
    text-transform: uppercase;
    cursor: pointer;
}
.tie-tabs button[aria-selected="true"] { background: var(--tie-accent); color: #fff; font-weight: 700; }
.tie-tab-panel form label {
    display: flex;
    flex-direction: column;
    gap: 7px;
    color: inherit;
    font-weight: 700;
    text-transform: uppercase;
}
.tie-tab-panel input, .tie-tab-panel select {
    width: 100%;
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid #bbb;
    border-radius: 0;
    background: #fff;
    color: #333;
    font: inherit;
    text-transform: none;
}
.tie-parts-fields { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(150px, .8fr); gap: 10px; }
.tie-tab-panel form > button {
    min-height: 42px;
    margin-top: 18px;
    padding: 10px 20px;
    border: 0;
    border-radius: 999px;
    background: var(--tie-accent);
    color: #fff;
    font: inherit;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
}
.tie-modal-open { overflow: hidden; }

.tie-listing { padding: 28px 0; background: transparent; }
.tie-section-heading { display: flex; align-items: end; gap: 18px; margin-bottom: 30px; }
.tie-section-heading > div { flex: 0 1 auto; }
.tie-section-heading h2 { margin: 0; color: var(--tie-text); font-size: clamp(1.55rem, 3vw, 2.25rem); font-weight: 700; line-height: 1.1; text-transform: uppercase; }
.tie-section-heading p { margin: 7px 0 0; color: var(--tie-muted); }
.tie-heading-line { flex: 1; height: 3px; margin-bottom: 4px; background: var(--tie-accent); }
.tie-carousel-shell { position: relative; }
.tie-track { display: grid; grid-template-columns: repeat(var(--tie-columns), minmax(0, 1fr)); gap: var(--tie-gap); }
.tie-carousel-arrow, .tie-carousel-dots, .tie-carousel-status { display: none; }
.tie-empty { grid-column: 1 / -1; padding: 28px; border: 1px solid var(--tie-border); text-align: center; }
.tie-card-link { color: inherit !important; text-decoration: none !important; }

.tie-truck-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--tie-border);
    background: var(--tie-card);
    color: var(--tie-text);
}
.tie-truck-card .tie-card-link { display: flex; height: 100%; flex-direction: column; }
.tie-truck-card header { position: relative; display: flex; min-height: 58px; justify-content: space-between; background: var(--tie-accent); }
.tie-truck-card header > div { min-width: 0; flex: 1; padding: 8px 12px; }
.tie-truck-card header small { display: block; font-size: 11px; line-height: 1; }
.tie-truck-card h3 { margin: 3px 0 0; color: #fff; font-size: 18px; line-height: 1.05; text-transform: uppercase; }
.tie-truck-card header strong {
    display: grid;
    min-width: 62px;
    max-width: 82px;
    place-items: center;
    padding: 7px;
    background: #202020;
    color: #fff;
    font-size: 10px;
    line-height: 1.05;
    text-align: center;
    text-transform: uppercase;
}
.tie-stock { padding: 6px 12px; background: #1b1b1be8; color: #fff; font-weight: 700; text-transform: uppercase; }
.tie-truck-photo { height: 270px; overflow: hidden; background: #111; }
.tie-truck-photo img, .tie-truck-photo > .tpm-sold-media, .tie-truck-photo > .tpm-sold-media > img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tie-detail-bar { padding: 9px 12px; background: var(--tie-accent); color: #fff; font-size: 12px; font-weight: 700; text-align: right; text-transform: uppercase; }
.tie-truck-card dl { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 20px; margin: 0; padding: 16px 12px 18px; }
.tie-truck-card dl div { min-width: 0; }
.tie-truck-card dt { color: var(--tie-muted); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.tie-truck-card dd { margin: 2px 0 0; color: inherit; font-size: 14px; font-weight: 700; overflow-wrap: anywhere; }
.tie-truck-card:hover, .tie-part-card:hover { transform: translateY(-3px); border-color: var(--tie-accent); box-shadow: 0 12px 28px rgba(0,0,0,.22); }
.tie-truck-card, .tie-part-card { transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }

.tie-latest-parts.tie-parts-compact { --tie-columns: 2; }
.tie-part-card { min-width: 0; overflow: hidden; border: 1px solid var(--tie-border); background: var(--tie-card); }
.tie-part-card .tie-card-link { display: flex; height: 100%; }
.tie-part-photo { flex: 0 0 96px; width: 96px; height: 96px; overflow: hidden; background: #111; }
.tie-part-photo img, .tie-part-photo > .tpm-sold-media, .tie-part-photo > .tpm-sold-media > img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tie-part-copy { position: relative; min-width: 0; flex: 1; align-self: center; padding: 12px 15px; }
.tie-part-copy small { display: block; margin-bottom: 3px; color: var(--tie-accent); font-weight: 700; text-transform: uppercase; }
.tie-part-copy h3 { margin: 0; color: var(--tie-text); font-size: 17px; line-height: 1.2; text-transform: uppercase; }
.tie-part-copy p { margin: 5px 0 0; color: var(--tie-muted); line-height: 1.35; }
.tie-sold { display: inline-block; margin-top: 7px; padding: 3px 7px; background: #a51f1f; color: #fff; font-size: 10px; text-transform: uppercase; }
.tie-parts-cards .tie-part-card .tie-card-link { flex-direction: column; }
.tie-parts-cards .tie-part-photo { width: 100%; height: 240px; flex-basis: auto; }
.tie-parts-cards .tie-part-copy { width: 100%; align-self: auto; }

.tie-view-all { margin-top: 30px; text-align: center; }
.tie-view-all a { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 12px 25px; border: 1px solid currentColor; border-radius: 999px; color: var(--tie-text) !important; font-weight: 700; text-decoration: none !important; text-transform: uppercase; }
.tie-view-all a:hover { border-color: var(--tie-accent); background: var(--tie-accent); color: #fff !important; }

.tie-quick-links { padding: 28px 0; }
.tie-quick-grid { display: grid; grid-template-columns: repeat(var(--tie-columns), minmax(0, 1fr)); gap: var(--tie-gap); }
.tie-quick-card { position: relative; display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto auto; align-items: center; gap: 2px 14px; min-height: 116px; padding: 20px; border: 1px solid var(--tie-border); background: var(--tie-card); color: var(--tie-text) !important; text-decoration: none !important; }
.tie-quick-icon { grid-row: 1 / 3; display: grid; width: 52px; height: 52px; place-items: center; border-radius: 50%; background: var(--tie-accent); color: #fff; font-size: 25px; }
.tie-quick-card strong { font-size: 18px; text-transform: uppercase; }
.tie-quick-card small { color: var(--tie-muted); }
.tie-quick-arrow { grid-column: 3; grid-row: 1 / 3; color: var(--tie-accent); font-size: 34px; }
.tie-quick-card:hover { border-color: var(--tie-accent); transform: translateY(-2px); }

@media (max-width: 900px) {
    .tie-listing, .tie-quick-links { --tie-columns: 2; }
    .tie-latest-parts.tie-parts-compact { --tie-columns: 2; }
}

@media (max-width: 600px) {
    .tie-modal { padding: 10px; }
    .tie-dialog { width: 100%; max-height: calc(100vh - 20px); padding: 54px 20px 28px; }
    .tie-dialog h2 { margin-bottom: 22px; font-size: 1.45rem; }
    .tie-parts-fields { grid-template-columns: 1fr; }
    .tie-tabs { margin-bottom: 24px; }
    .tie-tab-panel form > button { width: 100%; }
    .tie-section-heading { display: block; margin-bottom: 20px; }
    .tie-heading-line { display: block; width: 100%; margin-top: 12px; }
    .tie-listing, .tie-quick-links, .tie-latest-parts.tie-parts-compact { --tie-columns: 1; }
    .tie-track, .tie-quick-grid { grid-template-columns: 1fr; }

    .tie-has-mobile-carousel .tie-carousel-shell { padding-bottom: 58px; }
    .tie-has-mobile-carousel .tie-track {
        display: flex;
        align-items: flex-start;
        gap: var(--tie-gap);
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
        touch-action: pan-x pan-y;
    }
    .tie-has-mobile-carousel .tie-track::-webkit-scrollbar { display: none; }
    .tie-has-mobile-carousel .tie-slide { flex: 0 0 min(86vw, 380px); scroll-snap-align: start; }
    .tie-has-mobile-carousel .tie-carousel-arrow {
        position: absolute;
        bottom: 4px;
        display: grid;
        width: 42px;
        height: 42px;
        place-items: center;
        border: 1px solid var(--tie-border);
        border-radius: 50%;
        background: var(--tie-card);
        color: var(--tie-text);
        cursor: pointer;
    }
    .tie-has-mobile-carousel .tie-carousel-arrow:disabled { opacity: .35; cursor: default; }
    .tie-has-mobile-carousel .tie-carousel-arrow svg { width: 20px; height: 20px; fill: currentColor; }
    .tie-has-mobile-carousel .tie-carousel-prev { left: 0; }
    .tie-has-mobile-carousel .tie-carousel-next { right: 0; }
    .tie-has-mobile-carousel .tie-carousel-dots { position: absolute; left: 55px; right: 55px; bottom: 21px; display: flex; align-items: center; justify-content: center; gap: 6px; }
    .tie-has-mobile-carousel .tie-carousel-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--tie-muted); opacity: .45; }
    .tie-has-mobile-carousel .tie-carousel-dots i.is-active { width: 18px; border-radius: 5px; background: var(--tie-accent); opacity: 1; }
    .tie-has-mobile-carousel .tie-carousel-status { position: absolute; right: 52px; bottom: 8px; display: block; color: var(--tie-muted); font-size: 10px; opacity: 0; pointer-events: none; }
    .tie-truck-photo { height: 250px; }
    .tie-parts-compact .tie-part-card .tie-card-link { flex-direction: column; }
    .tie-parts-compact .tie-part-photo { width: 100%; height: 230px; flex-basis: auto; }
    .tie-parts-compact .tie-part-copy { width: 100%; min-height: 112px; align-self: auto; }
    .tie-quick-card { min-height: 102px; }
}

@media (prefers-reduced-motion: reduce) {
    .tie-truck-card, .tie-part-card, .tie-quick-card { transition: none; }
    .tie-has-mobile-carousel .tie-track { scroll-behavior: auto !important; }
}
