/* Search page — Boozak shop shell (wishlist / compare patterns) */

.search {
    background-color: var(--bg-secondary);
    min-height: 100vh;
    min-height: 100dvh;
}

.search__main {
    width: var(--theme-main-width);
    margin-left: var(--theme-main-offset);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
}

@media (max-width: 767px) {
    .search__main {
        width: 100%;
        margin-left: 0;
    }
}

.search__content {
    padding: var(--shop-header-clearance, 5rem) var(--theme-main-padding-inline, 2.5rem) 2.5rem var(--theme-main-padding-inline-start, 2.5rem);
}

@media (max-width: 767px) {
    .search__content {
        padding: var(--shop-header-clearance, 5rem) 1rem 2rem;
    }
}

.search__body {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Toolbar + form */
.search__toolbar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.search__title {
    margin: 0;
    color: var(--fg-primary);
    font-family: var(--font-text);
    font-size: var(--text-2xl);
    font-weight: 500;
    line-height: 2rem;
    letter-spacing: 0.01em;
}

@media (max-width: 767px) {
    .search__title {
        font-size: var(--text-xl);
        line-height: 1.75rem;
    }
}

.search__form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
    width: 100%;
    max-width: 40rem;
}

.search__field {
    flex: 1 1 12rem;
    min-width: 0;
}

.search__field .account-input__control {
    padding-inline-start: 2.75rem;
}

.search__field-wrap {
    position: relative;
    display: block;
    width: 100%;
}

.search__field-icon {
    position: absolute;
    top: 50%;
    left: 0.75rem;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    color: var(--fg-tertiary);
    pointer-events: none;
    transform: translateY(-50%);
}

.search__field-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.search__submit {
    flex-shrink: 0;
}

.search__suggest {
    margin: 0;
    color: var(--fg-tertiary);
    font-family: var(--font-text);
    font-size: var(--text-sm);
    font-weight: 500;
    line-height: 1.25rem;
}

.search__suggest-btn {
    padding: 0;
    color: var(--fg-brand-primary);
    font: inherit;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
    background: transparent;
    border: none;
    cursor: pointer;
}

.search__suggest-btn:hover {
    color: var(--fg-brand-primary);
}

/* Results grid — reuse .category__card-product from product-card.css */
.search__products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
    gap: 1.25rem;
    justify-items: stretch;
}

.search__empty {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    padding-block: 2rem;
}

.search__load-more {
    align-self: center;
    margin-top: 0.5rem;
}

/* Loading placeholders */
.search__products .skeleton {
    width: 100%;
    height: 11.25rem;
    border-radius: 1.25rem 1.25rem 0 0;
    background: var(--bg-tertiary);
}

.search__products .skeleton-text {
    width: 70%;
    height: 0.75rem;
    margin: 0.5rem 0.75rem;
    border-radius: 0.25rem;
    background: var(--bg-tertiary);
}

.search__products .skeleton-text + .skeleton-text {
    width: 45%;
}

/* Enter motion — compositor-friendly only */
@media (prefers-reduced-motion: no-preference) {
    .search__products .category__card-product {
        animation: search-card-in 0.35s ease both;
    }

    .search__products .category__card-product:nth-child(1) { animation-delay: 0.02s; }
    .search__products .category__card-product:nth-child(2) { animation-delay: 0.04s; }
    .search__products .category__card-product:nth-child(3) { animation-delay: 0.06s; }
    .search__products .category__card-product:nth-child(4) { animation-delay: 0.08s; }
    .search__products .category__card-product:nth-child(5) { animation-delay: 0.1s; }
    .search__products .category__card-product:nth-child(6) { animation-delay: 0.12s; }
}

@keyframes search-card-in {
    from {
        opacity: 0;
        transform: translateY(0.5rem);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}
