@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=DM+Sans:wght@300;400;500&display=swap');

/* ════════════════════════════════════════
   TRIGGER BAR
════════════════════════════════════════ */
.trpc-trigger-bar {
    font-family: 'DM Sans', sans-serif;
    width: 100%;
    max-width: 890px;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    background: #fff;
    box-sizing: border-box;
    padding: 16px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: box-shadow .15s, border-color .15s;
    position: relative;
    flex-wrap: wrap;
}
.trpc-trigger-bar:hover {
    border-color: #dc1e28;
    box-shadow: 0 2px 12px rgba(220,30,40,.1);
}
.trpc-trigger-bar:focus-visible {
    outline: 2px solid #dc1e28;
    outline-offset: 2px;
}
.trpc-trigger-bar *, .trpc-trigger-bar *::before, .trpc-trigger-bar *::after { box-sizing: border-box; }

.trpc-trigger-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.trpc-trigger-title {
    font-family: 'Manrope', sans-serif;
    letter-spacing: -.4px;
}
.trpc-trigger-arrow {
    color: #aaa;
    display: flex;
    align-items: center;
    transition: transform .2s, color .15s;
    flex-shrink: 0;
}
.trpc-trigger-bar[aria-expanded="true"] .trpc-trigger-arrow {
    transform: rotate(180deg);
    color: #dc1e28;
}

/* ════════════════════════════════════════
   LOGO ICON (compare icon, red bg)
════════════════════════════════════════ */
.trpc-logo-icon {
    width: 26px;
    height: 26px;
    background: #dc1e28;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
}

/* ════════════════════════════════════════
   CATEGORY TABS (in trigger bar)
════════════════════════════════════════ */
.trpc-trigger-bar .trpc-cat-tabs {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: nowrap;
    margin-left: auto;
}
.trpc-cat-tab {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 10px 24px;
    font-family: 'Manrope', sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: #646464;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    cursor: pointer;
    transition: all .15s ease;
    white-space: nowrap;
    letter-spacing: -.1px;
}
.trpc-cat-tab:hover:not(.active) {
    background: #f5f5f5;
    color: #333;
    border-color: #ccc;
}
.trpc-cat-tab.active {
    background: #dc1e28;
    color: #fff;
    border-color: #dc1e28;
}
.trpc-tab-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    stroke: currentColor;
}

/* ════════════════════════════════════════
   MODAL OVERLAY
════════════════════════════════════════ */
.trpc-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: trpcFadeIn .18s ease;
}
@keyframes trpcFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.trpc-modal-panel {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 960px;
    height: 720px;
    max-height: 92vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
    animation: trpcSlideUp .2s ease;
    font-family: 'DM Sans', sans-serif;
}
.trpc-modal-panel *, .trpc-modal-panel *::before, .trpc-modal-panel *::after { box-sizing: border-box; }

@keyframes trpcSlideUp {
    from { transform: translateY(24px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

/* ── Modal Header ── */
.trpc-modal-header {
    padding: 12px 18px;
    border-bottom: 1px solid #e5e5e5;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    flex-wrap: nowrap;
}
.trpc-modal-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.trpc-modal-title {
    font-family: 'Manrope', sans-serif;
    letter-spacing: -.4px;
    white-space: nowrap;
}
/* Tabs inside modal header — pushed to right, before close btn */
.trpc-modal-tabs {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: nowrap;
    margin-left: auto;
    flex-shrink: 0;
}
.trpc-modal-close {
    width: 32px;
    height: 32px;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #666;
    transition: all .15s;
    flex-shrink: 0;
    padding: 0;
    margin-left: 6px;
}
.trpc-modal-close:hover {
    background: #dc1e28;
    border-color: #dc1e28;
    color: #fff;
}

/* ── Modal Body ── */
.trpc-modal-body {
    overflow-y: auto;
    overscroll-behavior: contain;
    flex: 1;
}
.trpc-modal-body::-webkit-scrollbar { width: 4px; }
.trpc-modal-body::-webkit-scrollbar-track { background: #f5f5f5; }
.trpc-modal-body::-webkit-scrollbar-thumb { background: #ddd; border-radius: 4px; }

/* ════════════════════════════════════════
   COMPARE HEADER (inside modal)
════════════════════════════════════════ */
.trpc-cmp-header {
    padding: 14px 20px 10px;
    border-bottom: 1px solid #eee;
}
.trpc-cmp-title {
    font-family: 'Manrope', sans-serif;
    font-size: 15px;
    font-weight: 800;
    color: #111;
    letter-spacing: -.4px;
}
.trpc-cmp-sub {
    font-size: 11px;
    color: #999;
    margin-top: 2px;
}

/* ════════════════════════════════════════
   SELECTS AREA
════════════════════════════════════════ */
.trpc-selects {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 10px;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid #eee;
}
.trpc-vs {
    font-family: 'Manrope', sans-serif;
    font-size: 11px;
    font-weight: 800;
    color: #aaa;
    text-align: center;
    padding: 0 4px;
}
.trpc-select-wrap {
    position: relative;
    width: 100%;
}

/* ── Custom Dropdown ── */
.trpc-custom-select {
    position: relative;
    width: 100%;
    user-select: none;
}
.trpc-select-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 9px 12px;
    cursor: pointer;
    background: #fff;
    transition: border-color .15s;
    min-height: 38px;
}
.trpc-custom-select:hover .trpc-select-display,
.trpc-custom-select[aria-expanded="true"] .trpc-select-display {
    border-color: #dc1e28;
}
.trpc-select-text {
    font-family: 'Manrope', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: #111;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.trpc-select-text.placeholder {
    color: #aaa;
    font-weight: 500;
}
.trpc-chevron {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    color: #aaa;
    transition: transform .2s ease;
}
.trpc-custom-select[aria-expanded="true"] .trpc-chevron {
    transform: rotate(180deg);
    color: #dc1e28;
}

/* ── Dropdown Panel ── */
.trpc-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.10), 0 2px 8px rgba(0,0,0,.06);
    z-index: 9999;
    overflow: hidden;
}
.trpc-custom-select[aria-expanded="true"] .trpc-dropdown {
    display: block;
}

/* ── Search inside dropdown ── */
.trpc-search-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid #f0f0f0;
    background: #fafafa;
}
.trpc-search-icon {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
    color: #bbb;
}
.trpc-search-input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-family: 'Manrope', sans-serif;
    font-size: 12px;
    color: #111;
    padding: 0;
    width: 100%;
}
.trpc-search-input::placeholder { color: #bbb; }

.trpc-dropdown-list {
    max-height: 240px;
    overflow-y: auto;
    overscroll-behavior: contain;
}
.trpc-dropdown-list::-webkit-scrollbar { width: 4px; }
.trpc-dropdown-list::-webkit-scrollbar-track { background: #f5f5f5; }
.trpc-dropdown-list::-webkit-scrollbar-thumb { background: #ddd; border-radius: 4px; }
.trpc-dropdown-list::-webkit-scrollbar-thumb:hover { background: #bbb; }

.trpc-dropdown-item {
    display: flex;
    align-items: center;
    padding: 9px 14px;
    font-family: 'Manrope', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: #111;
    cursor: pointer;
    border-bottom: 1px solid #f5f5f5;
    transition: background .1s;
    line-height: 1.3;
}
.trpc-dropdown-item:last-child { border-bottom: none; }
.trpc-dropdown-item:hover { background: #fafafa; }
.trpc-dropdown-item.selected {
    background: #fff5f5;
    color: #dc1e28;
}
.trpc-dropdown-item-price {
    margin-left: auto;
    font-size: 10px;
    font-weight: 500;
    color: #aaa;
    white-space: nowrap;
    padding-left: 8px;
}
.trpc-dropdown-empty {
    padding: 14px;
    text-align: center;
    font-family: 'Manrope', sans-serif;
    font-size: 12px;
    color: #bbb;
}

/* ════════════════════════════════════════
   COMPARE ROWS
════════════════════════════════════════ */
.trpc-rows { padding: 0; }

.trpc-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0;
    border-bottom: .5px solid #eee;
}
.trpc-row:last-child { border-bottom: none; }

.trpc-cell {
    padding: 11px 20px;
    font-size: 12px;
}
.trpc-cell.label {
    font-family: 'Manrope', sans-serif;
    font-weight: 700;
    color: #888;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .05em;
    background: #fafafa;
    border-right: .5px solid #eee;
    display: flex;
    align-items: center;
    gap: 6px;
}
.trpc-cell.label svg { width: 10px; height: 10px; color: #bbb; }
.trpc-cell.val {
    color: #111;
    font-family: 'Manrope', sans-serif;
    font-weight: 500;
    border-right: .5px solid #eee;
    line-height: 1.4;
}
.trpc-cell.val:last-child { border-right: none; }

/* Score cells */
.trpc-score-val { font-size: 12px; font-weight: 600; }
.trpc-score-val.winner { color: #dc1e28; font-weight: 700; }
.trpc-bar-wrap {
    height: 5px;
    background: #f0f0f0;
    border-radius: 3px;
    margin-top: 5px;
}
.trpc-bar-a {
    height: 5px;
    border-radius: 3px;
    background: #dc1e28;
    transition: width .5s ease;
}
.trpc-bar-b {
    height: 5px;
    border-radius: 3px;
    background: #e5e5e5;
    transition: width .5s ease;
}
.trpc-bar-b.winner-b { background: #dc1e28; }

/* Placeholder */
.trpc-placeholder {
    padding: 40px 20px;
    text-align: center;
    color: #bbb;
}
.trpc-placeholder p {
    font-family: 'Manrope', sans-serif;
    font-size: 13px;
    color: #bbb;
    margin-top: 12px;
}

/* ════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════ */
@media (max-width: 640px) {
    /* Trigger bar */
    .trpc-trigger-bar {
        gap: 8px;
        padding: 10px 12px;
    }
    .trpc-trigger-bar .trpc-cat-tabs {
        flex-wrap: wrap;
        margin-left: auto;
    }
    .trpc-cat-tab { flex: 1; justify-content: center; font-size: 11px; padding: 6px 8px; }

    /* Modal */
    .trpc-modal-overlay { padding: 0; align-items: flex-end; }
    .trpc-modal-panel {
        border-radius: 16px 16px 0 0;
        height: auto;
        max-height: 92vh;
    }

    /* Modal header: wrap tabs to second row on small screens */
    .trpc-modal-header {
        flex-wrap: wrap;
        row-gap: 8px;
    }
    .trpc-modal-tabs {
        order: 3;
        width: calc(100% - 42px);
        margin-left: 0;
        flex-wrap: wrap;
        justify-content: flex-end;
    }
    .trpc-modal-close { margin-left: auto; order: 2; }

    /* Selects */
    .trpc-selects {
        grid-template-columns: 1fr auto 1fr;
        gap: 6px;
        padding: 10px 12px;
    }
    .trpc-cell { padding: 9px 10px; font-size: 11px; }
    .trpc-cell.label { font-size: 10px; }

    /* Table horizontal scroll on very small screens */
    .trpc-rows { overflow-x: auto; }
    .trpc-row { min-width: 380px; }
}

@media (max-width: 400px) {
    .trpc-selects { grid-template-columns: 1fr; gap: 6px; }
    .trpc-vs { display: none; }
    .trpc-row { min-width: 320px; }
}
