/* public/css/calculators/sales-tax-calculator.css
   Page-specific styles for the sales tax calculator and its 51 state child
   pages. Loaded after loan-calculator.css, which supplies the shared
   .input-panel / .result-card / .quick-tips-list styling. */

/* The three-way mode selector. Stacks on narrow screens rather than
   squeezing three long labels onto one line. */
.mode-switch {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .5rem;
}

.mode-switch .btn {
    white-space: normal;
    font-size: .85rem;
    line-height: 1.25;
    padding: .5rem .4rem;
}

@media (max-width: 575.98px) {
    .mode-switch {
        grid-template-columns: 1fr;
    }
}

/* Rate inputs go quiet when the calculator is solving for the rate. */
#rateInputsWrap.is-solved {
    opacity: .55;
}

/* ---- Receipt output card ---- */
.tax-receipt {
    font-variant-numeric: tabular-nums;
    border: 1px dashed var(--bs-border-color, #dee2e6);
    border-radius: .5rem;
    padding: .75rem 1rem;
    background: #fff;
}

.tax-receipt-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .35rem 0;
    font-size: .95rem;
}

.tax-receipt-row + .tax-receipt-row {
    border-top: 1px solid rgba(0, 0, 0, .05);
}

.tax-receipt-total {
    border-top: 2px solid var(--bs-border-color, #dee2e6) !important;
    margin-top: .25rem;
    padding-top: .6rem;
    font-size: 1.15rem;
    font-weight: 700;
}

/* ---- 50-state reference table ---- */
.state-table-scroll {
    max-height: 520px;
    overflow-y: auto;
    overflow-x: auto;
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: .5rem;
}

.state-tax-table {
    margin-bottom: 0;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.state-tax-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #fff;
    box-shadow: inset 0 -1px 0 var(--bs-border-color, #dee2e6);
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #6c757d;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
}

.state-tax-table thead th:hover,
.state-tax-table thead th:focus-visible {
    color: var(--calculator-color, #6366f1);
}

.state-tax-table thead th[data-sort]::after {
    content: '\2195';
    opacity: .35;
    margin-left: .3rem;
    font-size: .8em;
}

.state-tax-table thead th.is-sorted::after {
    content: '\2191';
    opacity: 1;
}

.state-tax-table thead th.is-sorted.is-desc::after {
    content: '\2193';
}

.state-tax-table tbody td {
    font-size: .875rem;
}

.state-tax-table tbody a {
    text-decoration: none;
}

.state-tax-table tbody a:hover {
    text-decoration: underline;
}

/* The row for the state whose page you are on. */
.state-tax-table tbody tr.state-row-active {
    background: color-mix(in srgb, var(--calculator-color, #6366f1) 12%, white);
}

.state-tax-table tbody tr.state-row-active td {
    font-weight: 600;
}

.state-filter-wrap {
    min-width: 220px;
}

/* ---- State child page fact block ---- */
.state-fact {
    border-left: 3px solid var(--calculator-color, #6366f1);
    padding-left: .75rem;
}

.state-fact-list {
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;
}

.state-fact-list li {
    padding: .5rem 0;
    border-top: 1px solid rgba(0, 0, 0, .06);
    font-size: .95rem;
}

.state-intro .lead {
    line-height: 1.7;
}

/* ---- VAT/GST reference table ---- */
.vat-rate-scroll {
    max-height: 240px;
    overflow-y: auto;
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: .5rem;
}

.vat-rate-table {
    margin-bottom: 0;
    font-size: .85rem;
}

.vat-rate-table thead th {
    position: sticky;
    top: 0;
    background: #fff;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #6c757d;
}

.vat-rate-apply {
    font-variant-numeric: tabular-nums;
    text-decoration: none;
    font-weight: 600;
}

/* The rate table is the reference people print - give it room and drop
   the interactive chrome. */
@media print {
    .state-table-scroll,
    .vat-rate-scroll {
        max-height: none;
        overflow: visible;
        border: 0;
    }

    .sticky-mobile-total,
    .page-header .breadcrumb,
    .state-filter-wrap,
    .related-calculators-plain,
    .quick-tips,
    #copyTotalBtn,
    #copyLinkBtn,
    #downloadCsvBtn,
    #printBtn {
        display: none !important;
    }

    .state-tax-table thead th[data-sort]::after {
        content: '';
    }
}

@media (max-width: 575.98px) {
    .state-table-scroll {
        max-height: 420px;
    }

    .state-tax-table tbody td,
    .state-tax-table thead th {
        font-size: .8rem;
        padding: .35rem .4rem;
    }

    .state-filter-wrap {
        min-width: 100%;
    }
}
