/**
 * TP Storefront — Liquid Glass Design System
 *
 * Variables: dark/light mode via prefers-color-scheme + .tp-theme-dark/light
 * data-attr override. Surfaces use `backdrop-filter: blur` for the glass
 * effect over a multi-layered gradient background.
 *
 * Decisão 2026-05-25 (user):
 *   Plantify (dark) + Corelystics (light) mash-up. Liquid-glass + chips
 *   removíveis + sticky filters sidebar.
 */

/* ───── Tokens (light default) ───── */
.tp-storefront-active {
    --tp-bg: #fafbfc;
    --tp-bg-gradient: radial-gradient(at 0% 0%, rgba(120,180,255,0.10) 0px, transparent 50%),
                      radial-gradient(at 100% 0%, rgba(180,255,200,0.10) 0px, transparent 50%);
    --tp-glass-bg: rgba(255,255,255,0.55);
    --tp-glass-border: rgba(255,255,255,0.7);
    --tp-glass-blur: 14px;
    --tp-text: #0f172a;
    --tp-text-muted: #64748b;
    --tp-primary: #2563eb;
    --tp-primary-hover: #1d4ed8;
    --tp-accent: #14b8a6;
    --tp-radius: 14px;
    --tp-radius-sm: 8px;
    --tp-shadow: 0 4px 24px -8px rgba(0,0,0,0.10), 0 0 0 1px rgba(15,23,42,0.04);
    --tp-shadow-hover: 0 10px 40px -10px rgba(0,0,0,0.18), 0 0 0 1px rgba(15,23,42,0.06);
}

@media (prefers-color-scheme: dark) {
    .tp-storefront-active {
        --tp-bg: #0a0d12;
        --tp-bg-gradient: radial-gradient(at 0% 0%, rgba(80,120,200,0.18) 0px, transparent 50%),
                          radial-gradient(at 100% 100%, rgba(20,184,166,0.10) 0px, transparent 50%);
        --tp-glass-bg: rgba(20,25,35,0.55);
        --tp-glass-border: rgba(255,255,255,0.08);
        --tp-text: #f1f5f9;
        --tp-text-muted: #94a3b8;
        --tp-primary: #60a5fa;
        --tp-primary-hover: #93c5fd;
        --tp-shadow: 0 4px 24px -8px rgba(0,0,0,0.50), 0 0 0 1px rgba(255,255,255,0.05);
        --tp-shadow-hover: 0 10px 40px -10px rgba(0,0,0,0.70), 0 0 0 1px rgba(255,255,255,0.10);
    }
}

/* ───── Body background (subtle) ───── */
.tp-storefront-active {
    background: var(--tp-bg);
    background-image: var(--tp-bg-gradient);
    color: var(--tp-text);
}

/* ───── Product card (loop) ───── */
.tp-storefront-active .tp-card,
.tp-storefront-active .product .tp-card { /* fallback selector */
    background: var(--tp-glass-bg);
    backdrop-filter: blur(var(--tp-glass-blur)) saturate(140%);
    -webkit-backdrop-filter: blur(var(--tp-glass-blur)) saturate(140%);
    border: 1px solid var(--tp-glass-border);
    border-radius: var(--tp-radius);
    box-shadow: var(--tp-shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.tp-storefront-active .tp-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--tp-shadow-hover);
    border-color: rgba(96,165,250,0.30);
}

.tp-card-imgwrap {
    display: block;
    aspect-ratio: 4/3;
    background: rgba(0,0,0,0.04);
    overflow: hidden;
    position: relative;
}

@media (prefers-color-scheme: dark) {
    .tp-card-imgwrap { background: rgba(255,255,255,0.04); }
}

.tp-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.tp-card:hover .tp-card-img {
    transform: scale(1.04);
}

.tp-card-body {
    padding: 14px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.tp-card-title {
    margin: 0;
    font-size: 15px;
    line-height: 1.35;
    font-weight: 600;
    color: var(--tp-text);
    /* clamp to 2 lines */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tp-card-title a {
    color: inherit;
    text-decoration: none;
}

.tp-card-subtitle {
    font-size: 13px;
    color: var(--tp-text-muted);
    margin-bottom: 4px;
}

.tp-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
    padding-top: 10px;
}

.tp-card-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--tp-text);
}

.tp-card-price .woocommerce-Price-amount {
    font-weight: 700;
}

.tp-card-no-price {
    font-size: 13px;
    color: var(--tp-text-muted);
    font-weight: 500;
}

.tp-card-cta {
    background: var(--tp-primary);
    color: #fff !important;
    border: 0;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s ease, transform 0.1s ease;
    white-space: nowrap;
}

.tp-card-cta:hover {
    background: var(--tp-primary-hover);
    transform: translateY(-1px);
}

.tp-card-cta-secondary {
    background: transparent !important;
    color: var(--tp-primary) !important;
    border: 1px solid currentColor;
}

/* ───── Grid de produtos no shop ───── */
.tp-storefront-active.archive .products,
.tp-storefront-active .columns-4.products,
.tp-storefront-active .products.columns-3 {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    padding: 0;
    margin: 24px 0;
    list-style: none;
}

@media (max-width: 1200px) { .tp-storefront-active .products { grid-template-columns: repeat(3, 1fr) !important; } }
@media (max-width: 900px)  { .tp-storefront-active .products { grid-template-columns: repeat(2, 1fr) !important; } }
@media (max-width: 540px)  { .tp-storefront-active .products { grid-template-columns: 1fr !important; } }

.tp-storefront-active .products .product,
.tp-storefront-active .products li.product {
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* ───── Single product gallery (already styled inline in plugin) ───── */

/* ───── "Viaturas para Peças" page ───── */
.tp-vpp-wrap {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
    max-width: 1320px;
    margin: 24px auto;
    padding: 0 16px;
}

@media (max-width: 900px) {
    .tp-vpp-wrap { grid-template-columns: 1fr; }
    .tp-vpp-sidebar { position: relative !important; top: 0 !important; }
}

.tp-vpp-sidebar {
    background: var(--tp-glass-bg, #fff);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    border: 1px solid var(--tp-glass-border, rgba(15,23,42,0.08));
    border-radius: 14px;
    padding: 18px;
    position: sticky;
    top: 80px;
    align-self: start;
    box-shadow: 0 4px 20px -8px rgba(0,0,0,0.10);
}

.tp-vpp-filters {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.tp-vpp-search input,
.tp-vpp-field select {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid rgba(15,23,42,0.12);
    border-radius: 8px;
    font-size: 14px;
    background: rgba(255,255,255,0.6);
}

.tp-vpp-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--tp-text-muted, #64748b);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.tp-vpp-apply {
    background: var(--tp-primary, #2563eb);
    color: #fff;
    border: 0;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

.tp-vpp-clear {
    text-align: center;
    color: var(--tp-text-muted, #64748b);
    text-decoration: none;
    font-size: 13px;
    padding: 8px;
}

.tp-vpp-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 18px;
}

.tp-vpp-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: var(--tp-text);
}

.tp-vpp-count {
    color: var(--tp-text-muted, #64748b);
    font-size: 14px;
}

.tp-vpp-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.tp-vpp-grid[data-cols="4"] { grid-template-columns: repeat(4, 1fr); }
.tp-vpp-grid[data-cols="2"] { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .tp-vpp-grid { grid-template-columns: repeat(2, 1fr) !important; } }
@media (max-width: 540px) { .tp-vpp-grid { grid-template-columns: 1fr !important; } }

.tp-vpp-card {
    display: block;
    background: var(--tp-glass-bg, rgba(255,255,255,0.6));
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    border: 1px solid var(--tp-glass-border, rgba(15,23,42,0.08));
    border-radius: 14px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.tp-vpp-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.15);
}

.tp-vpp-card-img {
    width: 100%;
    aspect-ratio: 4/3;
    background-color: #f3f4f6;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.tp-vpp-card-body {
    padding: 12px 14px 16px;
}

.tp-vpp-card-title {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 600;
    color: var(--tp-text);
}

.tp-vpp-card-variant {
    font-size: 13px;
    color: var(--tp-text-muted, #64748b);
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tp-vpp-card-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--tp-text-muted, #64748b);
}

.tp-vpp-card-meta span {
    padding: 2px 8px;
    background: rgba(15,23,42,0.06);
    border-radius: 999px;
}

.tp-vpp-empty {
    text-align: center;
    color: var(--tp-text-muted, #64748b);
    padding: 60px 20px;
    font-size: 16px;
}

/* ───── Master/Associate parts section (single product) ───── */
.tp-related-composites {
    margin: 32px 0;
    padding: 18px;
    background: var(--tp-glass-bg);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    border: 1px solid var(--tp-glass-border);
    border-radius: var(--tp-radius);
}

.tp-related-composites h3 {
    margin: 0 0 14px;
    font-size: 18px;
    font-weight: 700;
}

.tp-related-composites .tp-rc-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.tp-related-composites .tp-rc-item {
    display: flex;
    gap: 12px;
    padding: 10px;
    border-radius: 10px;
    background: rgba(255,255,255,0.4);
    text-decoration: none;
    color: inherit;
    transition: background 0.15s ease;
}

.tp-related-composites .tp-rc-item:hover {
    background: rgba(255,255,255,0.6);
}

.tp-related-composites .tp-rc-thumb {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    background: #f3f4f6;
}

.tp-related-composites .tp-rc-name {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    margin: 0;
}

.tp-related-composites .tp-rc-price {
    font-size: 12px;
    color: var(--tp-text-muted);
    margin-top: 2px;
}

.tp-related-composites .tp-rc-tag {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: var(--tp-accent);
    color: #fff;
    border-radius: 999px;
    margin-bottom: 8px;
}

/* ────────────────────────────────────────────────────────
   SINGLE PRODUCT — full redesign liquid-glass
   ──────────────────────────────────────────────────────── */
.tp-sp-page {
    padding: 24px 16px 60px;
    background: var(--tp-bg);
    background-image: var(--tp-bg-gradient);
    min-height: 100vh;
}

.tp-sp-container {
    max-width: 1320px;
    margin: 0 auto;
}

.tp-sp-breadcrumbs {
    font-size: 13px;
    color: var(--tp-text-muted);
    margin-bottom: 16px;
}

.tp-sp-breadcrumbs a {
    color: var(--tp-text-muted);
    text-decoration: none;
}

.tp-sp-breadcrumbs a:hover { color: var(--tp-primary); }

.tp-sp-bc-sep {
    margin: 0 8px;
    opacity: 0.5;
}

.tp-sp-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 32px;
    margin-bottom: 32px;
}

@media (max-width: 980px) {
    .tp-sp-grid { grid-template-columns: 1fr; gap: 20px; }
}

/* GALLERY */
.tp-sp-gallery {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.tp-sp-main-img-wrap {
    background: var(--tp-glass-bg);
    backdrop-filter: blur(var(--tp-glass-blur)) saturate(140%);
    -webkit-backdrop-filter: blur(var(--tp-glass-blur)) saturate(140%);
    border: 1px solid var(--tp-glass-border);
    border-radius: var(--tp-radius);
    padding: 18px;
    aspect-ratio: 1/1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tp-sp-main-img-wrap img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: var(--tp-radius-sm);
}

.tp-sp-thumbs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.tp-sp-thumb {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 10px;
    overflow: hidden;
    background: var(--tp-glass-bg);
    cursor: pointer;
    transition: border-color 0.15s ease, transform 0.1s ease;
}

.tp-sp-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tp-sp-thumb:hover { transform: scale(1.04); }
.tp-sp-thumb.is-active { border-color: var(--tp-primary); }

.tp-sp-videos {
    margin-top: 8px;
}

.tp-sp-videos .tp-video-gallery { display: flex; flex-direction: column; gap: 10px; }
.tp-sp-videos iframe, .tp-sp-videos video {
    border-radius: var(--tp-radius-sm);
    width: 100%;
    max-width: 100%;
}

/* INFO CARD (sticky) */
.tp-sp-info {
    position: sticky;
    top: 24px;
    align-self: start;
}

@media (max-width: 980px) {
    .tp-sp-info { position: relative; top: 0; }
}

.tp-sp-info-card {
    background: var(--tp-glass-bg);
    backdrop-filter: blur(var(--tp-glass-blur)) saturate(140%);
    -webkit-backdrop-filter: blur(var(--tp-glass-blur)) saturate(140%);
    border: 1px solid var(--tp-glass-border);
    border-radius: var(--tp-radius);
    padding: 26px 26px 22px;
    box-shadow: var(--tp-shadow);
}

.tp-sp-title {
    margin: 0 0 6px;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.25;
    color: var(--tp-text);
    letter-spacing: -0.01em;
}

@media (max-width: 540px) { .tp-sp-title { font-size: 22px; } }

.tp-sp-subtitle {
    color: var(--tp-text-muted);
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 14px;
}

.tp-sp-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 18px;
}

.tp-sp-badge {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(15, 23, 42, 0.06);
    color: var(--tp-text);
    font-size: 12px;
    font-weight: 600;
    border-radius: 999px;
    letter-spacing: 0.02em;
}

@media (prefers-color-scheme: dark) {
    .tp-sp-badge { background: rgba(255,255,255,0.08); }
}

.tp-sp-badge-ref {
    background: var(--tp-primary);
    color: #fff;
    font-family: 'SF Mono', 'JetBrains Mono', monospace;
}

.tp-sp-badge-cond {
    background: var(--tp-accent);
    color: #fff;
}

.tp-sp-badge-qual {
    background: rgba(251,191,36,0.15);
    color: #b45309;
}

.tp-sp-price {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin: 14px 0 8px;
    padding: 14px 0;
    border-top: 1px solid var(--tp-glass-border);
    border-bottom: 1px solid var(--tp-glass-border);
}

.tp-sp-price .woocommerce-Price-amount,
.tp-sp-price bdi {
    font-size: 32px;
    font-weight: 800;
    color: var(--tp-text);
}

.tp-sp-price-tax {
    font-size: 12px;
    color: var(--tp-text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tp-sp-no-price {
    font-size: 18px;
    color: var(--tp-text-muted);
    font-weight: 600;
}

.tp-sp-stock-line {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0 16px;
    font-size: 14px;
    color: #15803d;
    font-weight: 500;
}

.tp-sp-stock-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #15803d;
    box-shadow: 0 0 0 3px rgba(21,128,61,0.18);
}

.tp-sp-cta {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 14px;
}

.tp-sp-cta .single_add_to_cart_button {
    width: 100%;
    background: var(--tp-primary) !important;
    color: #fff !important;
    padding: 14px 22px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    border-radius: 999px !important;
    border: 0 !important;
    transition: background 0.15s ease, transform 0.1s ease;
}

.tp-sp-cta .single_add_to_cart_button:hover {
    background: var(--tp-primary-hover) !important;
    transform: translateY(-1px);
}

.tp-sp-cta .quantity {
    margin-right: 0 !important;
}

.tp-sp-perks {
    list-style: none;
    padding: 0;
    margin: 18px 0 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 13px;
    color: var(--tp-text-muted);
}

.tp-sp-perks li {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tp-sp-perks svg { color: var(--tp-primary); flex-shrink: 0; }

/* TABS */
.tp-sp-tabs-wrap {
    background: var(--tp-glass-bg);
    backdrop-filter: blur(var(--tp-glass-blur)) saturate(140%);
    -webkit-backdrop-filter: blur(var(--tp-glass-blur)) saturate(140%);
    border: 1px solid var(--tp-glass-border);
    border-radius: var(--tp-radius);
    padding: 6px 0;
    margin: 24px 0;
    overflow: hidden;
}

.tp-sp-tabs-wrap .woocommerce-tabs {
    padding: 0 18px;
}

.tp-sp-tabs-wrap .wc-tabs,
.tp-sp-tabs-wrap ul.wc-tabs {
    display: flex !important;
    flex-wrap: wrap;
    gap: 4px;
    padding: 8px 0 !important;
    margin: 0 0 16px !important;
    border: 0 !important;
    list-style: none !important;
    background: transparent !important;
}

.tp-sp-tabs-wrap .wc-tabs li {
    margin: 0 !important;
    padding: 0 !important;
    background: rgba(15,23,42,0.04) !important;
    border: 0 !important;
    border-radius: 999px !important;
    transition: background 0.15s ease;
}

.tp-sp-tabs-wrap .wc-tabs li.active {
    background: var(--tp-primary) !important;
}

.tp-sp-tabs-wrap .wc-tabs li a {
    color: var(--tp-text) !important;
    padding: 8px 16px !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    text-decoration: none !important;
}

.tp-sp-tabs-wrap .wc-tabs li.active a { color: #fff !important; }

.tp-sp-tabs-wrap .woocommerce-Tabs-panel {
    padding: 12px 0 18px !important;
}

.tp-sp-related {
    margin-top: 32px;
}

.tp-sp-error {
    text-align: center;
    padding: 80px 20px;
    color: var(--tp-text-muted);
    font-size: 18px;
}


/* ────────────────────────────────────────────────────────
   SHOP ARCHIVE — sidebar filtros + grid
   ──────────────────────────────────────────────────────── */
.tp-sa-page {
    padding: 24px 16px 60px;
    background: var(--tp-bg);
    background-image: var(--tp-bg-gradient);
    min-height: 100vh;
}

.tp-sa-container {
    max-width: 1400px;
    margin: 0 auto;
}

.tp-sa-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    flex-wrap: wrap;
    gap: 12px;
}

.tp-sa-title {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    color: var(--tp-text);
    letter-spacing: -0.01em;
}

.tp-sa-mobile-toggle {
    display: none;
    align-items: center;
    gap: 8px;
    background: var(--tp-primary);
    color: #fff;
    border: 0;
    padding: 10px 18px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
}

@media (max-width: 900px) { .tp-sa-mobile-toggle { display: inline-flex; } }

.tp-sa-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 18px;
}

.tp-sa-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--tp-glass-bg);
    border: 1px solid var(--tp-glass-border);
    border-radius: 999px;
    color: var(--tp-text);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s ease;
}

.tp-sa-chip:hover { background: rgba(220,38,38,0.10); border-color: rgba(220,38,38,0.30); }

.tp-sa-chip-clear {
    font-size: 13px;
    color: var(--tp-primary);
    text-decoration: none;
    align-self: center;
    margin-left: 4px;
    font-weight: 500;
}

.tp-sa-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
}

@media (max-width: 900px) { .tp-sa-layout { grid-template-columns: 1fr; } }

.tp-sa-sidebar {
    background: var(--tp-glass-bg);
    backdrop-filter: blur(var(--tp-glass-blur)) saturate(140%);
    -webkit-backdrop-filter: blur(var(--tp-glass-blur)) saturate(140%);
    border: 1px solid var(--tp-glass-border);
    border-radius: var(--tp-radius);
    padding: 18px;
    position: sticky;
    top: 24px;
    align-self: start;
    box-shadow: var(--tp-shadow);
}

@media (max-width: 900px) {
    .tp-sa-sidebar {
        position: fixed;
        top: 0; left: 0;
        height: 100vh; width: 86%;
        max-width: 340px;
        z-index: 99999;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        overflow-y: auto;
        border-radius: 0 var(--tp-radius) var(--tp-radius) 0;
    }
    .tp-sa-sidebar.is-open { transform: translateX(0); }
}

.tp-sa-filter-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.tp-sa-search {
    position: relative;
}

.tp-sa-search svg {
    position: absolute;
    top: 50%; left: 12px;
    transform: translateY(-50%);
    color: var(--tp-text-muted);
}

.tp-sa-search input {
    width: 100%;
    padding: 9px 12px 9px 36px;
    border: 1px solid rgba(15,23,42,0.12);
    border-radius: 8px;
    font-size: 14px;
    background: rgba(255,255,255,0.6);
    box-sizing: border-box;
}

.tp-sa-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tp-sa-group-title {
    margin: 0;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--tp-text-muted);
    letter-spacing: 0.06em;
}

.tp-sa-group select,
.tp-sa-price-range input {
    padding: 8px 10px;
    border: 1px solid rgba(15,23,42,0.12);
    border-radius: 8px;
    font-size: 14px;
    background: rgba(255,255,255,0.6);
    color: var(--tp-text);
}

.tp-sa-group select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.tp-sa-price-range {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 6px;
    align-items: center;
}

.tp-sa-price-range span {
    color: var(--tp-text-muted);
    font-size: 14px;
}

.tp-sa-apply {
    background: var(--tp-primary);
    color: #fff;
    border: 0;
    padding: 11px 18px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    margin-top: 4px;
}

.tp-sa-apply:hover { background: var(--tp-primary-hover); }

.tp-sa-main { min-width: 0; }

.tp-sa-no-results {
    text-align: center;
    padding: 60px 20px;
    color: var(--tp-text-muted);
    font-size: 16px;
}

/* ────────────────────────────────────────────────────────
   2026-05-25 v2 — Card redesign + autocomplete + sort
   ──────────────────────────────────────────────────────── */

/* Card: chips no thumbnail */
.tp-card-imgwrap {
    position: relative;
}

.tp-card-ref-chip {
    position: absolute;
    top: 10px; left: 10px;
    z-index: 2;
    background: rgba(15, 23, 42, 0.85);
    color: #fff;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    font-family: 'SF Mono', 'JetBrains Mono', monospace;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    max-width: calc(100% - 90px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tp-card-stock-chip {
    position: absolute;
    top: 10px; right: 10px;
    z-index: 2;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.tp-card-stock-chip--in {
    background: rgba(21, 128, 61, 0.92);
    color: #fff;
}

.tp-card-stock-chip--out {
    background: rgba(220, 38, 38, 0.92);
    color: #fff;
}

/* Card body */
.tp-card-refs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 6px 0;
    align-items: center;
}

.tp-card-refs-label {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--tp-text-muted);
    padding-right: 4px;
}

.tp-card-ref-pill {
    padding: 2px 7px;
    background: rgba(37, 99, 235, 0.08);
    color: var(--tp-primary);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    font-family: 'SF Mono', 'JetBrains Mono', monospace;
    letter-spacing: -0.02em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100px;
}

.tp-card-cond {
    display: inline-block;
    padding: 3px 8px;
    background: rgba(20, 184, 166, 0.10);
    color: #0f766e;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    margin-top: 4px;
}

@media (prefers-color-scheme: dark) {
    .tp-card-ref-pill { background: rgba(96,165,250,0.18); }
    .tp-card-cond { background: rgba(20,184,166,0.18); color: #5eead4; }
}

.tp-card-cta svg { display: inline-block; vertical-align: middle; }
.tp-card-cta { display: inline-flex; align-items: center; gap: 6px; }

/* Archive — sort dropdown */
.tp-sa-header-tools {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.tp-sa-sort-form {
    display: inline-block;
}

.tp-sa-sort-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--tp-glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--tp-glass-border);
    padding: 8px 12px 8px 14px;
    border-radius: 999px;
    font-size: 13px;
    color: var(--tp-text);
    font-weight: 500;
    cursor: pointer;
}

.tp-sa-sort-label svg { color: var(--tp-text-muted); }

.tp-sa-sort-label select {
    border: 0 !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    font-size: inherit !important;
    color: inherit !important;
    font-weight: 600 !important;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    padding-right: 4px !important;
}

/* Archive — autocomplete refs */
.tp-sa-ac { position: relative; }

.tp-sa-ac-results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0; right: 0;
    background: #fff;
    border: 1px solid rgba(15,23,42,0.12);
    border-radius: 8px;
    box-shadow: 0 12px 32px -10px rgba(0,0,0,0.18);
    max-height: 280px;
    overflow-y: auto;
    z-index: 1000;
}

.tp-sa-ac-item {
    display: block;
    padding: 9px 12px;
    border-bottom: 1px solid rgba(15,23,42,0.06);
    text-decoration: none;
    color: var(--tp-text);
    transition: background 0.1s ease;
}

.tp-sa-ac-item:hover { background: rgba(37,99,235,0.06); }
.tp-sa-ac-item:last-child { border-bottom: 0; }
.tp-sa-ac-item strong {
    font-family: 'SF Mono', monospace;
    font-size: 13px;
    font-weight: 700;
    color: var(--tp-primary);
}

.tp-sa-ac-meta {
    font-size: 12px;
    color: var(--tp-text-muted);
    margin-top: 2px;
}

.tp-sa-ac-empty {
    padding: 14px;
    color: var(--tp-text-muted);
    font-size: 13px;
    text-align: center;
}

@media (prefers-color-scheme: dark) {
    .tp-sa-ac-results {
        background: #0f1419;
        border-color: rgba(255,255,255,0.10);
    }
}

/* Archive — sidebar improvements */
.tp-sa-divider {
    height: 1px;
    background: rgba(15,23,42,0.08);
    margin: 4px 0;
}

@media (prefers-color-scheme: dark) {
    .tp-sa-divider { background: rgba(255,255,255,0.08); }
}

.tp-sa-close-mobile {
    display: none;
    position: absolute;
    top: 12px; right: 12px;
    background: rgba(15,23,42,0.06);
    color: var(--tp-text);
    border: 0;
    width: 32px; height: 32px;
    border-radius: 50%;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

@media (max-width: 900px) {
    .tp-sa-sidebar.is-open .tp-sa-close-mobile { display: inline-flex; }
    body.tp-sa-modal-open { overflow: hidden; }
    .tp-sa-sidebar.is-open::before {
        content: '';
        position: fixed;
        top: 0; left: 100%; width: 100vw; height: 100vh;
        background: rgba(0,0,0,0.5);
    }
}

.tp-sa-reset {
    text-align: center;
    color: var(--tp-text-muted);
    text-decoration: none;
    font-size: 13px;
    padding: 8px;
    margin-top: 4px;
    display: block;
}

.tp-sa-reset:hover { color: var(--tp-primary); }

.tp-sa-no-results {
    text-align: center;
    padding: 80px 20px;
    color: var(--tp-text-muted);
    font-size: 16px;
}

.tp-sa-no-results svg {
    color: var(--tp-text-muted);
    opacity: 0.6;
    display: block;
    margin: 0 auto 12px;
}

.tp-sa-no-results span {
    display: block;
    margin-top: 8px;
    font-size: 13px;
}

/* Title font cleanup */
.tp-card-title {
    margin: 4px 0 2px;
    font-size: 14px;
    line-height: 1.35;
    font-weight: 600;
    color: var(--tp-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 38px;
}

.tp-card-subtitle {
    font-size: 12px;
    color: var(--tp-text-muted);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    letter-spacing: 0.01em;
}

/* ════════════════════════════════════════════════════════════
   2026-05-25 v3 — PartCard novo design (refs com count + clean)
   ════════════════════════════════════════════════════════════ */

.tp-storefront-active .tp-pc {
    background: var(--tp-glass-bg);
    backdrop-filter: blur(var(--tp-glass-blur)) saturate(140%);
    -webkit-backdrop-filter: blur(var(--tp-glass-blur)) saturate(140%);
    border: 1px solid var(--tp-glass-border);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    position: relative;
    box-shadow: 0 1px 3px rgba(15,23,42,0.04);
}

.tp-storefront-active .tp-pc:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 40px -16px rgba(15,23,42,0.18), 0 4px 12px -4px rgba(15,23,42,0.10);
    border-color: rgba(37,99,235,0.30);
}

/* Media — full-bleed image + chips */
.tp-storefront-active .tp-pc-media {
    position: relative;
    display: block;
    aspect-ratio: 1/1;
    background: linear-gradient(135deg, rgba(241,245,249,1) 0%, rgba(226,232,240,1) 100%);
    overflow: hidden;
}

@media (prefers-color-scheme: dark) {
    .tp-storefront-active .tp-pc-media {
        background: linear-gradient(135deg, rgba(30,41,59,0.5) 0%, rgba(15,23,42,0.8) 100%);
    }
}

.tp-storefront-active .tp-pc-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease, opacity 0.3s ease;
}

.tp-storefront-active .tp-pc-img-2 {
    opacity: 0;
}

.tp-storefront-active .tp-pc:hover .tp-pc-img-1 {
    transform: scale(1.08);
}

.tp-storefront-active .tp-pc:hover .tp-pc-img-2 {
    opacity: 1;
    transform: scale(1.08);
}

/* Chips overlay */
.tp-storefront-active .tp-pc-chips {
    position: absolute;
    top: 12px; left: 12px; right: 12px;
    z-index: 2;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    pointer-events: none;
}

.tp-storefront-active .tp-pc-chips > * { pointer-events: auto; }

.tp-storefront-active .tp-pc-mainref {
    display: inline-flex;
    align-items: center;
    background: rgba(15, 23, 42, 0.88);
    color: #fff;
    padding: 5px 11px;
    border-radius: 999px;
    font-family: 'SF Mono', 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-decoration: none;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    max-width: 60%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: background 0.15s ease, transform 0.1s ease;
}

.tp-storefront-active .tp-pc-mainref:hover {
    background: var(--tp-primary);
    transform: translateY(-1px);
}

.tp-storefront-active .tp-pc-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    white-space: nowrap;
}

.tp-storefront-active .tp-pc-chip-in {
    background: rgba(21, 128, 61, 0.92);
    color: #fff;
}

.tp-storefront-active .tp-pc-chip-out {
    background: rgba(220, 38, 38, 0.92);
    color: #fff;
}

.tp-storefront-active .tp-pc-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.3);
}

/* Body */
.tp-storefront-active .tp-pc-body {
    padding: 14px 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.tp-storefront-active .tp-pc-veh {
    font-size: 11px;
    font-weight: 600;
    color: var(--tp-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tp-storefront-active .tp-pc-title {
    margin: 0;
    font-size: 14px;
    line-height: 1.35;
    font-weight: 600;
    color: var(--tp-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 38px;
}

.tp-storefront-active .tp-pc-title a {
    color: inherit;
    text-decoration: none;
}

.tp-storefront-active .tp-pc-title a:hover { color: var(--tp-primary); }

.tp-storefront-active .tp-pc-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 2px;
}

.tp-storefront-active .tp-pc-cond {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(20, 184, 166, 0.12);
    color: #0f766e;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

@media (prefers-color-scheme: dark) {
    .tp-storefront-active .tp-pc-cond { background: rgba(20,184,166,0.20); color: #5eead4; }
}

/* Refs com counts — pills clicáveis */
.tp-storefront-active .tp-pc-refs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.tp-storefront-active .tp-pc-refpill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 4px 3px 8px;
    background: rgba(37, 99, 235, 0.08);
    color: var(--tp-primary);
    border-radius: 6px;
    font-family: 'SF Mono', 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    letter-spacing: -0.01em;
    transition: background 0.15s ease, transform 0.1s ease;
    max-width: 100%;
}

.tp-storefront-active .tp-pc-refpill:hover {
    background: rgba(37, 99, 235, 0.18);
    transform: translateY(-1px);
}

.tp-storefront-active .tp-pc-refpill-val {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 90px;
}

.tp-storefront-active .tp-pc-refpill-count {
    background: var(--tp-primary);
    color: #fff;
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    font-family: inherit;
    min-width: 18px;
    text-align: center;
}

@media (prefers-color-scheme: dark) {
    .tp-storefront-active .tp-pc-refpill {
        background: rgba(96,165,250,0.14);
        color: #93c5fd;
    }
    .tp-storefront-active .tp-pc-refpill:hover {
        background: rgba(96,165,250,0.24);
    }
}

/* Footer — price + cart */
.tp-storefront-active .tp-pc-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 16px 14px;
    border-top: 1px solid var(--tp-glass-border);
    margin-top: 4px;
}

.tp-storefront-active .tp-pc-price {
    font-size: 17px;
    font-weight: 700;
    color: var(--tp-text);
    line-height: 1.2;
}

.tp-storefront-active .tp-pc-price .woocommerce-Price-amount,
.tp-storefront-active .tp-pc-price bdi {
    font-weight: 700;
}

.tp-storefront-active .tp-pc-price-na {
    font-size: 13px;
    font-weight: 600;
    color: var(--tp-text-muted);
}

.tp-storefront-active .tp-pc-cart {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--tp-primary);
    color: #fff;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    text-decoration: none;
    transition: background 0.15s ease, transform 0.1s ease;
}

.tp-storefront-active .tp-pc-cart:hover {
    background: var(--tp-primary-hover);
    transform: translateY(-1px);
}

.tp-storefront-active .tp-pc-cart svg { display: block; }

/* Hide legacy parts that we removed (compat-link, ver peça button, ref-copy) */
.tp-storefront-active .tp-pc-compat-link,
.tp-storefront-active .tp-pc-ref-copy,
.tp-storefront-active .tp-pc-btn-primary,
.tp-storefront-active .tp-pc-fav,
.tp-storefront-active .tp-pc-btn-fav,
.tp-storefront-active .tp-pc-badges,
.tp-storefront-active .tp-pc-cat { display: none !important; }

/* ════════════════════════════════════════════════════════════
   Sort dropdown custom (substitui native browser select)
   ════════════════════════════════════════════════════════════ */

.tp-sa-sort {
    position: relative;
    display: inline-block;
}

.tp-sa-sort-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--tp-glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--tp-glass-border);
    color: var(--tp-text);
    padding: 8px 14px 8px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.tp-sa-sort-trigger:hover {
    border-color: rgba(37,99,235,0.3);
    background: rgba(37,99,235,0.04);
}

.tp-sa-sort-trigger svg {
    color: var(--tp-text-muted);
    flex-shrink: 0;
}

.tp-sa-sort-current { color: var(--tp-text); font-weight: 600; }

.tp-sa-sort-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 220px;
    list-style: none;
    margin: 0;
    padding: 4px;
    background: #fff;
    border: 1px solid rgba(15,23,42,0.10);
    border-radius: 12px;
    box-shadow: 0 18px 40px -12px rgba(15,23,42,0.20), 0 4px 12px -4px rgba(15,23,42,0.08);
    z-index: 9999;
    animation: tp-sa-sort-fadein 0.15s ease-out;
}

@media (prefers-color-scheme: dark) {
    .tp-sa-sort-menu {
        background: #0f1419;
        border-color: rgba(255,255,255,0.10);
    }
}

@keyframes tp-sa-sort-fadein {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.tp-sa-sort-menu li { padding: 0; margin: 0; list-style: none; }

.tp-sa-sort-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 12px;
    color: var(--tp-text);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.1s ease;
}

.tp-sa-sort-item:hover {
    background: rgba(37,99,235,0.08);
    color: var(--tp-primary);
}

.tp-sa-sort-item.is-active {
    background: rgba(37,99,235,0.10);
    color: var(--tp-primary);
    font-weight: 600;
}

.tp-sa-sort-item svg { color: var(--tp-primary); }
