/* ReportGem shared product components.
 * Semantic classes copied from the research catalogue's visual language.
 * Product pages should compose these classes instead of copying one-off CSS.
 */

.rg-filter-card {
    overflow: hidden;
    color: var(--rg-text);
    background: var(--rg-surface);
    border: 1px solid var(--rg-border);
    border-radius: var(--rg-radius);
    box-shadow: var(--rg-shadow);
}

.rg-filter-heading {
    min-height: 58px;
    padding: 0 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #263750;
    background: #f2f6fb;
    border-bottom: 1px solid var(--rg-border);
    font-size: 16px;
    font-weight: 700;
}

.rg-filter-heading-label {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 9px;
}

.rg-filter-heading-icon {
    width: 21px;
    height: 21px;
    flex: 0 0 21px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.rg-filter-heading-chevron {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.rg-filter-body { padding: 18px; }

.rg-filter-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 16px;
}

.rg-filter-option {
    min-width: 0;
    min-height: 30px;
    display: flex;
    align-items: center;
    gap: 9px;
    color: #34445d;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.35;
    user-select: none;
}

.rg-filter-option input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.rg-checkbox-box {
    position: relative;
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    background: #fff;
    border: 1.5px solid #7e8998;
    border-radius: 5px;
    box-shadow: inset 0 0 0 1px rgba(20, 37, 66, .06);
    transition: background .16s ease, border-color .16s ease;
}

.rg-filter-option:hover .rg-checkbox-box { border-color: var(--rg-primary); }
.rg-filter-option input:focus-visible + .rg-checkbox-box {
    outline: 3px solid rgba(57, 117, 255, .18);
    outline-offset: 2px;
}
.rg-filter-option input:checked + .rg-checkbox-box {
    background: var(--rg-primary);
    border-color: var(--rg-primary);
}
.rg-filter-option input:checked + .rg-checkbox-box::after {
    position: absolute;
    top: 3px;
    left: 6px;
    width: 5px;
    height: 9px;
    content: "";
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.rg-date-range-control {
    height: 42px;
    margin-top: 16px;
    padding: 0 10px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 18px minmax(0, 1fr) 18px;
    align-items: center;
    gap: 5px;
    color: #8a96a8;
    background: #fff;
    border: 1px solid #cfd9e8;
    border-radius: 7px;
}
.rg-date-range-control:focus-within {
    border-color: #86a8eb;
    box-shadow: 0 0 0 3px rgba(57, 117, 255, .10);
}
.rg-date-range-control .rg-date-input {
    width: 100%;
    min-width: 0;
    height: 38px;
    padding: 0;
    color: #526178;
    background: transparent;
    border: 0;
    outline: 0;
    font-size: 12px;
}
.rg-date-range-control .rg-date-input::-webkit-calendar-picker-indicator { display: none; }
.rg-date-separator { color: #a5afbd; text-align: center; }
.rg-date-icon {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: #9aa6b6;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
}

.rg-results-toolbar {
    min-height: 62px;
    padding: 0 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: var(--rg-surface);
    border-bottom: 1px solid var(--rg-border);
}
.rg-sort-tabs { display: flex; align-items: center; gap: 10px; }
.rg-sort-tabs .rg-sort-tab {
    min-height: 36px;
    padding: 7px 12px;
    color: #34445d;
    background: transparent;
    border: 0;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
}
.rg-sort-tabs .rg-sort-tab:hover { color: var(--rg-primary); }
.rg-sort-tabs .rg-sort-tab.active {
    color: var(--rg-primary);
    background: var(--rg-primary-soft);
    font-weight: 700;
}

.rg-result-card {
    min-height: 124px;
    padding: 20px 22px;
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr) 32px;
    align-items: center;
    gap: 18px;
    background: var(--rg-surface);
    border-bottom: 1px solid var(--rg-border);
    transition: background .16s ease;
}
.rg-result-card:hover { background: #fbfcff; }

.rg-type-badge {
    width: 82px;
    min-height: 84px;
    padding: 9px 7px;
    display: grid;
    place-items: center;
    border: 1px solid;
    border-radius: 2px;
    text-align: center;
    font-size: 13px;
    font-weight: 650;
    line-height: 1.42;
    overflow-wrap: anywhere;
}
.rg-type-badge.rg-tone-red { color: #744049; background: #fff0f0; border-color: #ff979d; }
.rg-type-badge.rg-tone-blue { color: #315594; background: #edf3ff; border-color: #8fb4ff; }
.rg-type-badge.rg-tone-cyan { color: #245f70; background: #edfdff; border-color: #32d5e4; }
.rg-type-badge.rg-tone-orange { color: #74522f; background: #fff6e9; border-color: #ffc374; }

@media (max-width: 1180px) {
    .rg-result-card { grid-template-columns: 76px minmax(0, 1fr) 32px; }
    .rg-type-badge { width: 76px; }
}

@media (max-width: 760px) {
    .rg-results-toolbar { min-height: 54px; padding: 0 14px; }
    .rg-sort-tabs { gap: 2px; }
    .rg-sort-tabs .rg-sort-tab { min-height: 34px; padding: 6px 9px; font-size: 14px; }
    .rg-result-card {
        min-height: 0;
        padding: 16px 14px;
        grid-template-columns: minmax(0, 1fr);
        gap: 9px;
    }
    .rg-type-badge {
        width: auto;
        min-height: 0;
        padding: 4px 9px;
        display: inline-flex;
        justify-self: start;
        border-radius: 4px;
        font-size: 12px;
    }
}
