/* ── NDS Testing Locations Search ── */

.nds-tl {
    --nds-accent: #d4006a;
    --nds-accent-hover: #b0005a;
    --nds-bg: #f7f8fa;
    --nds-card: #ffffff;
    --nds-border: #e0e3e8;
    --nds-text: #1e2a38;
    --nds-text-muted: #5f6d7e;
    --nds-radius: 10px;
    --nds-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);

    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    color: var(--nds-text);
    line-height: 1.6;
    max-width: 50%;
    margin: 0 auto;
}

/* ── Alert ── */

.nds-tl__alert {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #991b1b;
    border-radius: var(--nds-radius);
    padding: 14px 18px;
    margin-bottom: 24px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nds-tl__alert-icon {
    font-size: 18px;
    flex-shrink: 0;
}

/* ── Form ── */

.nds-tl__form {
    background: var(--nds-card);
    border: 1px solid var(--nds-border);
    border-radius: var(--nds-radius);
    padding: 24px;
    box-shadow: var(--nds-shadow);
    margin-bottom: 32px;
}

.nds-tl__form-row {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.nds-tl__field {
    flex: 1;
    min-width: 180px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nds-tl__field input[type="search"],
.nds-tl__field select {
    height: 46px;
    padding: 0 14px;
    border: 1px solid #cccccc;
    border-radius: 10px;
    font-size: 15px;
    color: var(--nds-text);
    transition: border-color 0.15s, box-shadow 0.15s;
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    box-sizing: border-box;
}

.nds-tl__field input[type="search"] {
    background: #ffffff;
}

.nds-tl__field select {
    background-color: #f8f8f8;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235f6d7e' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.nds-tl__field input[type="search"]:focus,
.nds-tl__field select:focus {
    outline: none;
    border-color: var(--nds-accent);
    box-shadow: 0 0 0 3px rgba(0, 87, 184, 0.12);
}

.nds-tl__field--submit {
    flex: 0 0 100%;
    margin-top: 16px;
}

.nds-tl__field--submit button {
    width: 100%;
    height: 46px;
    padding: 0 28px;
    background: var(--nds-accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, transform 0.1s;
}

.nds-tl__field--submit button:hover {
    background: var(--nds-accent-hover);
}

.nds-tl__field--submit button:active {
    transform: scale(0.98);
}

/* ── Results ── */

.nds-tl__results {
    margin-top: 8px;
    width: 100vw;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    padding: 0 24px;
    box-sizing: border-box;
}

.nds-tl__results-heading {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 16px;
}

.nds-tl__table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--nds-border);
    border-radius: var(--nds-radius);
    box-shadow: var(--nds-shadow);
}

.nds-tl__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.nds-tl__table thead {
    background: var(--nds-bg);
}

.nds-tl__table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--nds-text-muted);
    border-bottom: 1px solid var(--nds-border);
}

.nds-tl__table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--nds-border);
    vertical-align: middle;
}

.nds-tl__table tbody tr:last-child td {
    border-bottom: none;
}

.nds-tl__table tbody tr:hover {
    background: #f0f5ff;
}

.nds-tl__distance {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    background: var(--nds-bg);
    border-radius: 20px;
    font-size: 12px;
    color: var(--nds-text-muted);
    font-weight: 500;
    white-space: nowrap;
}

.nds-tl__order-btn {
    display: inline-block;
    padding: 6px 16px;
    background-color: var(--e-global-color-534a4e4);
    font-family: var(--e-global-typography-accent-font-family), Sans-serif;
    font-size: var(--e-global-typography-accent-font-size);
    font-weight: var(--e-global-typography-accent-font-weight);
    letter-spacing: var(--e-global-typography-accent-letter-spacing);
    fill: var(--e-global-color-primary);
    color: var(--e-global-color-primary) !important;
    border-style: none;
    border-radius: 10px;
    text-decoration: none !important;
    white-space: nowrap;
    transition: opacity 0.15s;
}

.nds-tl__order-btn:hover {
    opacity: 0.85;
}

.nds-tl__no-results {
    text-align: center;
    padding: 32px 16px;
    background: var(--nds-bg);
    border-radius: var(--nds-radius);
    color: var(--nds-text-muted);
    font-size: 15px;
}

.nds-tl__register-cta {
    margin-top: 16px;
    font-size: 14px;
    color: var(--nds-text-muted);
}

.nds-tl__register-cta a {
    color: var(--nds-accent);
    font-weight: 500;
    text-decoration: none;
}

.nds-tl__register-cta a:hover {
    text-decoration: underline;
}

/* ── Mobile ── */

@media (max-width: 960px) {
    .nds-tl {
        max-width: 90%;
    }
}

@media (max-width: 600px) {
    .nds-tl {
        max-width: 100%;
    }

    .nds-tl__form {
        padding: 16px;
    }

    .nds-tl__form-row {
        flex-direction: column;
        gap: 12px;
    }

    .nds-tl__field {
        min-width: 100%;
    }

    /* Stack table rows on mobile */
    .nds-tl__table thead {
        display: none;
    }

    .nds-tl__table,
    .nds-tl__table tbody,
    .nds-tl__table tr,
    .nds-tl__table td {
        display: block;
    }

    .nds-tl__table tr {
        padding: 14px 16px;
        border-bottom: 1px solid var(--nds-border);
    }

    .nds-tl__table tbody tr:last-child {
        border-bottom: none;
    }

    .nds-tl__table td {
        padding: 4px 0;
        border-bottom: none;
    }

    .nds-tl__table td:before {
        content: attr(data-label);
        font-size: 11px;
        font-weight: 700;
        text-transform: uppercase;
        color: var(--nds-text-muted);
        letter-spacing: 0.04em;
        display: block;
        margin-bottom: 2px;
    }

    .nds-tl__table td:last-child {
        margin-top: 8px;
    }
}
