/* Varustaja24 - WooCommerce Search: "type to search" popup (assets/javascript/search-popup.js). */

html.v24s-lock {
    overflow: hidden;
}

html.v24s-lock body {
    padding-right: var(--v24s-scrollbar, 0px);
}

.v24s-root {
    --v24s-primary: #0b3a82;
    --v24s-dark: #00255c;
    --v24s-border: #E2E8F0;
    --v24s-subtle: #F8FAFC;
    --v24s-text: #0b1c30;
    --v24s-secondary: #5b5e6a;
    --v24s-sale: #CF2E2E;
    --v24s-radius: 4px;
    position: fixed;
    inset: 0;
    z-index: 100000;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    color: var(--v24s-text);
    -webkit-font-smoothing: antialiased;
}

.v24s-root[hidden] {
    display: none;
}

.v24s-root *,
.v24s-root *::before,
.v24s-root *::after {
    box-sizing: border-box;
}

.v24s-sr {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.v24s-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(11, 28, 48, 0.55);
    animation: v24s-fade 0.12s ease-out;
}

/* Mobile: full-screen sheet. */
.v24s-dialog {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    background: #fff;
    overflow: hidden;
    animation: v24s-rise 0.14s ease-out;
}

/* Desktop: centered panel near the top. */
@media (min-width: 768px) {
    .v24s-dialog {
        inset: auto;
        top: 10vh;
        left: 50%;
        width: calc(100% - 32px);
        max-width: 640px;
        max-height: 80vh;
        transform: translateX(-50%);
        border: 1px solid var(--v24s-border);
        border-radius: var(--v24s-radius);
        box-shadow: 0 24px 48px -12px rgba(0, 37, 92, 0.35);
    }
}

.v24s-form {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: none;
    margin: 0;
    padding: 0 8px 0 16px;
    height: 60px;
    border-bottom: 1px solid var(--v24s-border);
    background: #fff;
}

.v24s-icon {
    flex: none;
    color: var(--v24s-primary);
}

.v24s-root .v24s-input {
    flex: 1;
    min-width: 0;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    outline: none;
    font: inherit;
    font-size: 17px;
    font-weight: 500;
    color: var(--v24s-text);
    -webkit-appearance: none;
    appearance: none;
}

.v24s-root .v24s-input::placeholder {
    color: var(--v24s-secondary);
    font-weight: 400;
    opacity: 1;
}

.v24s-root .v24s-input::-webkit-search-cancel-button {
    -webkit-appearance: none;
    display: none;
}

.v24s-root .v24s-close {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: var(--v24s-radius);
    background: transparent;
    color: var(--v24s-secondary);
    cursor: pointer;
}

.v24s-root .v24s-close:hover {
    background: var(--v24s-subtle);
    color: var(--v24s-text);
}

.v24s-root .v24s-close:focus-visible,
.v24s-root .v24s-all:focus-visible {
    outline: 2px solid var(--v24s-primary);
    outline-offset: -2px;
}

.v24s-body {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}

/* Thin progress bar while a search is running. */
.v24s-root.is-loading .v24s-form {
    background-image: linear-gradient(90deg, transparent, var(--v24s-primary), transparent);
    background-size: 40% 2px;
    background-repeat: no-repeat;
    background-position: -40% 100%;
    animation: v24s-progress 0.9s linear infinite;
}

.v24s-status {
    margin: 0;
    padding: 20px 16px;
    color: var(--v24s-secondary);
    text-align: center;
}

.v24s-status[hidden],
.v24s-list[hidden],
.v24s-footer[hidden] {
    display: none;
}

.v24s-list {
    padding: 6px 0;
}

.v24s-root .v24s-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    color: var(--v24s-text);
    text-decoration: none;
    border-left: 3px solid transparent;
}

.v24s-root .v24s-option.is-active {
    background: var(--v24s-subtle);
    border-left-color: var(--v24s-primary);
}

.v24s-thumb {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    overflow: hidden;
    border: 1px solid var(--v24s-border);
    border-radius: var(--v24s-radius);
    background: #fff;
}

.v24s-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.v24s-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.v24s-name {
    font-weight: 600;
    color: var(--v24s-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.v24s-option.is-active .v24s-name {
    color: var(--v24s-dark);
}

.v24s-sku {
    font-size: 12px;
    color: var(--v24s-secondary);
}

.v24s-price {
    flex: none;
    font-weight: 700;
    color: var(--v24s-text);
    white-space: nowrap;
}

.v24s-vat {
    font-size: 10px;
    font-weight: 400;
    color: var(--v24s-secondary);
}

/* Discounted (sale or personal price): sale colour, regular price struck, "-N%" badge. */
.v24s-price {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
    text-align: right;
    line-height: 1.25;
}

.v24s-price.is-sale .v24s-amount,
.v24s-price.is-sale .v24s-vat {
    color: var(--v24s-sale);
}

.v24s-price.is-sale .v24s-vat {
    font-weight: 700;
}

.v24s-from {
    font-size: 12px;
    font-weight: 600;
    color: var(--v24s-secondary);
}

.v24s-price-top {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.v24s-personal {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--v24s-primary);
}

.v24s-badge {
    padding: 2px 6px;
    border-radius: var(--v24s-radius);
    background: var(--v24s-sale);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 16px;
}

.v24s-regular {
    font-size: 14px;
    font-weight: 500;
    color: var(--v24s-secondary);
    text-decoration: line-through;
}

.v24s-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex: none;
    padding: 0 16px;
    min-height: 48px;
    border-top: 1px solid var(--v24s-border);
    background: var(--v24s-subtle);
}

.v24s-keys {
    font-size: 12px;
    color: var(--v24s-secondary);
}

.v24s-root .v24s-all {
    margin-left: auto;
    padding: 6px 0;
    font-weight: 600;
    color: var(--v24s-primary);
    text-decoration: none;
    white-space: nowrap;
}

.v24s-root .v24s-all:hover {
    color: var(--v24s-dark);
    text-decoration: underline;
}

@media (max-width: 767px) {
    .v24s-keys {
        display: none;
    }

    .v24s-root .v24s-all {
        margin: 0 auto;
    }

    .v24s-name {
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }
}

@keyframes v24s-fade {
    from { opacity: 0; }
}

@keyframes v24s-rise {
    from { opacity: 0; }
}

@keyframes v24s-progress {
    to { background-position: 140% 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .v24s-backdrop,
    .v24s-dialog,
    .v24s-root.is-loading .v24s-form {
        animation: none;
    }
}
