/* ==========================================================
 * UHM Parts Search — стили
 * ========================================================== */

/* ===== ПОЛНАЯ ВЕРСИЯ ===== */
.uhm-ps--full .uhm-ps__form {
    display: grid;
    grid-template-columns: 1fr 1fr 1.5fr auto;
    gap: 12px;
    align-items: end;
}
.uhm-ps--full .uhm-ps__select {
    width: 100%;
    box-sizing: border-box;
}
.uhm-ps--full .uhm-ps__button {
    background: #FCB027;
    color: #fff;
    transition: background 0.2s;
}
.uhm-ps--full .uhm-ps__button:hover {
    background: #e09a10;
}
@media (max-width: 768px) {
    .uhm-ps--full .uhm-ps__form {
        grid-template-columns: 1fr;
    }
    .uhm-ps--full .uhm-ps__button {
        width: 100%;
    }
}

/* ===== КОМПАКТНАЯ ВЕРСИЯ ===== */
.uhm-ps__trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: inherit;
    transition: opacity 0.2s;
}
.uhm-ps__trigger:hover { opacity: 0.7; }

.uhm-ps__overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 99998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}
.uhm-ps--open .uhm-ps__overlay {
    opacity: 1;
    visibility: visible;
}

.uhm-ps__panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 380px;
    max-width: 92vw;
    height: 100vh;
    height: 100dvh;
    background: #fff;
    z-index: 99999;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 24px rgba(0,0,0,0.12);
}
.uhm-ps--open .uhm-ps__panel {
    transform: translateX(0);
}

.uhm-ps__panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid #eee;
}
.uhm-ps__panel-title {
    font-family: 'Russo One', sans-serif;
    font-size: 18px;
    text-transform: uppercase;
    color: #1a1a1a;
}
.uhm-ps__panel-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #666;
    transition: color 0.2s;
}
.uhm-ps__panel-close:hover { color: #1a1a1a; }

.uhm-ps--compact .uhm-ps__form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 24px;
    flex: 1;
    overflow-y: auto;
}

.uhm-ps--compact .uhm-ps__label {
    display: block;
    font-family: 'Onest', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #888;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.uhm-ps--compact .uhm-ps__select,
.uhm-ps--compact .uhm-ps__input {
    width: 100%;
    padding: 12px 14px;
    font-size: 15px;
    font-family: 'Onest', sans-serif;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #f9f9f9;
    color: #333;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s;
    appearance: none;
    -webkit-appearance: none;
}
.uhm-ps--compact .uhm-ps__select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
    cursor: pointer;
}
.uhm-ps--compact .uhm-ps__select:focus,
.uhm-ps--compact .uhm-ps__input:focus {
    border-color: #F5C518;
}
.uhm-ps--compact .uhm-ps__select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.uhm-ps--compact .uhm-ps__button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    background: #FCB027;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: 'Russo One', sans-serif;
    font-size: 15px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: auto;
}
.uhm-ps--compact .uhm-ps__button:hover {
    background: #e09a10;
}

body.uhm-ps-noscroll { overflow: hidden; }


/* ==========================================================
 *  Поисковый блок: tabs + input + suggest
 * ========================================================== */
.uhm-ps__search-wrap {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

/* Tabs «По товару / По парт-номеру» */
.uhm-ps__tabs {
    display: inline-flex;
    gap: 2px;
    background: #f0f0f0;
    border-radius: 8px;
    padding: 3px;
    align-self: flex-start;
}
.uhm-ps__tab {
    background: transparent;
    border: none;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
    font-family: inherit;
    white-space: nowrap;
    line-height: 1.2;
}
.uhm-ps__tab:hover {
    color: #1a1a1a;
}
.uhm-ps__tab.is-active {
    background: #F5C518;
    color: #1a1a1a;
}
.uhm-ps__tab:focus {
    outline: none;
}

/* Input занимает всю ширину родителя */
.uhm-ps__input-wrap {
    position: relative;
    width: 100%;
}
.uhm-ps__search-wrap .uhm-ps__input {
    width: 100%;
    box-sizing: border-box;
}

/* В полной версии input нужен явный padding */
.uhm-ps--full .uhm-ps__input {
    padding: 10px 14px;
    font-size: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s;
}
.uhm-ps--full .uhm-ps__input:focus {
    border-color: #F5C518;
}


/* ==========================================================
 *  Подсказки автокомплита
 * ========================================================== */
.uhm-ps__suggest {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #eaeaea;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    max-height: 440px;
    overflow-y: auto;
    z-index: 30;
}
.uhm-ps__suggest[hidden] {
    display: none !important;
}

/* В компактной панели — под инпутом потоком */
.uhm-ps--compact .uhm-ps__suggest {
    position: relative;
    top: 4px;
    box-shadow: none;
    max-height: none;
    border-radius: 6px;
}

.uhm-ps__suggest-item {
    display: grid;
    grid-template-columns: 48px 1fr auto;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid #f2f2f2;
    text-decoration: none;
    color: #333;
    transition: background 0.12s;
    align-items: center;
}
.uhm-ps__suggest-item:last-child {
    border-bottom: none;
}
.uhm-ps__suggest-item:hover,
.uhm-ps__suggest-item.is-hover {
    background: #fafafa;
}

.uhm-ps__suggest-thumb {
    width: 48px;
    height: 48px;
    object-fit: contain;
    background: #f7f7f7;
    border-radius: 4px;
}

.uhm-ps__suggest-body { min-width: 0; }
.uhm-ps__suggest-title {
    font-size: 14px;
    font-weight: 500;
    color: #1a1a1a;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}
.uhm-ps__suggest-meta {
    font-size: 12px;
    color: #777;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.uhm-ps__suggest-meta b {
    color: #1a1a1a;
    font-weight: 600;
}

.uhm-ps__suggest-price {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    white-space: nowrap;
}

.uhm-ps__suggest-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 6px;
    border-radius: 3px;
    background: #F5C518;
    color: #1a1a1a;
    margin-right: 4px;
    vertical-align: middle;
}
.uhm-ps__suggest-badge--sku    { background: #d9ecff; color: #124a7a; }
.uhm-ps__suggest-badge--part   { background: #fff0c4; color: #7a5a00; }
.uhm-ps__suggest-badge--name   { background: #e6f5e6; color: #2d6a2d; }

.uhm-ps__suggest-empty,
.uhm-ps__suggest-loading {
    padding: 16px 14px;
    font-size: 13px;
    color: #888;
    text-align: center;
}

.uhm-ps__suggest-more {
    display: block;
    padding: 12px 14px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
    background: #fafafa;
    text-decoration: none;
    border-top: 1px solid #f2f2f2;
    transition: background 0.15s;
}
.uhm-ps__suggest-more:hover {
    background: #F5C518;
}


/* ==========================================================
 *  ФИЛЬТР-ЧИПСЫ на каталоге
 * ========================================================== */
.uhm-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 16px;
}
.uhm-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 24px;
    font-size: 14px;
    font-family: 'Onest', sans-serif;
    color: #333;
}
.uhm-chip__x {
    background: none !important;
    border: none !important;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    color: #aaa !important;
    padding: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px !important;
    height: 18px !important;
    border-radius: 50%;
    transition: background 0.2s, color 0.2s;
}
.uhm-chip__x:hover {
    background: #e0e0e0;
    color: #333 !important;
}
.uhm-chips__clear {
    background: none !important;
    border: none !important;
    cursor: pointer;
    font-size: 13px;
    color: #888;
    text-decoration: underline;
    padding: 0 !important;
}
.uhm-chips__clear:hover { color: #333; }
