.image-search-trigger:focus-visible,
.image-search-modal__close:focus-visible,
.image-search-modal__input:focus-visible + .image-search-modal__label,
.image-search-dropzone__input:focus-visible + .image-search-dropzone__label,
.image-search-camera-button:focus-visible,
.image-search-submit:focus-visible,
.image-search-change:focus-visible {
    outline: 3px solid rgba(178, 14, 59, .3);
    outline-offset: 3px;
}

.image-search-trigger {
    align-items: center;
    background: transparent;
    border: 0;
    bottom: -10px;
    color: #575757;
    cursor: pointer;
    display: flex;
    height: 44px;
    justify-content: center;
    padding: 10px;
    position: absolute;
    right: 25px;
    width: 44px;
    z-index: 3;
}

.image-search-trigger:hover {
    color: #b20e3b;
}

.image-search-trigger svg {
    fill: none;
    height: 22px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
    width: 22px;
}

.header .header-right__bottom .header__search input,
.header .header-right__bottom .header__search-mobile input {
    padding-right: 76px;
}

.header .header-right__bottom .header__search-mobile .image-search-trigger {
    bottom: auto;
    right: 24px;
    top: -12px;
}

.image-search-discovery[hidden] {
    display: none;
}

.image-search-discovery {
    background: #fff8fa;
    border: 1px solid #f0cbd4;
    border-left: 4px solid #dc052b;
    border-radius: 12px;
    box-shadow: 0 14px 38px rgba(35, 31, 32, .18);
    color: #231f20;
    opacity: 0;
    position: fixed;
    transform: translateY(-8px);
    transition: opacity .2s ease, transform .2s ease;
    width: min(292px, calc(100vw - 24px));
    z-index: 10001;
}

.image-search-discovery::before {
    background: #fff8fa;
    border-left: 1px solid #f0cbd4;
    border-top: 1px solid #f0cbd4;
    content: '';
    height: 14px;
    position: absolute;
    right: 16px;
    top: -7px;
    transform: rotate(45deg);
    width: 14px;
}

.image-search-discovery.is-above::before {
    border-bottom: 1px solid #f0cbd4;
    border-left: 0;
    border-right: 1px solid #f0cbd4;
    border-top: 0;
    bottom: -7px;
    top: auto;
}

.image-search-discovery.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.image-search-discovery__action {
    background: transparent;
    border: 0;
    color: inherit;
    cursor: pointer;
    display: block;
    padding: 16px 48px 16px 16px;
    text-align: left;
    transition: background-color .18s ease;
    width: 100%;
}

.image-search-discovery__action:hover {
    background: rgba(220, 5, 43, .04);
}

.image-search-discovery__action strong,
.image-search-discovery__action > span:last-child {
    display: block;
}

.image-search-discovery__action strong {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    margin: 6px 0 3px;
}

.image-search-discovery__action > span:last-child {
    color: #686868;
    font-size: 13px;
    line-height: 1.45;
}

.image-search-discovery__badge {
    color: #fff;
    background: #dc052b;
    border-radius: 20px;
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .08em;
    line-height: 1;
    padding: 5px 8px 4px;
    text-transform: uppercase;
}

.image-search-discovery__close {
    align-items: center;
    background: transparent;
    border: 0;
    color: #686868;
    cursor: pointer;
    display: flex;
    height: 44px;
    justify-content: center;
    padding: 0;
    position: absolute;
    right: 0;
    top: 0;
    width: 44px;
}

.image-search-discovery__close:hover {
    color: #dc052b;
}

.image-search-discovery__close svg {
    fill: none;
    height: 18px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-width: 1.8;
    width: 18px;
}

.image-search-discovery__action:focus-visible,
.image-search-discovery__close:focus-visible {
    outline: 3px solid rgba(220, 5, 43, .35);
    outline-offset: -3px;
}

body.image-search-modal-open {
    overflow: hidden;
}

.image-search-modal[hidden],
.image-search-modal__loading[hidden] {
    display: none;
}

.image-search-modal {
    align-items: flex-start;
    display: flex;
    inset: 0;
    justify-content: center;
    opacity: 0;
    overflow-y: auto;
    padding: clamp(76px, 11vh, 130px) 16px 32px;
    position: fixed;
    transition: opacity .18s ease;
    z-index: 10002;
}

.image-search-modal.is-open {
    opacity: 1;
}

.image-search-modal__backdrop {
    background: rgba(20, 18, 19, .56);
    inset: 0;
    position: fixed;
}

.image-search-modal__panel {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 22px 65px rgba(0, 0, 0, .24);
    max-width: 500px;
    opacity: 0;
    padding: 30px;
    position: relative;
    transform: translateY(-10px) scale(.98);
    transition: opacity .18s ease, transform .22s ease;
    width: 100%;
    z-index: 1;
}

.image-search-modal.is-open .image-search-modal__panel {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.image-search-modal__panel h2 {
    color: #242424;
    font-size: 24px;
    font-weight: 600;
    line-height: 1.25;
    margin: 4px 42px 8px;
    text-align: center;
}

.image-search-modal__intro {
    color: #686868;
    font-size: 14px;
    line-height: 1.5;
    margin: 0 auto 22px;
    max-width: 380px;
    text-align: center;
}

.image-search-modal__close {
    align-items: center;
    background: transparent;
    border: 0;
    color: #666;
    cursor: pointer;
    display: flex;
    height: 44px;
    justify-content: center;
    padding: 10px;
    position: absolute;
    right: 9px;
    top: 9px;
    width: 44px;
}

.image-search-modal__close:hover {
    color: #b20e3b;
}

.image-search-modal__close svg {
    fill: none;
    height: 22px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-width: 1.8;
    width: 22px;
}

.image-search-modal__dropzone {
    border: 2px dashed #c9c4c6;
    border-radius: 10px;
    min-height: 230px;
    position: relative;
    transition: background-color .2s ease, border-color .2s ease;
}

.image-search-modal__dropzone.is-dragover {
    background: #fff5f7;
    border-color: #b20e3b;
}

.image-search-modal__dropzone.has-error {
    border-color: #b20e3b;
}

.image-search-modal__input {
    height: 1px;
    left: 50%;
    opacity: 0;
    position: absolute;
    top: 50%;
    width: 1px;
}

.image-search-modal__label {
    align-items: center;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    inset: 0;
    justify-content: center;
    padding: 28px;
    position: absolute;
    text-align: center;
}

.image-search-modal__camera {
    align-items: center;
    background: #f7e7eb;
    border-radius: 50%;
    color: #b20e3b;
    display: flex;
    height: 60px;
    justify-content: center;
    margin-bottom: 16px;
    width: 60px;
}

.image-search-modal__camera svg {
    fill: none;
    height: 29px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
    width: 29px;
}

.image-search-modal__action {
    color: #4a4a4a;
    font-size: 15px;
    line-height: 1.55;
}

.image-search-modal__action u {
    color: #b20e3b;
    font-weight: 600;
    text-underline-offset: 3px;
}

.image-search-modal__loading {
    align-items: center;
    background: #fff;
    color: #333;
    display: flex;
    flex-direction: column;
    font-size: 15px;
    gap: 15px;
    inset: 0;
    justify-content: center;
    position: absolute;
    z-index: 2;
}

.image-search-modal__spinner {
    animation: image-search-spin .7s linear infinite;
    border: 3px solid #ead9de;
    border-radius: 50%;
    border-top-color: #b20e3b;
    height: 34px;
    width: 34px;
}

.image-search-modal__help,
.image-search-modal__error {
    font-size: 13px;
    line-height: 1.45;
    text-align: center;
}

.image-search-modal__help {
    color: #747474;
    margin: 12px 0 0;
}

.image-search-modal__error {
    color: #a10d34;
    margin: 7px 0 0;
    min-height: 19px;
}

.image-search-camera-button {
    align-items: center;
    background: #fff;
    border: 1px solid #b20e3b;
    border-radius: 7px;
    color: #b20e3b;
    cursor: pointer;
    display: none;
    font-size: 15px;
    font-weight: 650;
    gap: 9px;
    justify-content: center;
    margin-top: 12px;
    min-height: 48px;
    padding: 10px 18px;
    touch-action: manipulation;
    transition: background-color .2s ease, color .2s ease;
    width: 100%;
}

.image-search-camera-button:hover {
    background: #fff5f7;
}

.image-search-camera-button:disabled {
    cursor: wait;
    opacity: .55;
}

.image-search-camera-button svg {
    fill: none;
    height: 22px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
    width: 22px;
}

.image-search-page {
    padding: 26px 0 80px;
}

.image-search-hero {
    align-items: stretch;
    background: #f7f4f1;
    border-radius: 16px;
    display: grid;
    gap: 52px;
    grid-template-columns: minmax(0, 1fr) minmax(340px, 520px);
    margin-top: 22px;
    padding: clamp(28px, 4vw, 60px);
}

.image-search-hero__copy {
    align-self: center;
    max-width: 650px;
}

.image-search-hero__eyebrow {
    color: #b20e3b;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .08em;
    margin: 0 0 14px;
    text-transform: uppercase;
}

.image-search-hero h1 {
    color: #202020;
    font-size: clamp(30px, 3.5vw, 52px);
    font-weight: 600;
    line-height: 1.08;
    margin: 0 0 20px;
}

.image-search-hero__description {
    color: #5f5f5f;
    font-size: 16px;
    line-height: 1.65;
    margin: 0;
}

.image-search-form {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 14px 42px rgba(27, 19, 21, .09);
    padding: 22px;
}

.image-search-dropzone {
    border: 2px dashed #b9b3b5;
    border-radius: 10px;
    min-height: 280px;
    overflow: hidden;
    position: relative;
    transition: border-color .2s ease, background-color .2s ease;
}

.image-search-dropzone.is-dragover {
    background: #fff5f7;
    border-color: #b20e3b;
}

.image-search-dropzone.has-error {
    border-color: #b20e3b;
}

.image-search-dropzone__input {
    height: 1px;
    left: 50%;
    opacity: 0;
    position: absolute;
    top: 50%;
    width: 1px;
}

.image-search-dropzone__label {
    align-items: center;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    inset: 0;
    justify-content: center;
    padding: 34px 22px;
    position: absolute;
    text-align: center;
}

.image-search-dropzone__icon {
    align-items: center;
    background: #f7e7eb;
    border-radius: 50%;
    color: #b20e3b;
    display: flex;
    height: 68px;
    justify-content: center;
    margin-bottom: 18px;
    width: 68px;
}

.image-search-dropzone__icon svg {
    fill: none;
    height: 32px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
    width: 32px;
}

.image-search-dropzone__title {
    color: #242424;
    font-size: 17px;
    font-weight: 650;
}

.image-search-dropzone__hint {
    color: #777;
    font-size: 14px;
    margin-top: 6px;
}

.image-search-preview {
    height: 100%;
    inset: 0;
    object-fit: contain;
    padding: 14px;
    position: absolute;
    width: 100%;
}

.image-search-change {
    background: rgba(255, 255, 255, .94);
    border: 1px solid #ddd;
    border-radius: 22px;
    bottom: 14px;
    color: #333;
    cursor: pointer;
    min-height: 44px;
    padding: 8px 17px;
    position: absolute;
    right: 14px;
}

.image-search-form__help,
.image-search-form__error {
    font-size: 13px;
    line-height: 1.45;
    margin: 10px 0 0;
}

.image-search-form__help {
    color: #707070;
}

.image-search-form__error {
    color: #a10d34;
    min-height: 19px;
}

.image-search-submit {
    align-items: center;
    background: #b20e3b;
    border: 0;
    border-radius: 7px;
    color: #fff;
    cursor: pointer;
    display: flex;
    font-size: 15px;
    font-weight: 650;
    justify-content: center;
    margin-top: 14px;
    min-height: 50px;
    padding: 12px 22px;
    transition: background-color .2s ease;
    width: 100%;
}

.image-search-submit:hover {
    background: #84102f;
}

.image-search-submit:disabled {
    cursor: wait;
    opacity: .75;
}

.image-search-submit__spinner {
    animation: image-search-spin .7s linear infinite;
    border: 2px solid rgba(255, 255, 255, .45);
    border-radius: 50%;
    border-top-color: #fff;
    display: none;
    height: 18px;
    margin-left: 10px;
    width: 18px;
}

.image-search-submit.is-loading .image-search-submit__spinner {
    display: inline-block;
}

.image-search-results {
    margin-top: 54px;
}

.image-search-query-preview {
    align-items: center;
    background: #fff;
    border: 1px solid #e8e1dc;
    border-radius: 12px;
    display: flex;
    gap: 18px;
    margin: 24px 0 0;
    max-width: 430px;
    padding: 14px;
}

.image-search-query-preview img {
    background: #fff;
    border-radius: 9px;
    flex: 0 0 112px;
    height: 112px;
    object-fit: contain;
    width: 112px;
}

.image-search-query-preview figcaption {
    min-width: 0;
}

.image-search-query-preview figcaption span {
    color: #777;
    display: block;
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 4px;
}

.image-search-query-preview figcaption strong {
    color: #242424;
    display: block;
    font-size: 17px;
    line-height: 1.4;
}

.image-search-results__heading {
    align-items: baseline;
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.image-search-results__heading h2 {
    font-size: clamp(26px, 3vw, 38px);
    margin: 0;
}

.image-search-results__heading span {
    color: #777;
    font-size: 16px;
}

.image-search-results .product-card-container {
    display: grid;
    gap: 28px 18px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.image-search-results .product-item {
    min-width: 0;
    width: 100%;
}

.image-search-empty {
    background: #f7f4f1;
    border-radius: 12px;
    padding: 34px;
    text-align: center;
}

.image-search-empty h3 {
    font-size: 22px;
    margin: 0 0 9px;
}

.image-search-empty p {
    color: #666;
    margin: 0;
}

@keyframes image-search-spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 1200px) {
    .image-search-results .product-card-container { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .image-search-hero { gap: 28px; grid-template-columns: 1fr; }
    .image-search-results .product-card-container { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (hover: none) and (pointer: coarse) {
    .image-search-camera-button { display: flex; }
}

@media (max-width: 650px) {
    .image-search-camera-button { display: flex; }
    .image-search-modal { align-items: flex-end; padding: 16px 10px; }
    .image-search-modal__panel { border-radius: 14px 14px 10px 10px; padding: 24px 16px 20px; }
    .image-search-modal__panel h2 { font-size: 21px; margin-top: 2px; }
    .image-search-modal__intro { margin-bottom: 18px; padding: 0 20px; }
    .image-search-modal__dropzone { min-height: 210px; }
    .image-search-page { padding: 12px 0 50px; }
    .image-search-hero { border-radius: 10px; margin-top: 12px; padding: 22px 16px; }
    .image-search-form { padding: 14px; }
    .image-search-dropzone { min-height: 230px; }
    .image-search-results { margin-top: 38px; }
    .image-search-query-preview { gap: 14px; margin-top: 18px; padding: 12px; }
    .image-search-query-preview img { flex-basis: 88px; height: 88px; width: 88px; }
    .image-search-query-preview figcaption strong { font-size: 15px; }
    .image-search-results .product-card-container { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .image-search-discovery__action { padding: 14px 46px 14px 14px; }
    .image-search-discovery__action strong { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
    .image-search-modal,
    .image-search-modal__panel,
    .image-search-dropzone,
    .image-search-submit,
    .image-search-discovery,
    .image-search-discovery__action { transition: none; }
}
