:root {
    --tps-font-heebo: 'Heebo', sans-serif;
    --tps-color-red: #FF0022;
    --tps-color-red-hover: #d6001c;
    --tps-color-text: #354151;
    --tps-color-meta: #282830;
    --tps-color-border: #E4E6E8;
    --tps-color-border-strong: #CECFD0;
    --tps-color-placeholder: #a0aec0;
    --tps-color-header-bg: #6A6B70;
    --tps-color-row-odd: #F4F6FB;
}

.tps-search-container * {
    box-sizing: border-box;
}

.tps-search-container {
    width: 100%;
    max-width: 871px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: var(--tps-font-heebo);
    margin-top: 100px;
}

/* Headings */
.tps-main-title {
    width: 100%;
    font-weight: 600;
    font-size: 30px;
    line-height: 123%;
    text-align: center;
    color: var(--tps-color-text);
    margin: 0 0 12px 0;
}

.tps-sub-title {
    width: 100%;
    font-weight: 500;
    font-size: 24px;
    line-height: 123%;
    text-align: center;
    color: var(--tps-color-text);
    margin: 0 0 48px 0;
}

/* Form & Meta Wrapper */
.tps-form-wrapper {
    width: 100%;
    max-width: 718px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 24px;
}

/* Form Layout */
.tps-search-form {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 40px;
}

.tps-input-group {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    position: relative;
}

.tps-search-input {
    width: 100%;
    height: 38.75px;
    border: none;
    border-bottom: 1px solid #e2e8f0;
    font-family: var(--tps-font-heebo);
    font-weight: 300;
    font-size: 18px;
    line-height: 100%;
    text-align: start;
    color: var(--tps-color-text);
    outline: none;
    padding-bottom: 4px;
    background: transparent;
}

.tps-search-input::placeholder {
    color: var(--tps-color-placeholder);
}

/* Autocomplete */
.tps-autocomplete-list {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    margin-top: 4px;
    background: #FFFFFF;
    border: 1px solid var(--tps-color-border-strong);
    border-radius: 6px;
    max-height: 260px;
    overflow-y: auto;
    z-index: 30;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.10);
}

.tps-autocomplete-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 8px 14px;
    cursor: pointer;
    font-size: 13px;
    color: var(--tps-color-text);
    border-bottom: 1px solid var(--tps-color-border);
}

.tps-autocomplete-item:last-child {
    border-bottom: none;
}

.tps-autocomplete-item:hover,
.tps-autocomplete-item.is-active {
    background: var(--tps-color-row-odd);
}

.tps-autocomplete-code {
    font-weight: 600;
    white-space: nowrap;
    flex: 0 0 auto;
}

.tps-autocomplete-desc {
    color: var(--tps-color-meta);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1 1 auto;
    text-align: left;
}

.tps-autocomplete-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 14px;
    font-size: 13px;
    color: var(--tps-color-meta);
}

.tps-autocomplete-loading .tps-spinner {
    width: 14px;
    height: 14px;
}

.tps-submit-btn {
    flex: 0 0 auto;
    width: 199px;
    height: 42px;
    background: var(--tps-color-red);
    border: none;
    color: #ffffff;
    font-family: var(--tps-font-heebo);
    font-weight: 500;
    font-size: 16px;
    line-height: 100%;
    text-align: center;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.tps-submit-btn:hover {
    background: var(--tps-color-red-hover);
}

.tps-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Meta Info Row */
.tps-meta-container {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    min-height: 1px;
}

.tps-meta-right {
    font-weight: 400;
    font-size: 14px;
    line-height: 123%;
    color: var(--tps-color-meta);
    text-align: start;
}

.tps-meta-left {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.tps-last-update {
    font-weight: 400;
    font-size: 14px;
    line-height: 123%;
    color: var(--tps-color-meta);
}

.tps-no-vat {
    font-weight: 600;
    font-size: 14px;
    line-height: 123%;
    color: var(--tps-color-meta);
    text-align: start;
}

/* Results Container */
.tps-results-container {
    width: 100%;
}

.tps-loading,
.tps-empty-message {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    text-align: center;
    padding: 24px 16px;
    font-size: 15px;
    color: var(--tps-color-meta);
}

.tps-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid var(--tps-color-border-strong);
    border-top-color: var(--tps-color-red);
    border-radius: 50%;
    display: inline-block;
    animation: tps-spin 0.7s linear infinite;
}

@keyframes tps-spin {
    to { transform: rotate(360deg); }
}

/* Data Table */
.tps-table-container {
    width: 100%;
    max-width: 100%;
    border: 1px solid var(--tps-color-border-strong);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/*
 * Wraps ONLY the <table> element. Keeping this separate from
 * .tps-table-footer is what lets the table scroll horizontally on narrow
 * screens (see responsive.css) without stretching/misaligning the footer
 * bar below it - the footer stays full-width and fully gray regardless of
 * how far the table itself is scrolled.
 */
.tps-table-scroll {
    width: 100%;
    max-width: 100%;
    position: relative;
}

/*
 * Persistent visual cue (independent of the text hint above, which fades
 * after the first scroll): a soft inner shadow on the far edge of the
 * table for as long as there's still hidden content to reach, updated live
 * in script.js as the user scrolls.
 */
.tps-table-scroll.has-h-scroll {
    box-shadow:
        inset -18px 0 12px -12px rgba(40, 40, 48, 0.18),
        inset 18px 0 12px -12px rgba(40, 40, 48, 0.18);
}

.tps-parts-table {
    width: 100%;
    border-collapse: collapse;
    text-align: right;
}

.tps-parts-table thead tr {
    background: var(--tps-color-header-bg);
    height: 49px;
}

.tps-parts-table th {
    color: #FFFFFF;
    font-weight: 600;
    font-size: 16px;
    line-height: 123%;
    padding: 0 16px;
    border-left: 1px solid rgba(255, 255, 255, 0.15);
}

.tps-parts-table th:last-child {
    border-left: none;
}

.tps-parts-table tbody tr {
    height: 42px;
}

.tps-parts-table tbody tr:nth-child(even) {
    background: #FFFFFF;
}

.tps-parts-table tbody tr:nth-child(odd) {
    background: var(--tps-color-row-odd);
}

.tps-parts-table td {
    font-weight: 400;
    font-size: 16px;
    line-height: 100%;
    color: var(--tps-color-text);
    padding: 8px 16px;
    border-left: 1px solid var(--tps-color-border);
    vertical-align: middle;
    white-space: pre-line;
}

.tps-parts-table td:last-child {
    border-left: none;
}

.tps-stock-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

.tps-stock-yes {
    background: #E6F4EA;
    color: #1E7B34;
}

.tps-stock-no {
    background: #FDECEA;
    color: #C62828;
}

/*
 * Swipe-to-scroll hint. Always hidden on desktop (and on mobile until
 * script.js confirms the table is actually overflowing - see the
 * `.is-visible` override in responsive.css). Sits above the table itself.
 */
.tps-scroll-hint {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 4px;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--tps-color-red);
}

.tps-scroll-hint-icon {
    display: inline-block;
    font-size: 15px;
    animation: tps-scroll-hint-nudge 1.4s ease-in-out infinite;
}

@keyframes tps-scroll-hint-nudge {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(-4px); }
}

.tps-table-footer {
    width: 100%;
    min-height: 38px;
    background: var(--tps-color-border-strong);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 16px;
    padding: 8px 16px;
}

.tps-footer-text {
    font-weight: 500;
    font-size: 12px;
    line-height: 123%;
    color: var(--tps-color-meta);
    text-align: right;
    white-space: nowrap;
}

.tps-pagination {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.tps-page-btn {
    min-width: 26px;
    height: 26px;
    padding: 0 6px;
    border: none;
    background: transparent;
    color: var(--tps-color-meta);
    font-family: var(--tps-font-heebo);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.15s ease;
}

.tps-page-btn:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.08);
}

.tps-page-btn.is-active {
    background: var(--tps-color-header-bg);
    color: #FFFFFF;
}

.tps-page-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.tps-page-nav {
    font-size: 15px;
    font-weight: 600;
}

.tps-page-ellipsis {
    padding: 0 2px;
    font-size: 12px;
    color: var(--tps-color-meta);
}
