/* home */

.home-page {
    position: relative;
    padding-top: 14rem;
    background: linear-gradient(180deg, #f8e7db 0%, #f4dcca 48%, #f7e6da 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 4rem;
    overflow: hidden;
}

.home-page::before,
.home-page::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    filter: blur(40px);
    opacity: 0.45;
    pointer-events: none;
}

.home-page::before {
    width: 42rem;
    height: 42rem;
    top: -16rem;
    right: -12rem;
    background: #f1cfba;
}

.home-page::after {
    width: 34rem;
    height: 34rem;
    bottom: 8rem;
    left: -10rem;
    background: #edc8b5;
}

.home-page__section {
    position: relative;
    z-index: 1;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
}

.home-page__section:first-of-type {
    z-index: 20;
}

.home-page__intro {
    text-align: center;
    max-width: 78rem;
    margin-bottom: 1.2rem;
    animation: fadeUp 0.7s ease forwards;
}

.home-page__title {
    margin: 0;
    font-size: clamp(3.2rem, 5vw, 5rem);
    line-height: 1.1;
    color: #1a1f26;
    letter-spacing: -0.02em;
}

.home-page__description {
    margin: 1.2rem 0 0;
    font-size: 1.8rem;
    color: #4e5661;
    line-height: 1.5;
    animation: fadeUp 0.9s ease forwards;
}
#search-container {
    position: relative;
    z-index: 300;
    --search-width: min(56rem, 92vw);
    width: var(--search-width);
    animation: fadeUp 1s ease forwards;
}
.search-input {
    width: var(--search-width);
    box-sizing: border-box;
    border-radius: 999px;
    border: 1px solid #d4dae3;
    background: #fff;
    padding: 1.1rem 1.6rem 1.1rem 4.2rem;
    box-shadow: 0 10px 22px rgba(24, 31, 44, 0.1);
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background-color 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: #b5c0d1;
    box-shadow: 0 14px 26px rgba(24, 31, 44, 0.16);
    background: #fff;
}

.home-page__search-icon {
    position: absolute;
    left: 1.6rem;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
    font-size: 1.7rem;
    pointer-events: none;
}
.search-box {
    background: #ffffff;
    border: 1px solid #dde3eb;
    border-radius: 1.4rem;
    width: var(--search-width);
    box-sizing: border-box;
    height: 300px;
    position: absolute;
    top: calc(100% + 1.2rem);
    left: 0;
    transform: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem;
    text-align: left;
    box-shadow: 0 18px 36px rgba(24, 31, 44, 0.18);
    z-index: 320;
    scrollbar-width: thin;
    scrollbar-color: #b8c0cc transparent;
    animation: fadeIn 0.22s ease;
}

.search-box::-webkit-scrollbar {
    width: 4px;
}

.search-box::-webkit-scrollbar-track {
    background: transparent;
}

.search-box::-webkit-scrollbar-thumb {
    background-color: #b8b8b8;
    border-radius: 999px;
}

.search-box::-webkit-scrollbar-thumb:hover {
    background-color: #9f9f9f;
}

@media (max-width: 40em) {
    .search-box {
        width: var(--search-width);
    }
}

.search-box--item {
    background: #fbfcfd;
    border: 1px solid #e7ebf0;
    border-radius: 1rem;
    padding: 1rem 1.3rem;
    user-select: none;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition:
        background-color 0.18s ease,
        border-color 0.18s ease,
        transform 0.18s ease;
}

.search-box--item:hover {
    background: #f1f4f8;
    border-color: #d2d9e3;
    color: #1e1e1e;
    transform: translateY(-1px);
}

.search-box--item:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.home-page__category-grid {
    padding: 3rem 0 5rem;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    animation: fadeUp 1.1s ease forwards;
}

.home-page__search-criteria-buttons {
    background-color: white;
    border-radius: 10px;
    padding: 1rem;
}

.home-page__category-box {
    background-color: white;
    border: 1px solid #dfe4eb;
    border-radius: 1.4rem;
    box-shadow: 0 8px 18px rgba(26, 33, 44, 0.1);
    position: relative;
    overflow: hidden;
    height: 20rem;
    width: 20rem;
    display: flex;
    align-items: end;
    justify-content: center;
    text-transform: uppercase;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease;
    animation: fadeUp 0.7s ease forwards;
    opacity: 0;
    cursor: pointer;
}

@media (max-width: 70em) {
    .home-page__category-grid {
        grid-template-columns: 1fr 1fr;
        width: 80vw;
    }
    .home-page__category-box {
        width: auto;
        height: 20em;
    }
}

.home-page__category-box:hover {
    transform: translateY(-3px);
    border-color: #cfd7e1;
    box-shadow: 0 14px 26px rgba(26, 33, 44, 0.16);
}
.home-page__category-box:active {
    transform: translateY(0);
}

.home-page__category-text {
    color: white;
    font-weight: bold;
    user-select: none;
    z-index: 1;
    font-size: 1.8rem;
    background: linear-gradient(
        180deg,
        rgba(13, 18, 26, 0.6) 0%,
        rgba(13, 18, 26, 0.88) 100%
    );
    width: 100%;
    text-align: center;
    padding: 1rem;
}

@media (max-width: 70em) {
    .home-page__category-text {
        font-size: 2.3rem;
    }
}

.home-page__category-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    inset: 0;
    z-index: 0;
}

#category-modal__list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.category-modal__list-item {
    border: 1px solid black;
    padding: 20px;
    font-weight: bold;
    text-transform: uppercase;
}

.category-modal__list-item:hover {
    background: gray;
    color: white;
}

.home-page__category-grid .home-page__category-box:nth-child(1) {
    animation-delay: 0.03s;
}
.home-page__category-grid .home-page__category-box:nth-child(2) {
    animation-delay: 0.06s;
}
.home-page__category-grid .home-page__category-box:nth-child(3) {
    animation-delay: 0.09s;
}
.home-page__category-grid .home-page__category-box:nth-child(4) {
    animation-delay: 0.12s;
}
.home-page__category-grid .home-page__category-box:nth-child(5) {
    animation-delay: 0.15s;
}
.home-page__category-grid .home-page__category-box:nth-child(6) {
    animation-delay: 0.18s;
}
.home-page__category-grid .home-page__category-box:nth-child(7) {
    animation-delay: 0.21s;
}
.home-page__category-grid .home-page__category-box:nth-child(8) {
    animation-delay: 0.24s;
}
.home-page__category-grid .home-page__category-box:nth-child(9) {
    animation-delay: 0.27s;
}
.home-page__category-grid .home-page__category-box:nth-child(10) {
    animation-delay: 0.3s;
}
.home-page__category-grid .home-page__category-box:nth-child(11) {
    animation-delay: 0.33s;
}
.home-page__category-grid .home-page__category-box:nth-child(12) {
    animation-delay: 0.36s;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-page__intro,
    .home-page__description,
    #search-container,
    .home-page__category-grid,
    .home-page__category-box,
    .search-box {
        animation: none;
    }
}
