﻿:root {
    --gm-header-offset: 72px;
}

.giftfinder-overlay-host {
    position: fixed;
    top: var(--gm-header-offset);
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 90;
    pointer-events: none;
}

.giftfinder-overlay-backdrop {
    position: absolute;
    inset: 0;
    border: none;
    background: rgba(20, 12, 10, 0);
    opacity: 0;
    transition: opacity 0.24s ease, background 0.24s ease;
    pointer-events: none;
}

.giftfinder-overlay-sheet {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: min(calc(92dvh - var(--gm-header-offset)), 920px);
    display: flex;
    flex-direction: column;
    background: #fffdf9;
    border-radius: 22px 22px 0 0;
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.18);
    transform: translateY(100%);
    transition: transform 0.28s ease;
    will-change: transform;
    pointer-events: auto;
    overflow: hidden;
}

.giftfinder-overlay-host.is-open {
    pointer-events: auto;
}

    .giftfinder-overlay-host.is-open .giftfinder-overlay-backdrop {
        opacity: 1;
        background: rgba(20, 12, 10, 0.38);
        pointer-events: auto;
    }

    .giftfinder-overlay-host.is-open .giftfinder-overlay-sheet {
        transform: translateY(0);
    }

.giftfinder-overlay-sheet__handle-wrap {
    display: flex;
    justify-content: center;
    padding: 8px 0 2px;
    flex: 0 0 auto;
}

.giftfinder-overlay-sheet__handle {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 6px 0;
    border: none;
    background: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

    .giftfinder-overlay-sheet__handle span {
        width: 44px;
        height: 5px;
        border-radius: 999px;
        background: #d9cdc0;
        display: block;
    }

.giftfinder-overlay-sheet__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 16px 12px;
    border-bottom: 1px solid #eee2d7;
    flex: 0 0 auto;
    background: #fffdf9;
}

.giftfinder-overlay-sheet__title {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #5a1f1f;
}

.giftfinder-overlay-sheet__close {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #eadfd4;
    border-radius: 999px;
    background: #f6efe6;
    color: #7a3a3a;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.giftfinder-overlay-sheet__content {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.giftfinder--overlay {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #fffdf9;
}

    .giftfinder--overlay .giftfinder-body {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        padding: 14px 16px 6px;
        -webkit-overflow-scrolling: touch;
    }

    .giftfinder--overlay .giftfinder-footer {
        position: sticky;
        bottom: 0;
        z-index: 5;
        padding: 12px 16px 16px;
        background: linear-gradient(to top, #fffdf9 72%, rgba(255, 253, 249, 0));
    }

@media (min-width: 768px) {
    .giftfinder-overlay-sheet {
        left: 50%;
        right: auto;
        width: min(720px, calc(100vw - 32px));
        transform: translateX(-50%) translateY(100%);
        border-radius: 24px 24px 0 0;
    }

    .giftfinder-overlay-host.is-open .giftfinder-overlay-sheet {
        transform: translateX(-50%) translateY(0);
    }
}

body.giftfinder-overlay-open {
    overflow: hidden;
    touch-action: none;
}
