/**
 * TP Sync — Store Redesign (loja peças auto usadas) — v2
 * Modern hero filter + redesigned PartCard + modal compat + favorites.
 */

/* ─── Hero v5 — respeita o container do tema (não sobrepõe sidebar) ─────── */
.tp-hero {
    /* 2026-05-24 — removido o viewport breakout (`width: 100vw` + negative
       margins). Em temas com sidebar esquerda fixa, o breakout pintava por
       cima dos widgets. Mantemos o hero dentro do container do tema; o
       respiro lateral é dado por padding interno. */
    position: relative;
    width: 100%;
    max-width: 100%;
    margin-top: -20px;
    margin-bottom: 32px;
    padding: 28px 28px 26px;
    background:
        radial-gradient(circle at 5% 0%, color-mix(in srgb, var(--tp-primary) 10%, transparent) 0%, transparent 35%),
        radial-gradient(circle at 95% 100%, color-mix(in srgb, var(--tp-primary) 7%, transparent) 0%, transparent 35%),
        linear-gradient(180deg, #f9fafb 0%, #ffffff 100%);
    border: 1px solid var(--tp-border);
    border-radius: 16px;
    overflow: hidden;
    isolation: isolate;
}
/* Em layouts sem sidebar (col-12), permite breakout opcional via classe.
   O mu-plugin de redesign adiciona `.tp-hero--full` quando a página
   não tem sidebar. */
.tp-hero.tp-hero--full {
    width: calc(100% + 56px);
    margin-left: -28px;
    margin-right: -28px;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
}
.tp-hero::before {
    /* Subtle pattern de "x" no fundo — peças auto vibe */
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 1px 1px, rgba(0,0,0,.04) 1px, transparent 0);
    background-size: 24px 24px;
    opacity: .4;
    pointer-events: none;
    z-index: 0;
}
.tp-hero::after {
    /* Glow esquerdo subtil */
    content: '';
    position: absolute;
    top: -50px; left: -100px;
    width: 400px; height: 400px;
    background: radial-gradient(circle, color-mix(in srgb, var(--tp-primary) 12%, transparent) 0%, transparent 60%);
    border-radius: 50%;
    filter: blur(40px);
    pointer-events: none;
    z-index: 0;
}
.tp-hero-form {
    display: flex; flex-direction: column; gap: 14px;
    position: relative;
    z-index: 1;
    max-width: 1440px;
    margin: 0 auto;
    width: 100%;
}
/* "Catálogo" header — substitui o "Shop" h1 removido */
.tp-hero-form::before {
    content: 'Catálogo de peças';
    display: block;
    font-size: 28px;
    font-weight: 800;
    color: var(--tp-text);
    letter-spacing: -.5px;
    margin-bottom: 4px;
    line-height: 1.1;
}

/* Linha 1: Garage strip — premium glass effect */
.tp-hero-garage-strip {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px 16px;
    background: rgba(255,255,255,.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,.9);
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.tp-hero-garage-label {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12px; font-weight: 700;
    color: var(--tp-text-2);
    text-transform: uppercase; letter-spacing: .5px;
    flex-shrink: 0;
}
.tp-hero-garage-pills {
    display: inline-flex; gap: 6px; flex-wrap: wrap; flex: 1; min-width: 200px;
}
.tp-hero-garage-empty {
    font-size: 12px; color: var(--tp-text-3); font-style: italic;
}
.tp-hero-garage-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 10px;
    background: var(--tp-surface);
    border: 1.5px solid var(--tp-border);
    border-radius: 9999px;
    font-size: 12px; font-weight: 600;
    color: var(--tp-text);
    cursor: pointer;
    transition: all .2s var(--tp-anim);
}
.tp-hero-garage-pill:hover {
    border-color: var(--tp-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,.06);
}
.tp-hero-garage-pill.is-active {
    background: var(--tp-primary);
    color: #fff;
    border-color: var(--tp-primary);
}
.tp-hero-garage-pill .tp-pill-rm {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: rgba(0,0,0,.08);
    color: inherit;
    cursor: pointer;
    border: none;
    padding: 0;
    margin-left: 2px;
    transition: background .15s;
}
.tp-hero-garage-pill .tp-pill-rm:hover { background: rgba(0,0,0,.18); }
.tp-hero-garage-pill.is-active .tp-pill-rm { background: rgba(255,255,255,.25); }
.tp-hero-garage-pill.is-active .tp-pill-rm:hover { background: rgba(255,255,255,.45); }

.tp-hero-add-vehicle {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 12px;
    background: transparent;
    border: 1.5px dashed var(--tp-primary);
    color: var(--tp-primary);
    border-radius: 9999px;
    font-size: 12px; font-weight: 700;
    cursor: pointer;
    transition: all .15s var(--tp-anim);
}
.tp-hero-add-vehicle:hover {
    background: var(--tp-primary);
    color: #fff;
    transform: translateY(-1px);
}

.tp-hero-compat-toggle {
    display: inline-flex; align-items: center; gap: 8px;
    cursor: pointer;
    user-select: none;
    margin-left: auto;
}
.tp-hero-compat-toggle input { display: none; }
.tp-hero-compat-switch {
    position: relative;
    display: inline-block;
    width: 34px; height: 18px;
    background: var(--tp-text-3);
    border-radius: 9999px;
    transition: background .2s;
    flex-shrink: 0;
}
.tp-hero-compat-switch::after {
    content: '';
    position: absolute;
    top: 2px; left: 2px;
    width: 14px; height: 14px;
    background: #fff;
    border-radius: 50%;
    transition: transform .2s var(--tp-anim);
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.tp-hero-compat-toggle input:checked + .tp-hero-compat-switch {
    background: var(--tp-primary);
}
.tp-hero-compat-toggle input:checked + .tp-hero-compat-switch::after {
    transform: translateX(16px);
}
.tp-hero-compat-label {
    font-size: 12px; font-weight: 600;
    color: var(--tp-text);
}

/* Linha 2: Search */
.tp-hero-search { display: flex; flex-direction: column; gap: 8px; }
.tp-hero-search-tabs {
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    background: var(--tp-bg);
    border-radius: 9999px;
    align-self: flex-start;
}
.tp-hero-tab {
    padding: 6px 14px;
    background: transparent;
    border: none;
    border-radius: 9999px;
    font-size: 12px; font-weight: 600;
    color: var(--tp-text-2);
    cursor: pointer;
    transition: all .15s;
}
.tp-hero-tab:hover { color: var(--tp-text); }
.tp-hero-tab.is-active {
    background: var(--tp-surface);
    color: var(--tp-primary);
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.tp-hero-search-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0;
    background: #fff;
    border: 2px solid var(--tp-border);
    border-radius: 14px;
    overflow: visible;
    transition: border-color .2s, box-shadow .2s, transform .2s;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.tp-hero-search-input-wrap:hover {
    border-color: color-mix(in srgb, var(--tp-primary) 35%, var(--tp-border));
    box-shadow: 0 4px 12px rgba(0,0,0,.06);
}
.tp-hero-search-input-wrap:focus-within {
    border-color: var(--tp-primary);
    box-shadow: 0 0 0 4px var(--tp-primary-tint), 0 8px 24px -4px color-mix(in srgb, var(--tp-primary) 20%, transparent);
    transform: translateY(-1px);
}
.tp-hero-search-icon {
    position: absolute;
    left: 16px; top: 50%; transform: translateY(-50%);
    color: var(--tp-text-3);
    pointer-events: none;
    transition: color .2s;
}
.tp-hero-search-input-wrap:focus-within .tp-hero-search-icon { color: var(--tp-primary); }
.tp-hero-search-input {
    flex: 1;
    height: 54px;
    padding: 0 14px 0 46px;
    background: transparent;
    border: none;
    font-size: 15px;
    color: var(--tp-text);
    outline: none;
    font-weight: 500;
}
.tp-hero-search-input::placeholder { color: var(--tp-text-3); font-weight: 400; }
.tp-hero-submit {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 0 24px;
    height: 50px;
    margin: 2px;
    background: linear-gradient(135deg, var(--tp-primary) 0%, color-mix(in srgb, var(--tp-primary) 85%, black) 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 14px; font-weight: 700;
    cursor: pointer;
    transition: filter .15s, transform .15s, box-shadow .15s;
    letter-spacing: .2px;
    box-shadow: 0 4px 12px -2px color-mix(in srgb, var(--tp-primary) 40%, transparent);
}
.tp-hero-submit:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px -2px color-mix(in srgb, var(--tp-primary) 50%, transparent);
}
.tp-hero-submit svg { transition: transform .25s var(--tp-anim); }
.tp-hero-submit:hover svg { transform: translateX(4px); }

/* Linha 3: Advanced filters */
.tp-hero-advanced { border-top: 1px solid var(--tp-border); padding-top: 12px; }
.tp-hero-advanced > summary {
    display: inline-flex; align-items: center; gap: 6px;
    cursor: pointer;
    font-size: 13px; font-weight: 600;
    color: var(--tp-text-2);
    list-style: none;
    padding: 4px 8px;
    border-radius: 6px;
    transition: color .15s, background .15s;
    user-select: none;
}
.tp-hero-advanced > summary:hover {
    color: var(--tp-text);
    background: var(--tp-bg);
}
.tp-hero-advanced > summary::-webkit-details-marker { display: none; }
.tp-hero-chev { transition: transform .2s; }
.tp-hero-advanced[open] .tp-hero-chev { transform: rotate(180deg); }
.tp-hero-advanced[open] > summary { color: var(--tp-text); }

.tp-hero-adv-grid {
    margin-top: 12px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}
.tp-hero-field {
    position: relative;
    display: flex; flex-direction: column; gap: 4px;
}
.tp-hero-field > label {
    font-size: 11px; font-weight: 700; color: var(--tp-text-2);
    text-transform: uppercase; letter-spacing: .4px;
}
.tp-hero-field > input {
    height: 38px;
    padding: 0 12px;
    background: var(--tp-surface);
    border: 1.5px solid var(--tp-border);
    border-radius: var(--tp-radius);
    font-size: 13px; color: var(--tp-text);
    transition: border-color .15s, box-shadow .15s;
}
.tp-hero-field > input:focus {
    outline: none;
    border-color: var(--tp-primary);
    box-shadow: 0 0 0 3px var(--tp-primary-tint);
}
.tp-hero-field > input[readonly] { cursor: pointer; }
.tp-hero-price-inputs {
    display: flex; align-items: center; gap: 6px;
}
.tp-hero-price-inputs input {
    flex: 1; min-width: 0;
    height: 38px;
    padding: 0 12px;
    background: var(--tp-surface);
    border: 1.5px solid var(--tp-border);
    border-radius: var(--tp-radius);
    font-size: 13px; color: var(--tp-text);
}
.tp-hero-price-inputs span { color: var(--tp-text-3); font-size: 14px; }

/* Autocomplete dropdown */
.tp-hero-ac-dropdown {
    position: absolute;
    top: 100%; left: 0; right: 0;
    margin-top: 4px;
    background: var(--tp-surface);
    border: 1px solid var(--tp-border);
    border-radius: var(--tp-radius);
    box-shadow: 0 8px 24px rgba(0,0,0,.14);
    max-height: 260px;
    overflow-y: auto;
    z-index: 100;
}
.tp-hero-ac-item {
    padding: 9px 12px;
    font-size: 13px;
    cursor: pointer;
    color: var(--tp-text);
    border-bottom: 1px solid var(--tp-bg);
    transition: background .12s;
}
.tp-hero-ac-item:hover,
.tp-hero-ac-item.is-focused {
    background: var(--tp-primary-tint);
}
.tp-hero-ac-item:last-child { border-bottom: 0; }
.tp-hero-ac-item-sub { font-size: 11px; color: var(--tp-text-3); margin-top: 2px; }
.tp-hero-ac-item.is-empty { color: var(--tp-text-3); font-style: italic; cursor: default; }
.tp-hero-ac-dropdown.tp-year-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    padding: 6px;
    max-height: none;
}
.tp-hero-ac-dropdown.tp-year-grid .tp-hero-ac-item {
    text-align: center;
    padding: 8px 4px;
    border: 1px solid var(--tp-border);
    border-radius: 6px;
}

/* Linha 4: Results meta */
.tp-hero-results {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    padding-top: 6px;
}
.tp-hero-count { font-size: 13px; color: var(--tp-text-2); }
.tp-hero-count strong { color: var(--tp-text); font-size: 15px; }
.tp-hero-chips { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.tp-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 10px;
    background: var(--tp-primary-tint);
    color: var(--tp-primary-dark);
    border-radius: 9999px;
    font-size: 12px; font-weight: 500;
    text-decoration: none;
    transition: all .15s var(--tp-anim);
}
.tp-chip:hover {
    background: var(--tp-primary);
    color: #fff;
    transform: translateY(-1px);
}
.tp-chip-label { opacity: .8; }
.tp-chip-val { font-weight: 600; }
.tp-chip-x { flex-shrink: 0; opacity: .7; }
.tp-chip:hover .tp-chip-x { opacity: 1; }
.tp-chip-clear {
    background: transparent;
    color: var(--tp-text-2);
    text-decoration: underline;
}
.tp-chip-clear:hover { background: transparent; color: var(--tp-text); transform: none; }

/* ─── PartCard v2 ──────────────────────────────────────────────────────── */
.tp-pc {
    display: flex;
    flex-direction: column;
    background: var(--tp-surface);
    border: 1px solid var(--tp-border);
    border-radius: var(--tp-radius-lg);
    overflow: hidden;
    position: relative;
    transition: transform .25s var(--tp-anim), box-shadow .25s var(--tp-anim), border-color .25s var(--tp-anim);
}
.tp-pc:hover {
    transform: translateY(-4px);
    box-shadow: var(--tp-shadow-lg);
    border-color: color-mix(in srgb, var(--tp-primary) 35%, var(--tp-border));
}
.tp-pc-click { cursor: pointer; }
.tp-pc-media {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--tp-bg);
}
.tp-pc-img {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    transition: opacity .35s var(--tp-anim), transform .6s var(--tp-anim);
}
.tp-pc-img-2 { opacity: 0; }
.tp-pc:hover .tp-pc-img-1 { opacity: 0; transform: scale(1.05); }
.tp-pc:hover .tp-pc-img-2 { opacity: 1; transform: scale(1.05); }
.tp-pc-badges {
    position: absolute; top: 10px; left: 10px;
    display: flex; flex-direction: column; gap: 5px;
    z-index: 2;
}
.tp-pc-badge {
    display: inline-block;
    padding: 4px 9px;
    font-size: 10px; font-weight: 700;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: .3px;
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.tp-pc-badge-last  { background: rgba(245,158,11,.95);  color: #fff; }
.tp-pc-badge-stock { background: rgba(16,185,129,.95);  color: #fff; }
.tp-pc-badge-out   { background: rgba(107,114,128,.95); color: #fff; }
.tp-pc-badge-cond  { background: rgba(255,255,255,.95); color: var(--tp-text); border: 1px solid rgba(0,0,0,.06); }
.tp-pc-badge-cat   { background: var(--tp-primary-tint); color: var(--tp-primary-dark); padding: 3px 8px; font-size: 10px; }

.tp-pc-fav {
    position: absolute; top: 10px; right: 10px;
    width: 34px; height: 34px;
    background: rgba(255,255,255,.95);
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    border: 1px solid rgba(0,0,0,.06);
    border-radius: 50%;
    color: var(--tp-text-2);
    cursor: pointer;
    z-index: 3;
    display: inline-flex; align-items: center; justify-content: center;
    transition: all .2s var(--tp-anim);
}
.tp-pc-fav:hover { color: var(--tp-danger); transform: scale(1.08); }
.tp-pc-fav.is-fav { color: var(--tp-danger); }
.tp-pc-fav.is-fav svg { fill: var(--tp-danger); }

.tp-pc-body {
    padding: 12px 14px 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}
.tp-pc-cat { line-height: 1; }
.tp-pc-title {
    font-size: 15px; font-weight: 700;
    color: var(--tp-text);
    line-height: 1.3;
    margin: 0;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 40px;
}
.tp-pc-veh {
    font-size: 11px; font-weight: 700;
    color: var(--tp-text-2);
    text-transform: uppercase;
    letter-spacing: .4px;
    line-height: 1.3;
}
.tp-pc-ref {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--tp-bg);
    padding: 5px 9px;
    border-radius: 6px;
    align-self: flex-start;
    max-width: 100%;
    border: 1px solid var(--tp-border);
}
.tp-pc-ref-label {
    font-size: 9px; font-weight: 800;
    color: var(--tp-primary);
    text-transform: uppercase; letter-spacing: .5px;
    padding: 1px 5px;
    background: var(--tp-primary-tint);
    border-radius: 3px;
    flex-shrink: 0;
}
.tp-pc-ref-val {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px; font-weight: 700;
    color: var(--tp-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tp-pc-ref-copy {
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--tp-text-3);
    display: inline-flex; align-items: center; justify-content: center;
    width: 20px; height: 20px;
    border-radius: 4px;
    transition: all .15s;
    flex-shrink: 0;
}
.tp-pc-ref-copy:hover {
    color: var(--tp-primary);
    background: var(--tp-primary-tint);
}
.tp-pc-ref-copy.is-copied { color: var(--tp-success); }

.tp-pc-foot {
    padding: 0 14px 14px;
    display: flex; flex-direction: column; gap: 8px;
    margin-top: auto;
}
.tp-pc-compat-link {
    display: inline-flex; align-items: center; gap: 5px;
    background: transparent;
    border: none;
    padding: 4px 0;
    font-size: 11px; font-weight: 600;
    color: var(--tp-primary);
    cursor: pointer;
    text-decoration: none;
    align-self: flex-start;
    transition: color .15s, gap .15s;
}
.tp-pc-compat-link:hover { color: var(--tp-primary-dark); gap: 8px; }
.tp-pc-price {
    font-size: 22px; font-weight: 800;
    color: var(--tp-text);
    line-height: 1;
}
.tp-pc-price.tp-pc-price-na {
    font-size: 14px;
    color: var(--tp-text-3);
    font-weight: 600;
    font-style: italic;
}
.tp-pc-veh.tp-pc-veh-empty {
    color: var(--tp-text-3);
    opacity: .5;
}
.tp-pc-price .woocommerce-Price-amount { color: inherit; font-size: inherit; font-weight: inherit; }
.tp-pc-actions { display: flex; gap: 6px; }
.tp-pc-btn {
    flex: 1;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 10px 12px;
    background: var(--tp-primary);
    color: #fff !important;
    border: none;
    border-radius: var(--tp-radius);
    font-size: 13px; font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: all .15s var(--tp-anim);
}
.tp-pc-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.tp-pc-btn-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 42px; height: 42px;
    background: var(--tp-surface);
    color: var(--tp-text-2) !important;
    border: 1.5px solid var(--tp-border);
    border-radius: var(--tp-radius);
    cursor: pointer;
    text-decoration: none;
    transition: all .15s var(--tp-anim);
}
.tp-pc-btn-icon:hover {
    border-color: var(--tp-primary);
    color: var(--tp-primary) !important;
    transform: translateY(-1px);
}
.tp-pc-btn-icon.tp-pc-btn-fav.is-fav {
    color: var(--tp-danger) !important;
    border-color: var(--tp-danger);
    background: color-mix(in srgb, var(--tp-danger) 8%, var(--tp-surface));
}
.tp-pc-btn-icon.tp-pc-btn-fav.is-fav svg { fill: var(--tp-danger); }

/* Hide the top-right floating fav when bottom one exists */
.tp-pc-fav { display: none; }

/* ─── Grid (WC override) ───────────────────────────────────────────────── */
ul.products,
.woocommerce ul.products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 18px;
    padding: 0;
    margin: 0;
    list-style: none;
}
ul.products li.product,
.woocommerce ul.products li.product {
    width: 100% !important;
    margin: 0 !important;
    float: none !important;
    padding: 0 !important;
}

/* ─── Modal (quick-add + compat) ───────────────────────────────────────── */
.tp-modal {
    position: fixed; inset: 0;
    z-index: 100000;
    display: flex; align-items: center; justify-content: center;
    animation: tp-fade-in .2s var(--tp-anim);
}
.tp-modal[hidden] { display: none; }
.tp-modal-backdrop {
    position: absolute; inset: 0;
    background: rgba(15,23,42,.55);
    backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
    cursor: pointer;
}
.tp-modal-panel {
    position: relative;
    width: min(440px, calc(100vw - 32px));
    background: var(--tp-surface);
    border-radius: var(--tp-radius-lg);
    box-shadow: 0 24px 64px rgba(0,0,0,.28);
    padding: 24px;
    animation: tp-pop-in .25s var(--tp-anim);
}
.tp-modal-panel.tp-compat-panel { width: min(580px, calc(100vw - 32px)); max-height: 80vh; overflow-y: auto; }
.tp-modal-close {
    position: absolute; top: 12px; right: 14px;
    background: transparent; border: none;
    font-size: 26px; line-height: 1;
    color: var(--tp-text-3);
    cursor: pointer;
    padding: 0; width: 32px; height: 32px;
    border-radius: 50%;
    transition: background .15s, color .15s;
}
.tp-modal-close:hover { background: var(--tp-bg); color: var(--tp-text); }
.tp-modal-panel h3 {
    margin: 0 0 6px;
    font-size: 17px; font-weight: 700; color: var(--tp-text);
}
.tp-modal-hint {
    margin: 0 0 14px;
    font-size: 12px; color: var(--tp-text-2);
}
/* Quick-add modal — autocomplete fields ligados aos catálogos */
.tp-qadd-head {
    display: flex; align-items: flex-start; gap: 12px;
    margin-bottom: 18px;
}
.tp-qadd-icon {
    flex-shrink: 0;
    width: 44px; height: 44px;
    display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--tp-primary-tint), color-mix(in srgb, var(--tp-primary) 25%, white));
    color: var(--tp-primary);
    border-radius: 12px;
}
.tp-qadd-head h3 { margin: 0 0 2px; font-size: 17px; font-weight: 700; color: var(--tp-text); }
.tp-qadd-head .tp-modal-hint { margin: 0; font-size: 12px; color: var(--tp-text-2); line-height: 1.4; }

.tp-qadd-fields {
    display: grid; gap: 10px;
    margin-bottom: 14px;
}
.tp-qadd-field { position: relative; display: flex; flex-direction: column; gap: 4px; }
.tp-qadd-field > label {
    font-size: 11px; font-weight: 700;
    color: var(--tp-text-2);
    text-transform: uppercase; letter-spacing: .5px;
}
.tp-qadd-input-wrap {
    position: relative;
    display: flex; align-items: center;
}
.tp-qadd-input-wrap input {
    flex: 1;
    height: 42px;
    padding: 0 36px 0 14px;
    background: var(--tp-bg);
    border: 1.5px solid var(--tp-border);
    border-radius: var(--tp-radius);
    font-size: 13px;
    color: var(--tp-text);
    transition: all .15s var(--tp-anim);
}
.tp-qadd-input-wrap input:not(:disabled):focus {
    outline: none;
    border-color: var(--tp-primary);
    box-shadow: 0 0 0 3px var(--tp-primary-tint);
    background: var(--tp-surface);
}
.tp-qadd-input-wrap input:disabled {
    opacity: .55; cursor: not-allowed;
}
.tp-qadd-input-wrap input[readonly]:not(:disabled) { cursor: pointer; }
.tp-qadd-chev {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    color: var(--tp-text-3);
    pointer-events: none;
}
.tp-modal-btn {
    width: 100%;
    padding: 11px 16px;
    background: var(--tp-primary);
    color: #fff;
    border: none;
    border-radius: var(--tp-radius);
    font-size: 14px; font-weight: 700;
    cursor: pointer;
    transition: filter .15s, transform .15s;
}
.tp-modal-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.tp-modal-future {
    margin: 14px 0 0;
    padding: 9px 12px;
    background: var(--tp-bg);
    border-left: 3px solid var(--tp-primary);
    border-radius: 6px;
    font-size: 11px; color: var(--tp-text-2);
}

/* Compat list */
.tp-compat-origin {
    margin: 0 0 16px;
    padding: 10px 14px;
    background: var(--tp-primary-tint);
    border-radius: var(--tp-radius);
    font-size: 13px;
    color: var(--tp-primary-dark);
}
.tp-compat-origin strong { display: block; font-size: 11px; opacity: .8; text-transform: uppercase; letter-spacing: .4px; margin-bottom: 2px; }
.tp-compat-list { display: flex; flex-direction: column; gap: 8px; }
.tp-compat-item {
    padding: 10px 12px;
    background: var(--tp-bg);
    border-radius: var(--tp-radius);
    font-size: 13px;
    color: var(--tp-text);
}
.tp-compat-item-h { font-weight: 700; }
.tp-compat-item-sub { font-size: 11px; color: var(--tp-text-2); margin-top: 2px; }
.tp-compat-empty {
    padding: 20px;
    text-align: center;
    color: var(--tp-text-3);
    font-style: italic;
}

/* ─── Animations ───────────────────────────────────────────────────────── */
@keyframes tp-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes tp-pop-in {
    from { opacity: 0; transform: translateY(10px) scale(.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes tp-shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
.tp-skel {
    background: linear-gradient(90deg, var(--tp-bg) 0, color-mix(in srgb, var(--tp-bg) 60%, white) 50%, var(--tp-bg) 100%);
    background-size: 200% 100%;
    animation: tp-shimmer 1.4s linear infinite;
    border-radius: var(--tp-radius);
}

/* ─── Mobile pass ──────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .tp-hero { padding: 16px; }
    .tp-hero-garage-strip { flex-direction: column; align-items: stretch; }
    .tp-hero-compat-toggle { margin-left: 0; justify-content: space-between; }
    .tp-hero-search-input { height: 44px; font-size: 14px; }
    .tp-hero-submit { padding: 0 16px; height: 40px; font-size: 13px; }
    .tp-hero-submit span { display: none; }
    ul.products, .woocommerce ul.products {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .tp-pc-title { font-size: 13px; min-height: 34px; }
    .tp-pc-price { font-size: 18px; }
    .tp-pc-body { padding: 10px 10px 4px; }
    .tp-pc-foot { padding: 0 10px 10px; }
    .tp-pc-btn { font-size: 12px; padding: 9px 8px; }
    .tp-pc-btn-icon { width: 36px; height: 36px; }
}

/* ─── Hide Ignavo default elements when ours rendered ──────────────────── */
ul.products li.product > *:not(.tp-pc) { display: none !important; }

/* ─── Technical Data Tab (single product) ──────────────────────────────── */
.tp-tab-technical-data { font-family: inherit; }
.tp-td-section { margin: 20px 0 28px; }
.tp-td-section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--tp-text, #111);
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--tp-border, #e5e7eb);
    letter-spacing: .2px;
}
.tp-refs-table, .tp-specs-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255,255,255,.6);
    border: 1px solid var(--tp-border, #e5e7eb);
    border-radius: 12px;
    overflow: hidden;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.tp-refs-table thead th {
    background: linear-gradient(180deg, rgba(0,0,0,.04), rgba(0,0,0,.02));
    padding: 10px 14px;
    font-size: 12px;
    font-weight: 600;
    text-align: left;
    color: var(--tp-muted, #6b7280);
    text-transform: uppercase;
    letter-spacing: .5px;
    border-bottom: 1px solid var(--tp-border, #e5e7eb);
}
.tp-refs-table td, .tp-specs-table td, .tp-specs-table th {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(0,0,0,.05);
    font-size: 13.5px;
    vertical-align: top;
    line-height: 1.45;
}
.tp-refs-table tr:last-child td, .tp-specs-table tr:last-child td, .tp-specs-table tr:last-child th {
    border-bottom: 0;
}
.tp-specs-table th {
    width: 35%;
    color: var(--tp-muted, #6b7280);
    font-weight: 500;
    text-align: left;
    background: rgba(0,0,0,.015);
}
.tp-specs-table td { color: var(--tp-text, #111); }
.tp-td-na { color: var(--tp-muted-soft, #9ca3af); font-style: italic; font-size: 13px; }
.tp-td-code {
    background: rgba(0, 100, 255, .06);
    color: #1e40af;
    padding: 2px 8px;
    border-radius: 6px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 13px;
    border: 1px solid rgba(0, 100, 255, .15);
}

/* Alterna fundo das linhas em ecrãs grandes para legibilidade. */
@media (min-width: 768px) {
    .tp-specs-table tbody tr:nth-child(even) th,
    .tp-specs-table tbody tr:nth-child(even) td {
        background: rgba(0,0,0,.012);
    }
}

/* ─── Compatibilities Tab ──────────────────────────────────────────────── */
.tp-tab-compatibilities { font-family: inherit; }
.tp-compat-empty { color: var(--tp-muted, #6b7280); font-style: italic; }
.tp-compat-intro { margin: 0 0 12px; color: var(--tp-text-2, #374151); font-size: 13.5px; }
.tp-compat-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.tp-compat-item { padding: 10px 14px; border-radius: 10px; background: rgba(255,255,255,.55); border: 1px solid var(--tp-border, #e5e7eb); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); transition: background .15s; }
.tp-compat-item:hover { background: rgba(255,255,255,.85); }
.tp-compat-item--variant { border-left: 3px solid var(--tp-primary, #2563eb); }
.tp-compat-item--model   { border-left: 3px solid color-mix(in srgb, var(--tp-primary, #2563eb) 65%, white); }
.tp-compat-item--make    { border-left: 3px solid color-mix(in srgb, var(--tp-primary, #2563eb) 30%, white); }
.tp-compat-main { display: flex; align-items: center; gap: 8px; color: var(--tp-text, #111); font-size: 13.5px; line-height: 1.4; }
.tp-compat-icon { flex-shrink: 0; color: var(--tp-primary, #2563eb); }
.tp-compat-line { font-weight: 500; }
.tp-compat-notes { margin-top: 4px; padding-left: 24px; font-size: 12px; color: var(--tp-muted, #6b7280); font-style: italic; }

/* ─── Origin Vehicle Tab ───────────────────────────────────────────────── */
.tp-tab-origin-vehicle { font-family: inherit; }
.tp-origin-empty { color: var(--tp-muted, #6b7280); font-style: italic; }
.tp-origin-gallery { margin-bottom: 20px; }
.tp-origin-main { width: 100%; max-height: 360px; overflow: hidden; border-radius: 12px; background: #f5f5f5; box-shadow: 0 2px 8px rgba(0,0,0,.06); display: flex; align-items: center; justify-content: center; }
.tp-origin-main img { width: 100%; height: 360px; object-fit: cover; display: block; }
.tp-origin-thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; padding-bottom: 4px; }
.tp-origin-thumb { width: 72px; height: 56px; border-radius: 8px; overflow: hidden; padding: 0; background: #f5f5f5; cursor: pointer; border: 2px solid transparent; transition: border-color .2s; flex-shrink: 0; }
.tp-origin-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tp-origin-thumb:hover { border-color: var(--tp-primary, #2563eb); }
.tp-origin-thumb.is-active { border-color: var(--tp-primary, #2563eb); }
.tp-origin-specs { margin-top: 16px; }
.tp-origin-link { margin-top: 20px; text-align: right; }
.tp-origin-link-btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 16px; background: var(--tp-primary, #2563eb); color: #fff; text-decoration: none; border-radius: 8px; font-size: 13px; font-weight: 600; transition: background .15s; }
.tp-origin-link-btn:hover { background: color-mix(in srgb, var(--tp-primary, #2563eb) 85%, black); color: #fff; }

/* ─── Other Vehicle Parts Tab ──────────────────────────────────────────── */
.tp-tab-other-parts { font-family: inherit; }
.tp-otherp-empty { color: var(--tp-muted, #6b7280); font-style: italic; }
.tp-otherp-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.tp-otherp-search { flex: 1; min-width: 220px; display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: #fff; border: 1.5px solid var(--tp-border, #e5e7eb); border-radius: 10px; transition: border-color .15s, box-shadow .15s; }
.tp-otherp-search:focus-within { border-color: var(--tp-primary, #2563eb); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tp-primary, #2563eb) 18%, transparent); }
.tp-otherp-search svg { color: var(--tp-muted, #6b7280); flex-shrink: 0; }
.tp-otherp-search-input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 13.5px; color: var(--tp-text, #111); }
.tp-otherp-count { font-size: 12px; color: var(--tp-muted, #6b7280); flex-shrink: 0; }
.tp-otherp-count-shown { font-weight: 600; color: var(--tp-text, #111); }
.tp-otherp-table { width: 100%; border-collapse: collapse; background: rgba(255,255,255,.6); border: 1px solid var(--tp-border, #e5e7eb); border-radius: 12px; overflow: hidden; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.tp-otherp-table thead th { background: linear-gradient(180deg, rgba(0,0,0,.04), rgba(0,0,0,.02)); padding: 10px 14px; font-size: 11px; font-weight: 600; text-align: left; color: var(--tp-muted, #6b7280); text-transform: uppercase; letter-spacing: .5px; border-bottom: 1px solid var(--tp-border, #e5e7eb); }
.tp-otherp-col-name  { width: 60%; }
.tp-otherp-col-state { width: 20%; text-align: center; }
.tp-otherp-col-price { width: 20%; text-align: right; }
.tp-otherp-row { transition: background .12s; cursor: pointer; }
.tp-otherp-row:hover { background: rgba(0,0,0,.025); }
.tp-otherp-row td { padding: 10px 14px; border-bottom: 1px solid rgba(0,0,0,.05); font-size: 13.5px; vertical-align: middle; }
.tp-otherp-row:last-child td { border-bottom: 0; }
.tp-otherp-name { color: var(--tp-text, #111); }
.tp-otherp-link { display: block; color: inherit; text-decoration: none; }
.tp-otherp-link:hover .tp-otherp-title { color: var(--tp-primary, #2563eb); text-decoration: underline; }
.tp-otherp-title { font-weight: 500; }
.tp-otherp-ref { display: block; font-size: 11.5px; color: var(--tp-muted, #6b7280); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; margin-top: 2px; }
.tp-otherp-state { text-align: center; }
.tp-otherp-badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 9999px; font-size: 11.5px; font-weight: 600; }
.tp-otherp-badge-ok  { background: color-mix(in srgb, #10b981 14%, white); color: #047857; }
.tp-otherp-badge-out { background: color-mix(in srgb, #ef4444 14%, white); color: #b91c1c; }
.tp-otherp-price { text-align: right; font-weight: 600; color: var(--tp-text, #111); }
.tp-otherp-pager { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 16px; font-size: 13px; color: var(--tp-muted, #6b7280); }
.tp-otherp-pager-btn { padding: 6px 12px; background: #fff; border: 1.5px solid var(--tp-border, #e5e7eb); border-radius: 8px; cursor: pointer; color: var(--tp-text, #111); font-size: 12px; font-weight: 500; transition: all .15s; }
.tp-otherp-pager-btn:hover:not(:disabled) { border-color: var(--tp-primary, #2563eb); color: var(--tp-primary, #2563eb); }
.tp-otherp-pager-btn:disabled { opacity: .4; cursor: not-allowed; }
