[data-ptx-hs-root] {
    position: relative;
}

[data-ptx-hs-root] [hidden] {
    display: none !important;
}

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

[data-ptx-hs-root][data-ptx-hs-loading="true"]::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(
        90deg,
        rgba(200, 134, 74, 0) 0%,
        rgba(200, 134, 74, 1) 50%,
        rgba(200, 134, 74, 0) 100%
    );
    background-size: 200% 100%;
    animation: ptx-hs-loading-bar 0.9s linear infinite;
    pointer-events: none;
    z-index: 2;
}

[data-ptx-hs-root][data-ptx-hs-loading="true"] [data-ptx-hs-results],
[data-ptx-hs-root][data-ptx-hs-loading="true"] [data-ptx-hs-no-results] {
    opacity: 0.72;
    transition: opacity 0.2s ease;
}

.ptx-hs-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid #e5e5e5;
    border-radius: 999px;
    background: #fff;
    cursor: pointer;
}

.ptx-hs-result {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    text-decoration: none;
    color: inherit;
    padding: 12px;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    background: #fff;
    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

.ptx-hs-result + .ptx-hs-result {
    margin-top: 8px;
}

.ptx-hs-result:hover {
    border-color: #d9c2ac;
    background: #fffaf5;
    transform: translateY(-1px);
}

.ptx-hs-result.is-active,
.ptx-hs-result:focus-visible {
    border-color: #c8864a;
    background: #fffaf5;
    box-shadow: 0 0 0 3px rgba(200, 134, 74, 0.14);
    outline: none;
}

.ptx-hs-result.is-active .ptx-hs-result__title,
.ptx-hs-result:focus-visible .ptx-hs-result__title {
    color: #c8864a;
}

.ptx-hs-result__thumb {
    display: block;
    width: 64px;
    height: 64px;
    border-radius: 6px;
    overflow: hidden;
    background: #f5f5f5;
    cursor: zoom-in;
}

.ptx-hs-result__thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ptx-hs-result__thumb--empty {
    border: 1px solid #e5e5e5;
    cursor: default;
}

.ptx-hs-result__copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.ptx-hs-result__label {
    font-size: 11px;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: #777;
    margin-bottom: 4px;
}

.ptx-hs-result__title {
    font-size: 16px;
    font-weight: 600;
    color: #111;
    transition: color 0.2s ease;
}

.ptx-hs-result__subtitle {
    font-size: 13px;
    color: #666;
    margin-top: 2px;
}

.ptx-hs-result__side {
    white-space: nowrap;
    font-size: 13px;
    font-weight: 600;
    color: #c8864a;
}

.ptx-hs-preview {
    position: fixed;
    top: 0;
    left: 0;
    width: min(320px, calc(100vw - 32px));
    padding: 10px;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 18px 48px rgba(17, 17, 17, 0.18);
    pointer-events: none;
    z-index: 1105;
    opacity: 0;
    transform: translate3d(0, 8px, 0) scale(0.98);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.ptx-hs-preview.is-visible {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
}

.ptx-hs-preview__inner {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 8px;
    overflow: hidden;
    background: #f7f4f1;
}

.ptx-hs-preview__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #fff;
    opacity: 1;
    transition: opacity 0.2s ease;
}

.ptx-hs-preview.is-loading .ptx-hs-preview__image {
    opacity: 0;
}

.ptx-hs-preview.is-loading .ptx-hs-preview__inner::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        rgba(200, 134, 74, 0.08) 0%,
        rgba(200, 134, 74, 0.18) 50%,
        rgba(200, 134, 74, 0.08) 100%
    );
    background-size: 200% 100%;
    animation: ptx-hs-preview-loading 1s linear infinite;
}

@keyframes ptx-hs-loading-bar {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

@keyframes ptx-hs-preview-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

@media (hover: none), (pointer: coarse) {
    .ptx-hs-preview {
        display: none !important;
    }

    .ptx-hs-result__thumb {
        cursor: pointer;
    }
}
