.product-offer-finder-panel {
    display: grid;
    gap: 14px;
    border-bottom: 1px solid var(--border);
}

.product-offer-finder-sr-only,
.product-offer-finder-live {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.product-offer-finder-head,
.product-offer-finder-head-actions,
.product-offer-shortlist-head,
.product-offer-shortlist-head > div:last-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.product-offer-finder-head h3,
.product-offer-shortlist-head h3 {
    margin: 2px 0 4px;
    font-size: 1rem;
    letter-spacing: 0;
}

.product-offer-finder-head p {
    max-width: 720px;
    color: var(--text-2);
    font-size: 0.8rem;
}

.product-offer-finder-kicker {
    color: var(--accent);
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
}

.product-offer-finder-summary {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.product-offer-finder-summary > div {
    display: grid;
    gap: 3px;
    min-width: 0;
    padding: 9px 10px;
    border-right: 1px solid var(--border);
}

.product-offer-finder-summary > div:last-child {
    border-right: 0;
}

.product-offer-finder-summary span {
    color: var(--text-3);
    font-size: 0.64rem;
    font-weight: 700;
    text-transform: uppercase;
}

.product-offer-finder-summary strong {
    overflow: hidden;
    color: var(--text);
    font-family: var(--mono);
    font-size: 0.85rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-offer-finder-reason {
    min-height: 20px;
    padding: 7px 9px;
    border-left: 3px solid var(--green);
    background: var(--green-bg);
    color: var(--text-2);
    font-size: 0.72rem;
}

.product-offer-finder-controls {
    display: grid;
    grid-template-columns: minmax(190px, 1.5fr) repeat(4, minmax(128px, 1fr));
    gap: 8px;
    align-items: end;
}

.product-offer-finder-controls .result-control {
    min-width: 0;
}

.product-offer-finder-money-input {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 40px;
    height: 38px;
    overflow: hidden;
    border: 1px solid var(--border-2);
    border-radius: 5px;
    background: var(--surface);
}

.product-offer-finder-money-input .form-control {
    height: 36px;
    border: 0;
    border-radius: 0;
}

.product-offer-finder-money-input > span {
    display: grid;
    place-items: center;
    border-left: 1px solid var(--border);
    color: var(--text-3);
    font-size: 0.65rem;
}

.product-offer-finder-toggles {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
}

.product-offer-finder-toggles label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    padding: 5px 8px;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: var(--surface-2);
    color: var(--text-2);
    font-size: 0.72rem;
    cursor: pointer;
}

.product-offer-finder-toggles label:has(input:checked) {
    border-color: var(--accent);
    background: var(--accent-bg);
    color: var(--text);
}

.product-offer-finder-toggles input {
    width: 14px;
    height: 14px;
    accent-color: var(--accent);
}

.product-offer-finder-reset {
    min-height: 32px;
    padding: 5px 8px;
    border: 0;
    background: transparent;
    color: var(--text-3);
    font-size: 0.72rem;
    cursor: pointer;
}

.product-offer-finder-reset:hover,
.product-offer-finder-reset:focus-visible {
    color: var(--accent);
}

.product-offer-finder-table th:first-child,
.product-offer-finder-table td:first-child {
    width: 42px;
    min-width: 42px;
    padding-right: 5px;
    text-align: center;
}

.product-offer-select {
    display: inline-grid;
    width: 24px;
    height: 24px;
    place-items: center;
    cursor: pointer;
}

.product-offer-select input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.product-offer-select span {
    display: grid;
    width: 18px;
    height: 18px;
    place-items: center;
    border: 1px solid var(--border-2);
    border-radius: 4px;
    background: var(--surface-2);
}

.product-offer-select span::after {
    color: var(--surface);
    font-size: 0.7rem;
    font-weight: 700;
    content: "✓";
    opacity: 0;
}

.product-offer-select input:checked + span {
    border-color: var(--accent);
    background: var(--accent);
}

.product-offer-select input:checked + span::after {
    opacity: 1;
}

.product-offer-select input:focus-visible + span {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.product-offer-finder-table tr.is-offer-recommended > td {
    background: var(--green-bg);
}

.product-offer-finder-table tr.is-offer-recommended > td:first-child {
    box-shadow: inset 3px 0 0 var(--green);
}

.product-offer-finder-table tr.is-offer-selected > td {
    border-bottom-color: var(--accent);
}

.product-offer-recommendation {
    display: block;
    width: max-content;
    max-width: 100%;
    margin-top: 4px;
    padding: 2px 5px;
    border-radius: 3px;
    background: var(--green-bg);
    color: var(--green);
    font-size: 0.62rem;
    font-weight: 700;
}

.product-offer-recommendation:empty {
    display: none;
}

.product-offer-difference {
    display: block;
    margin-top: 3px;
    color: var(--text-3);
    font-size: 0.64rem;
}

.is-offer-recommended .product-offer-difference {
    color: var(--green);
}

.product-offer-shortlist {
    display: grid;
    gap: 10px;
    padding: 12px 0 2px;
    border-top: 1px solid var(--border);
}

.product-offer-shortlist[hidden] {
    display: none;
}

.product-offer-shortlist-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
}

.product-offer-shortlist-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 9px;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: var(--surface-2);
}

.product-offer-shortlist-item > div:first-child,
.product-offer-shortlist-item strong,
.product-offer-shortlist-item span {
    display: block;
    min-width: 0;
}

.product-offer-shortlist-item strong {
    overflow: hidden;
    font-size: 0.78rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-offer-shortlist-item span {
    margin-top: 2px;
    color: var(--text-3);
    font-size: 0.66rem;
    overflow-wrap: anywhere;
}

.product-offer-shortlist-item > div:last-child {
    display: flex;
    align-items: center;
    gap: 5px;
}

.product-offer-shortlist-remove {
    min-height: 30px;
    padding: 4px 7px;
    border: 0;
    background: transparent;
    color: var(--red);
    font-size: 0.68rem;
    cursor: pointer;
}

@media (max-width: 1100px) {
    .product-offer-finder-controls {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .product-offer-finder-search {
        grid-column: span 2;
    }
}

@media (max-width: 720px) {
    .product-offer-finder-head,
    .product-offer-shortlist-head {
        align-items: stretch;
        flex-direction: column;
    }

    .product-offer-finder-head-actions > *,
    .product-offer-shortlist-head > div:last-child > * {
        flex: 1 1 auto;
        justify-content: center;
    }

    .product-offer-finder-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .product-offer-finder-summary > div {
        border-bottom: 1px solid var(--border);
    }

    .product-offer-finder-summary > div:nth-child(even) {
        border-right: 0;
    }

    .product-offer-finder-summary > div:last-child {
        grid-column: 1 / -1;
        border-bottom: 0;
    }

    .product-offer-finder-controls {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .product-offer-shortlist-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 430px) {
    .product-offer-finder-head-actions,
    .product-offer-shortlist-head > div:last-child {
        align-items: stretch;
        flex-direction: column;
    }

    .product-offer-finder-controls {
        grid-template-columns: 1fr;
    }

    .product-offer-finder-search {
        grid-column: auto;
    }

    .product-offer-finder-toggles {
        display: grid;
        grid-template-columns: 1fr;
    }

    .product-offer-shortlist-item {
        grid-template-columns: 1fr;
    }

    .product-offer-shortlist-item > div:last-child {
        justify-content: flex-end;
    }
}

@media print {
    .product-offer-finder-controls,
    .product-offer-finder-toggles,
    .product-offer-finder-head-actions,
    .product-offer-select,
    .product-offer-shortlist-head > div:last-child {
        display: none !important;
    }

    .product-offer-finder-table tr[hidden] {
        display: none !important;
    }
}
