/* [tecdoc_search_tabs] home search box + [tecdoc_code_search] header Cod / OE search. */

.amz-st,
.amz-cs {
    --amz-st-accent: #e31c23;
    --amz-st-accent-hover: #c8161c;
    --amz-st-ink: #1a1f2c;
    --amz-st-muted: #6b7380;
    --amz-st-line: #e2e5ea;
    --amz-st-card: #ffffff;
    --amz-st-control-h: 48px;
    --amz-st-radius: 4px;
    box-sizing: border-box;
    font-size: 15px;
    line-height: 1.4;
}

.amz-st *,
.amz-st *::before,
.amz-st *::after,
.amz-cs *,
.amz-cs *::before,
.amz-cs *::after {
    box-sizing: border-box;
}

.amz-st [hidden],
.amz-cs [hidden] {
    display: none !important;
}

.amz-st__sr {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.amz-st {
    position: relative;
    z-index: 6;
    color: var(--amz-st-ink);
}

/* —— Tabs —— */
.amz-st__tabs {
    display: flex;
    gap: 0.35rem;
    padding-left: 0.25rem;
}

.amz-st .amz-st__tab {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    height: 50px;
    margin: 0;
    padding: 0 1.4rem;
    border: 0;
    border-radius: 8px 8px 0 0;
    background: rgba(255, 255, 255, 0.86);
    color: var(--amz-st-ink);
    font: inherit;
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.1;
    text-transform: none;
    box-shadow: none;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.amz-st .amz-st__tab svg {
    flex: none;
    color: var(--amz-st-muted);
}

.amz-st .amz-st__tab:hover {
    background: #fff;
    color: var(--amz-st-ink);
}

.amz-st .amz-st__tab.is-active,
.amz-st .amz-st__tab.is-active:hover {
    background: var(--amz-st-accent);
    color: #fff;
}

.amz-st .amz-st__tab.is-active svg {
    color: #fff;
}

.amz-st .amz-st__tab:focus-visible {
    outline: 2px solid var(--amz-st-accent);
    outline-offset: 2px;
}

.amz-st__tab-short {
    display: none;
}

.amz-st__tab-lock {
    display: inline-flex;
    opacity: 0.7;
}

/* —— Box —— */
.amz-st__box {
    background: var(--amz-st-card);
    border: 1px solid var(--amz-st-line);
    border-top: 3px solid var(--amz-st-accent);
    border-radius: 0 8px 8px 8px;
    box-shadow: 0 14px 36px rgba(11, 28, 51, 0.16);
}

.amz-st__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: center;
    margin: 0;
    padding: 1.1rem 1.25rem;
}

.amz-st__row--vehicle {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.4fr) auto;
}

.amz-st__field {
    position: relative;
    display: block;
    min-width: 0;
    margin: 0;
}

.amz-st .amz-st__input {
    width: 100%;
    height: var(--amz-st-control-h);
    margin: 0;
    padding: 0 0.9rem;
    border: 1px solid var(--amz-st-line);
    border-radius: var(--amz-st-radius);
    background: #fff;
    color: var(--amz-st-ink);
    font: inherit;
    font-size: 0.95rem;
    box-shadow: none;
}

.amz-st .amz-st__input--mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    letter-spacing: 0.03em;
}

.amz-st .amz-st__input:focus {
    outline: 2px solid var(--amz-st-accent);
    outline-offset: -1px;
}

.amz-st .amz-st__submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    height: var(--amz-st-control-h);
    min-width: 190px;
    margin: 0;
    padding: 0 1.4rem;
    border: 0;
    border-radius: var(--amz-st-radius);
    background: var(--amz-st-accent);
    color: #fff;
    font: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    line-height: 1;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.15s ease;
}

.amz-st .amz-st__submit:hover:not(:disabled) {
    background: var(--amz-st-accent-hover);
    color: #fff;
}

.amz-st .amz-st__submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.amz-st__status {
    margin: -0.4rem 1.25rem 0.8rem !important;
    font-size: 0.85rem;
    color: var(--amz-st-accent);
}

.amz-st__row--locked p {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 !important;
    font-size: 0.92rem;
    color: var(--amz-st-muted);
}

/* —— Dropdown —— */
.amz-st__dd {
    position: relative;
}

.amz-st .amz-st__dd-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    height: var(--amz-st-control-h);
    margin: 0;
    padding: 0 0.75rem;
    border: 1px solid var(--amz-st-line);
    border-radius: var(--amz-st-radius);
    background: #fff;
    color: var(--amz-st-ink);
    font: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0;
    text-align: left;
    text-transform: none;
    box-shadow: none;
    cursor: pointer;
}

.amz-st .amz-st__dd-btn:hover:not(:disabled) {
    background: #fff;
    color: var(--amz-st-ink);
    border-color: #c9ced6;
}

.amz-st .amz-st__dd-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.amz-st .amz-st__dd-btn:focus-visible,
.amz-st__dd.is-open .amz-st__dd-btn {
    outline: 2px solid var(--amz-st-accent);
    outline-offset: -1px;
}

.amz-st__dd-val {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1 1 auto;
    min-width: 0;
}

.amz-st__dd-label,
.amz-st__dd-ph {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.amz-st__dd-ph {
    color: var(--amz-st-muted);
}

.amz-st__dd-chev {
    flex: none;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid var(--amz-st-muted);
}

.amz-st__logo {
    flex: none;
    width: 26px;
    height: 26px;
    object-fit: contain;
}

.amz-st .amz-st__dd-list {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 50;
    width: max(100%, 260px);
    max-height: 320px;
    margin: 0 !important;
    padding: 0.25rem 0 !important;
    overflow-y: auto;
    list-style: none !important;
    background: #fff;
    border: 1px solid var(--amz-st-line);
    border-radius: var(--amz-st-radius);
    box-shadow: 0 18px 44px rgba(11, 28, 51, 0.2);
}

.amz-st .amz-st__dd-opt {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0 !important;
    padding: 0.5rem 0.8rem;
    font-size: 0.92rem;
    line-height: 1.3;
    cursor: pointer;
}

.amz-st .amz-st__dd-opt::before {
    display: none;
}

.amz-st .amz-st__dd-opt.is-active,
.amz-st .amz-st__dd-opt:hover {
    background: rgba(227, 28, 35, 0.08);
}

.amz-st .amz-st__dd-opt.is-selected {
    font-weight: 700;
    box-shadow: inset 3px 0 0 var(--amz-st-accent);
}

/* —— VIN results —— */
.amz-st__vin-results {
    display: grid;
    gap: 0.6rem;
    padding: 0 1.25rem 1.1rem;
}

.amz-st .amz-st__vin-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--amz-st-line);
    border-radius: var(--amz-st-radius);
    color: var(--amz-st-ink);
    text-decoration: none;
    transition: border-color 0.15s ease;
}

.amz-st .amz-st__vin-card:hover {
    border-color: var(--amz-st-accent);
    color: var(--amz-st-ink);
}

.amz-st__vin-body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
}

.amz-st__vin-body small {
    color: var(--amz-st-muted);
    font-size: 0.8rem;
}

.amz-st__vin-cta {
    flex: none;
    color: var(--amz-st-accent);
    font-size: 0.85rem;
    font-weight: 700;
}

/* —— Mașina mea —— */
.amz-st__extras {
    display: flex;
    align-items: center;
    padding: 0.7rem 1.25rem;
    border-top: 1px solid var(--amz-st-line);
    border-radius: 0 0 8px 8px;
    background: #fafbfc;
    font-size: 0.85rem;
}

.amz-st__mycar {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0 auto;
    color: var(--amz-st-ink);
}

.amz-st .amz-st__mycar select {
    width: auto;
    max-width: 300px;
    height: 34px;
    margin: 0;
    padding: 0 2rem 0 0.6rem;
    border: 1px solid var(--amz-st-line);
    border-radius: var(--amz-st-radius);
    background-color: #fff;
    font: inherit;
    font-size: 0.85rem;
}

/* —— Cod / OE search (header + mobile block) —— */
.amz-cs {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
    width: 100%;
    margin: 0;
}

.amz-cs__field {
    position: relative;
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
}

.amz-cs__icon {
    position: absolute;
    top: 50%;
    left: 0.75rem;
    display: inline-flex;
    color: #8a93a3;
    transform: translateY(-50%);
    pointer-events: none;
}

.amz-cs .amz-cs__field input {
    width: 100%;
    height: 42px;
    margin: 0;
    padding: 0 0.8rem 0 2.3rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--amz-st-radius);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font: inherit;
    font-size: 0.92rem;
    box-shadow: none;
}

.amz-cs .amz-cs__field input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.amz-cs .amz-cs__field input:focus {
    outline: 2px solid var(--amz-st-accent);
    outline-offset: -1px;
}

.amz-cs .amz-cs__btn {
    flex: none;
    height: 42px;
    margin: 0;
    padding: 0 1.1rem;
    border: 0;
    border-radius: var(--amz-st-radius);
    background: var(--amz-st-accent);
    color: #fff;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    line-height: 1;
    text-transform: uppercase;
    cursor: pointer;
}

.amz-cs .amz-cs__btn:hover {
    background: var(--amz-st-accent-hover);
    color: #fff;
}

/* Default hides the icon; header + mobile variants show it instead of the text. */
.amz-cs__btn-icon {
    display: none;
}

.amz-cs--mobile {
    gap: 0.5rem;
}

.amz-cs--mobile .amz-cs__btn-icon {
    display: inline-flex;
}

.amz-cs--mobile .amz-cs__btn-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.amz-cs--mobile .amz-cs__field input {
    height: 48px;
    border-color: transparent;
    background: #eef0f3;
    color: var(--amz-st-ink);
    font-size: 1rem;
}

.amz-cs--mobile .amz-cs__field input::placeholder {
    color: var(--amz-st-muted);
}

.amz-cs--mobile .amz-cs__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
}

/* Header: one field, red magnifier submit button inside it on the right (no text, no left icon). */
.amz-cs--header {
    position: relative;
    gap: 0;
}

.amz-cs--header .amz-cs__icon {
    display: none;
}

.amz-cs.amz-cs--header .amz-cs__field input {
    padding: 0 3rem 0 0.95rem;
    border-color: rgba(255, 255, 255, 0.22);
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.amz-cs.amz-cs--header .amz-cs__field input:hover {
    border-color: rgba(255, 255, 255, 0.36);
}

.amz-cs.amz-cs--header .amz-cs__field input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 3px rgba(227, 28, 35, 0.35);
}

.amz-cs.amz-cs--header .amz-cs__btn {
    position: absolute;
    top: 50%;
    right: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: calc(var(--amz-st-radius) - 1px);
    transform: translateY(-50%);
    transition: background-color 0.15s ease, transform 0.15s ease;
}

.amz-cs.amz-cs--header .amz-cs__btn:active {
    transform: translateY(-50%) scale(0.94);
}

.amz-cs.amz-cs--header .amz-cs__btn:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.amz-cs--header .amz-cs__btn-icon {
    display: inline-flex;
}

.amz-cs--header .amz-cs__btn-icon svg {
    width: 17px;
    height: 17px;
}

.amz-cs--header .amz-cs__btn-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.amz-st__code {
    display: none;
    margin: 0 0 1rem;
}

/* The magnifier is on the button there, not in the field. */
.amz-cs--mobile .amz-cs__icon {
    display: none;
}

.amz-cs--mobile .amz-cs__field input {
    padding-left: 0.9rem;
}

/* —— Phones / tablets: code search lives above the tabs, header one is hidden —— */
@media (max-width: 980px) {
    .amz-st__code {
        display: block;
    }

    .amz-cs--header:not(.amz-cs--always) {
        display: none;
    }

    .amz-st__row--vehicle {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .amz-st__row--vehicle .amz-st__field:nth-child(3),
    .amz-st__row--vehicle .amz-st__submit {
        grid-column: 1 / -1;
    }
}

@media (min-width: 601px) and (max-width: 980px) {
    .amz-st .amz-st__tab {
        flex: 1 1 0;
        justify-content: center;
        padding: 0 0.6rem;
        font-size: 0.82rem;
        white-space: nowrap;
    }
}

@media (max-width: 600px) {
    .amz-st__tabs {
        gap: 0.25rem;
        padding-left: 0;
    }

    .amz-st .amz-st__tab {
        flex: 1 1 0;
        flex-direction: column;
        justify-content: center;
        gap: 0.2rem;
        height: 58px;
        padding: 0 0.4rem;
        font-size: 0.8rem;
        text-align: center;
    }

    .amz-st__tab-label {
        position: absolute !important;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    .amz-st__tab-short {
        display: inline;
    }

    .amz-st__tab-lock {
        position: absolute;
        top: 7px;
        right: 7px;
    }

    .amz-st__box {
        border-radius: 0 0 8px 8px;
    }

    .amz-st__row,
    .amz-st__row--vehicle {
        grid-template-columns: minmax(0, 1fr);
        padding: 0.9rem;
    }

    .amz-st .amz-st__submit {
        width: 100%;
    }

    .amz-st__row--locked p {
        align-items: flex-start;
    }

    .amz-st__status {
        margin: -0.3rem 0.9rem 0.8rem !important;
    }

    .amz-st__vin-results {
        padding: 0 0.9rem 0.9rem;
    }

    .amz-st .amz-st__vin-card {
        flex-wrap: wrap;
    }

    .amz-st__extras {
        display: block;
        padding: 0.7rem 0.9rem;
    }

    .amz-st__mycar {
        display: flex;
        flex-wrap: wrap;
        gap: 0.4rem 0.5rem;
        width: 100%;
        margin: 0;
    }

    .amz-st .amz-st__mycar select {
        flex: 1 1 100%;
        width: 100%;
        max-width: none;
        height: 44px;
        font-size: 0.95rem;
    }

    .amz-st .amz-st__dd-list {
        width: 100%;
    }
}

/* Motor theme header (template-parts/header1.php): the search sits in the floated .header-info
   (icons) area, which the theme sizes for icons only. Make room for it, only when it is there:
   > 1220px  one row  (logo 20% · nav 57% · icons 23%): take the search width from the nav (its 4 items use ~1/3).
   981–1220  two rows (icons on top, max 400px; nav below): widen the icon row by the search width.
   ≤ 980px   hidden (the home tab box has the code search). */
.header-info .amz-header-code {
    box-sizing: border-box;
    float: right;
    display: flex;
    align-items: center;
    width: var(--amz-hcode-w, 280px);
    height: 50px;
    padding: 0 0.75rem 0 0;
}

@media (min-width: 1221px) {
    /* Icons need ~310px (wishlist + cart + account); the theme's 23% is less than that below ~1350px. */
    .header:has(.amz-header-code) {
        --amz-hcode-w: clamp(200px, 16vw, 320px);
        --amz-hicons-w: max(23%, 360px);
    }

    .header:has(.amz-header-code) .header-info {
        width: calc(var(--amz-hicons-w) + var(--amz-hcode-w));
    }

    .header:has(.amz-header-code) nav {
        width: calc(77% - var(--amz-hicons-w) - var(--amz-hcode-w));
    }

    .header .header-info .amz-header-code {
        height: 99px;
    }
}

/* Narrow one-row header: tighter gaps so the 4 menu items stay on one line. */
@media (min-width: 1221px) and (max-width: 1439px) {
    .header:has(.amz-header-code) nav ul .menu-item {
        margin-left: 1.5%;
        margin-right: 1.5%;
    }
}

@media (min-width: 981px) and (max-width: 1220px) {
    .header:has(.amz-header-code) {
        --amz-hcode-w: 280px;
    }

    .header:has(.amz-header-code) .header-info {
        max-width: calc(400px + var(--amz-hcode-w));
    }
}

/* Floats wrapped the code box onto a second row as soon as the icons grew (logged in, cart total like
   "1.761,06 lei"). Flex row-reverse keeps the same right-to-left order and lets the code box shrink. */
@media (min-width: 981px) {
    .header .header-info:has(.amz-header-code) {
        display: flex;
        flex-direction: row-reverse;
        align-items: flex-start;
        justify-content: flex-start;
    }

    .header .header-info:has(.amz-header-code) > * {
        flex: none;
    }

    .header .header-info > .amz-header-code {
        flex: 0 1 var(--amz-hcode-w, 280px);
        width: auto;
        min-width: 0;
    }

    .header .header-info .amz-header-code > * {
        min-width: 0;
        width: 100%;
    }
}

@media (max-width: 980px) {
    .header-info .amz-header-code {
        display: none;
    }
}

/* Long vehicle rows wrap in the open list (the closed field still truncates). */
.amz-st .amz-st__dd-opt .amz-st__dd-label {
    overflow: visible;
    white-space: normal;
}

/* —— Dropdown list search (long lists): sticky first row —— */
.amz-st .amz-st__dd-list:has(> .amz-st__dd-search) {
    padding-top: 0 !important;
}

.amz-st .amz-st__dd-search {
    position: sticky;
    top: 0;
    z-index: 2;
    margin: 0 0 0.25rem !important;
    padding: 0.5rem 0.6rem !important;
    background: #f7f8fa;
    border-bottom: 1px solid var(--amz-st-line);
    list-style: none !important;
}

.amz-st .amz-st__dd-search::before,
.amz-st .amz-st__dd-empty::before {
    display: none !important;
}

.amz-st .amz-st__dd-search input {
    box-sizing: border-box;
    display: block;
    width: 100%;
    height: 38px;
    margin: 0;
    padding: 0 0.7rem 0 2.1rem;
    border: 1px solid var(--amz-st-line);
    border-radius: var(--amz-st-radius);
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7380' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-4-4'/%3E%3C/svg%3E") no-repeat 0.65rem 50%;
    color: inherit;
    font: inherit;
    /* ≥16px: iOS does not zoom the page on focus. */
    font-size: 16px;
    line-height: 1.2;
    box-shadow: none;
    -webkit-appearance: none;
    appearance: none;
}

.amz-st .amz-st__dd-search input:focus {
    outline: none;
    border-color: #e31c23;
    box-shadow: 0 0 0 3px rgba(227, 28, 35, 0.12);
}

.amz-st .amz-st__dd-search input::-webkit-search-cancel-button {
    cursor: pointer;
}

.amz-st .amz-st__dd-empty {
    margin: 0 !important;
    padding: 0.75rem 0.8rem;
    color: #6b7380;
    font-size: 0.88rem;
    list-style: none !important;
}
