/* ========================================================================== */
/* ElasticSearch Category — header paieškos laukas + quick search dropdown     */
/* ========================================================================== */

.header .header-lower .search-box,
.header .header-lower .store-search-box,
.header .search-box,
.header .store-search-box {
    position: relative !important;
    overflow: visible !important;
    box-shadow: none !important;
    filter: none !important;
}

.header .search-box--enhanced,
.header .store-search-box.search-box--enhanced {
    position: relative !important;
}

.header .header-lower,
.sticky-header-added .master-header.stick .header .header-lower {
    overflow: visible !important;
}

.search-box form {
    position: relative;
}

.header .header-lower .search-box form:not(.search-box-form--enhanced),
.header .header-lower .store-search-box form:not(.search-box-form--enhanced),
.header .search-box form:not(.search-box-form--enhanced),
.header .store-search-box form:not(.search-box-form--enhanced) {
    display: flex !important;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    position: relative;
}

.header .header-lower .search-box form:not(.search-box-form--enhanced) .search-box-text,
.header .header-lower .search-box form:not(.search-box-form--enhanced) input[type="text"],
.header .header-lower .store-search-box form:not(.search-box-form--enhanced) input[type="text"],
.header .search-box form:not(.search-box-form--enhanced) .search-box-text,
.header .search-box form:not(.search-box-form--enhanced) input[type="text"],
.header .store-search-box form:not(.search-box-form--enhanced) input[type="text"] {
    flex: 1 1 auto;
    width: auto !important;
    min-width: 0;
    max-width: 100%;
    height: 42px !important;
    padding: 0 14px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    background: #fff !important;
    color: #1e293b;
    font-size: 14px;
    box-sizing: border-box;
    box-shadow: none !important;
    transition: border-color 0.2s ease;
}

.header .header-lower .search-box form:not(.search-box-form--enhanced) input[type="text"]:hover,
.header .header-lower .store-search-box form:not(.search-box-form--enhanced) input[type="text"]:hover,
.header .header-lower .search-box form:not(.search-box-form--enhanced) input[type="text"]:focus,
.header .header-lower .store-search-box form:not(.search-box-form--enhanced) input[type="text"]:focus,
.header .search-box form:not(.search-box-form--enhanced) input[type="text"]:hover,
.header .search-box form:not(.search-box-form--enhanced) input[type="text"]:focus,
.header .store-search-box form:not(.search-box-form--enhanced) input[type="text"]:hover,
.header .store-search-box form:not(.search-box-form--enhanced) input[type="text"]:focus {
    border-color: #FCDF00 !important;
    outline: none !important;
    box-shadow: none !important;
}

.header .header-lower .search-box form:not(.search-box-form--enhanced),
.header .header-lower .store-search-box form:not(.search-box-form--enhanced) {
    gap: 10px !important;
}

.header .header-lower .search-box form:not(.search-box-form--enhanced) .button-1.search-box-button,
.header .header-lower .store-search-box form:not(.search-box-form--enhanced) .button-1.search-box-button,
.header .search-box form:not(.search-box-form--enhanced) .button-1.search-box-button,
.header .store-search-box form:not(.search-box-form--enhanced) .button-1.search-box-button {
    position: static !important;
    top: auto !important;
    right: auto !important;
    transform: none !important;
    flex: 0 0 44px;
    width: 44px !important;
    min-width: 44px;
    height: 42px !important;
    margin: 0;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    font-size: 0 !important;
    line-height: 1;
    background: #f8fafc !important;
    background-color: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    box-shadow: none !important;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.header .header-lower .search-box form:not(.search-box-form--enhanced) .button-1.search-box-button::before,
.header .header-lower .store-search-box form:not(.search-box-form--enhanced) .button-1.search-box-button::before,
.header .search-box form:not(.search-box-form--enhanced) .button-1.search-box-button::before,
.header .store-search-box form:not(.search-box-form--enhanced) .button-1.search-box-button::before {
    content: "\e94e";
    font-size: 16px;
    line-height: 1;
    color: #64748b !important;
    display: block;
}

.header .header-lower .search-box form:not(.search-box-form--enhanced) .button-1.search-box-button:hover,
.header .header-lower .search-box form:not(.search-box-form--enhanced) .button-1.search-box-button:focus,
.header .header-lower .store-search-box form:not(.search-box-form--enhanced) .button-1.search-box-button:hover,
.header .header-lower .store-search-box form:not(.search-box-form--enhanced) .button-1.search-box-button:focus,
.header .search-box form:not(.search-box-form--enhanced) .button-1.search-box-button:hover,
.header .search-box form:not(.search-box-form--enhanced) .button-1.search-box-button:focus,
.header .store-search-box form:not(.search-box-form--enhanced) .button-1.search-box-button:hover,
.header .store-search-box form:not(.search-box-form--enhanced) .button-1.search-box-button:focus {
    background: #FCDF00 !important;
    background-color: #FCDF00 !important;
    border-color: #FCDF00 !important;
}

.header .header-lower .search-box form:not(.search-box-form--enhanced) .button-1.search-box-button:hover::before,
.header .header-lower .search-box form:not(.search-box-form--enhanced) .button-1.search-box-button:focus::before,
.header .header-lower .store-search-box form:not(.search-box-form--enhanced) .button-1.search-box-button:hover::before,
.header .header-lower .store-search-box form:not(.search-box-form--enhanced) .button-1.search-box-button:focus::before,
.header .search-box form:not(.search-box-form--enhanced) .button-1.search-box-button:hover::before,
.header .search-box form:not(.search-box-form--enhanced) .button-1.search-box-button:focus::before,
.header .store-search-box form:not(.search-box-form--enhanced) .button-1.search-box-button:hover::before,
.header .store-search-box form:not(.search-box-form--enhanced) .button-1.search-box-button:focus::before {
    color: #434242 !important;
}

.header .header-lower .search-box form input[type="text"]::placeholder,
.header .header-lower .store-search-box form input[type="text"]::placeholder {
    color: #94a3b8;
    opacity: 1;
}

.header .search-box-form--enhanced {
    display: flex !important;
    gap: 0 !important;
    width: 100%;
}

.header .header-lower .search-box-form--enhanced .search-box-button,
.header .search-box-form--enhanced .search-box-button {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.header .header-lower .search-box-form--enhanced .search-box-field,
.header .search-box-form--enhanced .search-box-field {
    position: relative;
    display: flex !important;
    align-items: center;
    flex: 1 1 auto !important;
    min-width: 0;
    width: 100% !important;
    max-width: 100%;
    height: 42px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.header .header-lower .search-box-form--enhanced .search-box-field:focus-within,
.header .search-box-form--enhanced .search-box-field:focus-within {
    border-color: #FCDF00 !important;
    box-shadow: none !important;
}

.header .header-lower .search-box-form--enhanced .search-box-field .search-box-text,
.header .header-lower .search-box-form--enhanced .search-box-field input[type="text"],
.header .search-box-form--enhanced .search-box-field .search-box-text,
.header .search-box-form--enhanced .search-box-field input[type="text"] {
    display: block;
    flex: 1 1 auto !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    padding: 0 72px 0 14px !important;
    border: none !important;
    border-radius: 8px !important;
    background: transparent !important;
    color: #1e293b;
    font-size: 14px;
    box-shadow: none !important;
    outline: none !important;
}

.header .search-box-form--enhanced .search-box-field input[type="text"]:hover,
.header .search-box-form--enhanced .search-box-field input[type="text"]:focus {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.header .search-box-clear,
.header .search-box-inline-search {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    color: #8a919b;
    cursor: pointer;
    line-height: 1;
    z-index: 2;
}

.header .search-box-inline-search {
    right: 8px;
    width: 30px;
    height: 30px;
    border-radius: 4px;
    color: #5b6472;
}

.header .search-box-inline-search .es-qs-icon-svg {
    width: 18px;
    height: 18px;
}

.header .search-box-inline-search:hover,
.header .search-box-inline-search:focus {
    color: #434242;
    background: rgba(252, 223, 0, 0.35);
    outline: none;
}

.header .search-box-clear {
    right: 38px;
    width: 24px;
    height: 24px;
    font-size: 22px;
    font-weight: 300;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease, color 0.15s ease;
}

.header .search-box-field.has-value .search-box-clear {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.header .search-box-clear:hover,
.header .search-box-clear:focus {
    color: #434242;
    outline: none;
}

.header .search-box--enhanced .es-category-quicksearch-panel,
.header .store-search-box.search-box--enhanced .es-category-quicksearch-panel {
    top: calc(100% + 6px);
    left: 0;
    right: auto;
}

.header .search-box .ui-autocomplete,
.header .store-search-box .ui-autocomplete,
.header .search-box .ui-autocomplete.ui-widget-content,
.header .store-search-box .ui-autocomplete.ui-widget-content {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-top: 4px;
    max-height: min(360px, 50vh);
    overflow-x: hidden;
    overflow-y: auto;
    z-index: 10060 !important;
    background: #fff !important;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12) !important;
    border: 1px solid #e8ecf1 !important;
    border-radius: 0 0 6px 6px;
}

.header .search-box .ui-autocomplete li a,
.header .store-search-box .ui-autocomplete li a,
.header .search-box .ui-autocomplete .ui-menu-item a,
.header .store-search-box .ui-autocomplete .ui-menu-item a {
    display: flex !important;
    align-items: center;
    gap: 10px;
    padding: 6px 12px !important;
    min-height: 56px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header .search-box .ui-autocomplete li a span,
.header .store-search-box .ui-autocomplete li a span {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header .search-box .ui-autocomplete li a img,
.header .store-search-box .ui-autocomplete li a img {
    flex: 0 0 56px;
    display: block !important;
    width: 56px !important;
    height: 56px !important;
    min-width: 56px !important;
    max-width: 56px !important;
    object-fit: cover;
    object-position: center;
    background: transparent;
    border: none;
    border-radius: 3px;
    padding: 0;
    box-sizing: border-box;
}

@media (min-width: 992px) {
    .header .header-lower .search-box form:not(.search-box-form--enhanced) input,
    .header .header-lower .store-search-box form:not(.search-box-form--enhanced) input,
    .header .header-lower .search-box-form--enhanced .search-box-field,
    .header .header-lower .store-search-box .search-box-form--enhanced .search-box-field {
        flex: 1 1 auto;
        width: auto !important;
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
    }
}

@media (min-width: 768px) and (max-width: 1199px) {
    .header .header-lower .search-box form:not(.search-box-form--enhanced) input,
    .header .header-lower .store-search-box form:not(.search-box-form--enhanced) input,
    .header .header-lower .search-box-form--enhanced .search-box-field,
    .header .header-lower .store-search-box .search-box-form--enhanced .search-box-field {
        flex: 1 1 0;
        min-width: 0;
        width: auto !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}

@media (min-width: 1200px) {
    .header .header-lower .search-box form:not(.search-box-form--enhanced) input,
    .header .header-lower .store-search-box form:not(.search-box-form--enhanced) input {
        display: block !important;
        flex: 1 1 auto;
        width: auto !important;
        max-width: 100% !important;
        min-width: 0;
        box-sizing: border-box;
        padding-right: 15px !important;
    }

    .header .header-lower .search-box-form--enhanced .search-box-field,
    .header .header-lower .store-search-box .search-box-form--enhanced .search-box-field {
        display: flex !important;
        flex: 1 1 auto;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0;
        box-sizing: border-box;
    }
}

@media (max-width: 991px) {
    .header .header-lower .search-box,
    .header .search-box,
    .header .store-search-box {
        box-shadow: none !important;
    }

    .header .search-box.open,
    .header .store-search-box.open {
        box-shadow: none !important;
    }
}

/* --- Quick search dropdown panel --- */

.es-category-quicksearch-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: auto;
    z-index: 1200;
    width: 100%;
    background: #fff;
    border: 1px solid #e4e7ec;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
    border-radius: 8px;
    overflow: hidden;
}

@media (min-width: 992px) {
    .header .search-box .es-category-quicksearch-panel,
    .header .store-search-box .es-category-quicksearch-panel {
        width: min(760px, calc(100vw - 48px));
        min-width: min(100%, 640px);
        max-width: 760px;
    }
}

.es-qs-body {
    display: flex;
    align-items: stretch;
    min-height: 220px;
    max-height: min(520px, 62vh);
}

.es-qs-left {
    flex: 0 0 38%;
    min-width: 220px;
    max-width: 320px;
    border-right: 1px solid #eceff3;
    background: #fafbfc;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.es-qs-right {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: #fff;
    min-height: 0;
}

.es-qs-col-header {
    flex: 0 0 auto;
    padding: 12px 16px 8px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #8a919b;
}

.es-qs-col-header--products {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.es-qs-col-title {
    flex: 0 0 auto;
}

.es-qs-all-products {
    flex: 0 0 auto;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: normal;
    text-transform: none;
    color: var(--jupoja-blue, #1B47A0);
    text-decoration: none;
}

.es-qs-all-products:hover,
.es-qs-all-products:focus {
    color: var(--jupoja-blue, #1B47A0);
    text-decoration: underline;
}

.es-qs-left-content,
.es-qs-products {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0 0 10px;
}

.es-qs-left-group + .es-qs-left-group {
    border-top: 1px solid #e8ebf0;
    margin-top: 4px;
    padding-top: 4px;
}

.es-qs-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 9px 16px;
    color: #2f3540;
    text-decoration: none;
    line-height: 1.35;
}

.es-qs-item:hover,
.es-qs-item:focus {
    background: #f0f3f7;
    color: #2f3540;
    text-decoration: none;
}

.es-qs-item-icon {
    flex: 0 0 18px;
    width: 18px;
    margin-top: 1px;
    color: #9aa3af;
}

.es-qs-icon-svg {
    display: block;
    width: 18px;
    height: 18px;
}

.es-qs-icon-svg--branch {
    width: 16px;
    height: 16px;
}

.es-qs-item-text {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 14px;
}

.es-qs-term .es-qs-item-text {
    font-weight: 700;
    color: #1e293b;
}

.es-qs-category-prefix {
    color: #5b6472;
    font-weight: 400;
}

.es-qs-category-name {
    color: var(--jupoja-blue, #1B47A0);
    font-weight: 600;
}

.es-qs-keyword .es-qs-item-text {
    color: #434a54;
    font-size: 13px;
}

.es-qs-product-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 0 12px 8px;
    padding: 10px 12px;
    border: 1px solid #e8ebf0;
    border-radius: 6px;
    background: #fff;
    color: inherit;
    text-decoration: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.es-qs-product-card:hover,
.es-qs-product-card:focus {
    border-color: #d7dde5;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
    color: inherit;
    text-decoration: none;
}

.es-qs-product-thumb {
    flex: 0 0 64px;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
}

.es-qs-product-thumb--empty {
    background: #f5f7fa;
    border-radius: 4px;
}

.es-qs-product-thumb img {
    display: block;
    width: 64px;
    height: 64px;
    max-width: none;
    object-fit: contain;
    object-position: center;
    image-rendering: auto;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.es-qs-product-body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.es-qs-product-title {
    display: block;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    color: #1e293b;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.es-qs-product-prices {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px 16px;
}

.es-qs-price-col {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.es-qs-price-label {
    font-size: 11px;
    line-height: 1.2;
    color: #8a919b;
    white-space: nowrap;
}

.es-qs-price-col--current .es-qs-price-value {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    background: var(--jupoja-yellow, #FCDF00);
    color: #1e293b;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.es-qs-price-col--old .es-qs-price-value {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    color: #8a919b;
    white-space: nowrap;
}

.es-qs-footer {
    display: block;
    background: var(--jupoja-yellow, #FCDF00);
    color: #1e293b;
    text-align: center;
    font-weight: 700;
    font-size: 14px;
    padding: 12px 16px;
    text-decoration: none;
    border-top: 1px solid #eadf66;
}

.es-qs-footer:hover,
.es-qs-footer:focus {
    background: #f2d500;
    color: #1e293b;
    text-decoration: none;
}

.es-qs-empty {
    padding: 16px;
    color: #8a919b;
    font-size: 14px;
}

.es-qs-highlight {
    font-weight: 700;
}

@media (max-width: 991px) {
    .es-qs-body {
        flex-direction: column;
        max-height: min(70vh, 640px);
    }

    .es-qs-left {
        flex: none;
        max-width: none;
        border-right: none;
        border-bottom: 1px solid #eceff3;
        max-height: 38%;
    }

    .es-qs-products {
        max-height: none;
    }
}

@media (max-width: 767px) {
    .es-category-quicksearch-panel {
        left: -12px;
        right: -12px;
        width: calc(100% + 24px);
        min-width: 0;
        max-width: none;
    }

    .es-qs-product-prices {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
}
