/* =========================================================
   SEARCH PANEL — CROKI PREMIUM / FASHION E-COMMERCE
========================================================= */

.croki-search {
    --croki-ink: #111;
    --croki-line: #e6e6e6;
    --croki-muted: #999;
    --croki-placeholder: #f5f5f5;
    --croki-accent: #111;
    --croki-gap: 8px;
    --croki-radius: 4px;

    position: fixed;
    inset: 0;
    z-index: 10000;

    visibility: hidden;
    pointer-events: none;
    transition: visibility 0s linear .3s;

    font-family: "Inter", sans-serif;
    font-size: 13px;
    font-weight: 400;
    color: var(--croki-ink);
}

.croki-search.is-open {
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
}

html.croki-search-lock {
    overflow: hidden;
}

.croki-search [hidden] {
    display: none !important;
}

.croki-search *,
.croki-search *::before,
.croki-search *::after {
    box-sizing: border-box;
}


/* =========================================================
   SEARCH ICON
========================================================= */

.croki-search-open {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 22px;
    height: 22px;
    padding: 0;
    margin: 0;

    border: 0;
    border-radius: 0;
    background: transparent;

    color: inherit;
    line-height: 0;
    cursor: pointer;
}

.croki-search-open svg {
    display: block;
    width: 22px;
    height: 22px;
}


/* =========================================================
   BACKDROP & PANEL
========================================================= */

.croki-search__backdrop {
    position: absolute;
    inset: 0;

    background: rgba(0, 0, 0, .42);
    opacity: 0;

    transition: opacity .3s ease;
}

.croki-search.is-open .croki-search__backdrop {
    opacity: 1;
}

.croki-search__panel {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;

    max-height: 100%;
    overflow-y: auto;
    overscroll-behavior: contain;

    background: #fff;

    transform: translateY(-100%);
    transition: transform .3s ease;
}

.croki-search.is-open .croki-search__panel {
    transform: translateY(0);
}

.croki-search__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 56px;
    align-items: start;

    width: 100%;
    max-width: 1660px;
    min-height: 120px;

    margin: 0 auto;
    padding: 20px 20px 36px;
}

.croki-search__main {
    min-width: 0;
}

.croki-search__side {
    min-width: 0;
}


/* =========================================================
   SEARCH ROW
========================================================= */

.croki-search__row {
    display: flex;
    align-items: center;
    gap: 20px;
}

.croki-search__form {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
}

.croki-search__input {
    display: block;

    width: 100%;
    height: 44px;
    padding: 0 44px;

    border: 1px solid #dedede;
    border-radius: var(--croki-radius);
    outline: none;

    background: #fff;

    font-family: "Inter", sans-serif;
    font-size: 13px;
    font-weight: 400;
    color: #111;

    transition: border-color .2s ease;
    -webkit-appearance: none;
    appearance: none;
}

.croki-search__input::placeholder {
    color: #999;
    opacity: 1;
}

.croki-search__input:focus {
    border-color: #111;
}

.croki-search__submit,
.croki-search__clear {
    position: absolute;
    top: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 44px;
    height: 44px;
    padding: 0;

    border: 0;
    border-radius: 0;
    background: transparent;

    color: #111;
    cursor: pointer;
}

.croki-search__submit {
    left: 0;
}

.croki-search__clear {
    right: 0;
}

.croki-search__submit svg,
.croki-search__clear svg {
    display: block;
    width: 18px;
    height: 18px;
}

.croki-search__close {
    flex: 0 0 auto;

    padding: 0;
    border: 0;
    background: transparent;

    font-family: "Inter", sans-serif;
    font-size: 12px;
    font-weight: 400;
    color: #111;

    cursor: pointer;
    transition: opacity .2s ease;
}

.croki-search__close:hover {
    opacity: .55;
}


/* =========================================================
   SEARCH RESULTS
========================================================= */

.croki-search__results {
    min-width: 0;
}

/* Override Bitrix JCTitleSearch inline positioning */

.croki-search__results .title-search-result {
    position: static !important;
    top: auto !important;
    left: auto !important;

    width: auto !important;

    padding: 0;
    border: 0;
    border-radius: 0;

    background: transparent;
    box-shadow: none;
    overflow: visible;
    z-index: auto;
}

.croki-search__title {
    margin: 0 0 20px;

    font-family: "Inter", sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.4;
    letter-spacing: .01em;

    color: #111;
}


/* =========================================================
   VIEW ALL BUTTON
========================================================= */

.croki-search__all {
    display: block;

    margin: 28px auto 16px;
    padding: 12px 22px;

    border: 1px solid #dedede;
    border-radius: var(--croki-radius);

    background: #fff;

    font-family: "Inter", sans-serif;
    font-size: 12px;
    font-weight: 400;
    color: #111;

    cursor: pointer;

    transition:
        border-color .2s ease,
        background .2s ease;
}

.croki-search__all:hover {
    border-color: #111;
    background: #f8f8f8;
}


/* =========================================================
   PRODUCT SLIDER
========================================================= */

.croki-slider {
    position: relative;
    min-width: 0;
}

.croki-slider__viewport {
    overflow-x: auto;
    overflow-y: hidden;

    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
}

.croki-slider__viewport::-webkit-scrollbar {
    display: none;
}

.croki-slider__track {
    display: flex;
    flex-wrap: nowrap;
    gap: var(--croki-gap);
}

.croki-slider__item {
    flex: 0 0 calc((100% - 3 * var(--croki-gap)) / 4);
    min-width: 0;

    scroll-snap-align: start;
}

.croki-slider__link {
    display: block;

    color: inherit;
    text-decoration: none;
}


/* =========================================================
   PRODUCT IMAGE
========================================================= */

.croki-slider__image {
    position: relative;

    width: 100%;
    padding-bottom: 150%;

    overflow: hidden;

    margin-bottom: 8px;

    background: #f5f5f5;
    border-radius: 4px;
}

.croki-slider__image img {
    position: absolute;
    inset: 0;

    display: block;
    width: 100%;
    height: 100%;

    object-fit: cover;

    transform: scale(1.01);
    transition: transform .7s ease;
}

@media (hover: hover) {
    .croki-slider__link:hover .croki-slider__image img {
        transform: scale(1.04);
    }
}


/* =========================================================
   PRODUCT TITLE
========================================================= */

.croki-slider__name {
    margin-top: 0;

    font-family: "Inter", sans-serif;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
    letter-spacing: .01em;

    color: #111;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.croki-slider__name--wrap {
    margin: 0;
    white-space: normal;
}

.croki-slider__link:hover .croki-slider__name {
    opacity: .65;
}


/* =========================================================
   PRODUCT PRICE
========================================================= */

.croki-slider__price {
    margin-top: 3px;

    font-family: "Inter", sans-serif;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;

    color: #111;
}

.croki-slider__old-price {
    margin-left: 6px;

    font-size: 11px;
    font-weight: 400;
    color: #999;

    text-decoration: line-through;
}


/* =========================================================
   SIMPLE RESULT CARDS
========================================================= */

.croki-slider__item--simple .croki-slider__link {
    display: block;

    min-height: 56px;
    padding: 14px;

    border: 1px solid #e6e6e6;
    border-radius: 4px;

    background: transparent;

    transition:
        border-color .2s ease,
        background .2s ease;
}

.croki-slider__item--simple .croki-slider__link:hover {
    border-color: #111;
    background: #fafafa;
}


/* =========================================================
   SLIDER ARROWS
========================================================= */

.croki-slider__arrow {
    position: absolute;
    top: 40%;
    z-index: 2;

    display: none;
    align-items: center;
    justify-content: center;

    width: 34px;
    height: 34px;
    margin-top: -17px;
    padding: 0;

    border: 1px solid #e6e6e6;
    border-radius: 50%;

    background: #fff;
    color: #111;

    cursor: pointer;

    transition:
        border-color .2s ease,
        opacity .2s ease;
}

.croki-slider__arrow:hover {
    border-color: #111;
}

.croki-slider.is-scrollable .croki-slider__arrow {
    display: flex;
}

.croki-slider__arrow--prev {
    left: 8px;
}

.croki-slider__arrow--next {
    right: 8px;
}

.croki-slider__arrow:disabled {
    opacity: 0;
    pointer-events: none;
}

@media (hover: none) {
    .croki-slider.is-scrollable .croki-slider__arrow {
        display: none;
    }
}


/* =========================================================
   CATEGORIES
========================================================= */

.croki-search__categories {
    margin-top: 20px;

    font-family: "Inter", sans-serif;
    color: #111;
}


/* Category chips container */

.croki-search__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;

    padding-bottom: 20px;
    border-bottom: 1px solid #e6e6e6;
}


/* Individual category */

.croki-search__chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 32px;
    padding: 7px 12px;

    border: 1px solid #dedede;
    border-radius: 4px;

    background: transparent;

    font-family: "Inter", sans-serif;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.3;
    color: #111;
    text-align: center;
    text-decoration: none;

    transition:
        border-color .2s ease,
        background .2s ease,
        color .2s ease;
}

.croki-search__chip:hover {
    border-color: #111;
    background: #f7f7f7;
    color: #111;
}


/* =========================================================
   POPULAR SEARCHES
========================================================= */

.croki-search__popular {
    padding-top: 22px;
    border-bottom: 1px solid #e6e6e6;
}

.croki-search__popular-title {
    margin: 0 0 12px;

    font-family: "Inter", sans-serif;
    font-size: 10px;
    font-weight: 400;
    line-height: 1.5;

    letter-spacing: .12em;
    text-transform: uppercase;

    color: #999;
}


/* Individual popular search */

.croki-search__popular-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    min-height: 44px;
    padding: 8px 0;

    font-family: "Inter", sans-serif;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.4;

    color: #111;
    text-decoration: none;

    transition: color .2s ease;
}

.croki-search__popular-item svg {
    display: block;
    flex-shrink: 0;

    width: 16px;
    height: 16px;

    color: #999;

    transition:
        color .2s ease,
        transform .2s ease;
}

.croki-search__popular-item:hover {
    color: #777;
}

.croki-search__popular-item:hover svg {
    color: #111;
    transform: translateX(3px);
}


/* =========================================================
   RESPONSIVE — TABLET
========================================================= */

@media (max-width: 1399px) {
    .croki-search__inner {
        grid-template-columns: minmax(0, 1fr) 320px;
        gap: 36px;
    }
}

@media (max-width: 1199px) {
    .croki-search__inner {
        gap: 28px;
    }

    .croki-slider__item {
        flex-basis: calc((100% - 2 * var(--croki-gap)) / 3);
    }
}


/* =========================================================
   RESPONSIVE — SMALL TABLET
========================================================= */

@media (max-width: 991px) {
    .croki-search__inner {
        grid-template-columns: minmax(0, 1fr);
        gap: 28px;

        padding: 20px 16px 32px;
    }

    .croki-search__side {
        order: -1;
    }

    .croki-search__categories {
        margin-top: 8px;
    }

    .croki-search__chips {
        padding-bottom: 16px;
    }

    .croki-search__popular {
        padding-top: 16px;
    }
}


/* =========================================================
   RESPONSIVE — MOBILE
========================================================= */

@media (max-width: 767px) {
    .croki-search__inner {
        gap: 24px;
        padding: 14px 12px 28px;
    }

    .croki-search__row {
        gap: 12px;
    }

    .croki-search__input {
        height: 42px;
        padding-right: 38px;
        padding-left: 38px;

        font-size: 13px;
    }

    .croki-search__submit,
    .croki-search__clear {
        width: 38px;
        height: 42px;
    }

    .croki-search__title {
        margin-bottom: 14px;
        font-size: 14px;
    }

    .croki-slider__item {
        flex-basis: 42%;
    }

    .croki-slider__image {
        padding-bottom: 150%;
    }

    .croki-slider__name {
        font-size: 11px;
    }

    .croki-slider__price {
        font-size: 11px;
    }

    .croki-search__chips {
        gap: 6px;
    }

    .croki-search__chip {
        min-height: 30px;
        padding: 6px 10px;
        font-size: 11px;
    }

    .croki-search__popular-item {
        min-height: 40px;
        font-size: 12px;
    }
}


/* =========================================================
   RESPONSIVE — SMALL MOBILE
========================================================= */

@media (max-width: 575px) {
    .croki-search__inner {
        padding-right: 10px;
        padding-left: 10px;
    }

    .croki-search__row {
        gap: 10px;
    }

    .croki-search__close {
        font-size: 11px;
    }

    .croki-slider__item {
        flex-basis: 46%;
    }

    .croki-search__all {
        margin-top: 22px;
        padding: 11px 18px;
    }
}


/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {
    .croki-search *,
    .croki-search *::before,
    .croki-search *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
