/* Root is just a lightweight wrapper carrying data attributes — no visual
   styling of its own. The trigger button and modal move to their real
   locations via JS (see shop-similars-modal.js) and are styled below. */
.yaalini-shop-similars-root {
    display: contents;
}

.yaalini-shop-similars-trigger {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    border: 1px solid rgba(221, 221, 221, 0.7);
    border-radius: 16px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
    transition: background 0.15s ease, box-shadow 0.15s ease;
    margin-bottom: 12px;
}

/* Applied by JS only when the button is successfully relocated into the
   gallery container — turns it into an absolute-positioned overlay instead
   of a normal-flow element. Flush to top:0/right:0, matching the product
   label's flush top:0/left positioning exactly (no gap/padding from the
   image edge). Anchored via "right" rather than "left": the thumbnail
   column sits on the left side of .vertical-gallery, so "left" positioning
   lands over the thumbnails instead of the main image, while the image is
   flush to the container's right edge. */
.yaalini-shop-similars-trigger--overlay {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 5;
    margin-bottom: 0;
}

.yaalini-shop-similars-trigger:hover {
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.yaalini-shop-similars-trigger__icon {
    display: inline-flex;
    color: #555;
}

/* Modal — always moved to document.body by JS, so it's never nested inside
   the gallery anchor's isolated stacking context. z-index is set very high
   as insurance against any other high-z-index elements on the page
   (sale countdown timers, floating chat widgets, etc). */
.yaalini-shop-similars-modal__backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 999998;
}

.yaalini-shop-similars-modal__panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 8px;
    width: min(720px, 92vw);
    max-height: 85vh;
    overflow-y: auto;
    padding: 24px;
    z-index: 999999;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

.yaalini-shop-similars-modal__close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #666;
    padding: 4px;
}

.yaalini-shop-similars-modal__close:hover {
    color: #000;
}

.yaalini-shop-similars-modal__title {
    font-size: 20px;
    margin: 0 0 16px;
}

.yaalini-shop-similars-modal__loading,
.yaalini-shop-similars-modal__empty {
    padding: 40px 0;
    text-align: center;
    color: #777;
    font-size: 14px;
}

.yaalini-shop-similars-modal__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
}

.yaalini-shop-similars-modal__item {
    text-decoration: none;
    color: inherit;
    display: block;
}

.yaalini-shop-similars-modal__item-image-wrap {
    display: block;
    width: 100%;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: #f5f5f5;
    border-radius: 4px;
}

.yaalini-shop-similars-modal__item-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.yaalini-shop-similars-modal__item-name {
    display: block;
    margin-top: 8px;
    font-size: 13px;
    line-height: 1.3;
}

body.yaalini-shop-similars-open {
    overflow: hidden;
}

@media (max-width: 768px) {
    .yaalini-shop-similars-trigger {
        padding: 3px 7px;
        font-size: 9px;
        gap: 3px;
        border-radius: 12px;
    }

    .yaalini-shop-similars-trigger__icon svg {
        width: 10px;
        height: 10px;
    }

    .yaalini-shop-similars-modal__panel {
        padding: 16px;
        width: 96vw;
    }

    .yaalini-shop-similars-modal__grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 10px;
    }
}

/* Text-to-image search — "You might also like" section on the search
   results page. Same grid/item visual pattern as the Shop Similars modal
   for consistency, since it's the same underlying matching mechanism. */
.yaalini-textsearch-root {
    margin: 32px 0;
}

.yaalini-textsearch__title {
    font-size: 20px;
    margin: 0 0 16px;
}

.yaalini-textsearch__loading {
    padding: 20px 0;
    color: #777;
    font-size: 14px;
}

.yaalini-textsearch__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
}

.yaalini-textsearch__item {
    text-decoration: none;
    color: inherit;
    display: block;
}

.yaalini-textsearch__item-image-wrap {
    display: block;
    width: 100%;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: #f5f5f5;
    border-radius: 4px;
}

.yaalini-textsearch__item-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.yaalini-textsearch__item-name {
    display: block;
    margin-top: 8px;
    font-size: 13px;
    line-height: 1.3;
}

@media (max-width: 768px) {
    .yaalini-textsearch__grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 10px;
    }
}
