.pgino-bottom-sheet {
    position: fixed;
    inset: 0;
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    margin: 0;
    padding: var(--space-3) 0 0;
    border: 0;
    background: transparent;
    color: var(--color-text-primary);
    font-family: var(--font-family-base);
    direction: rtl;
    overflow: hidden;
    overscroll-behavior: contain;
}

.pgino-bottom-sheet:not([open]) {
    display: none;
}

.pgino-bottom-sheet[open] {
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.pgino-bottom-sheet::backdrop {
    background: var(--overlay-dark);
    animation: pgino-bottom-sheet-backdrop-in var(--duration-normal) var(--ease-standard);
}

.pgino-bottom-sheet-surface {
    width: 100%;
    max-height: min(92dvh, calc(100dvh - var(--space-3)));
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--color-border-light);
    border-bottom: 0;
    border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
    background: var(--color-bg-surface);
    box-shadow: var(--shadow-lg);
    text-align: right;
    animation: pgino-bottom-sheet-surface-in var(--duration-normal) var(--ease-standard);
}

.pgino-bottom-sheet-header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-4);
    border-bottom: 1px solid var(--color-border-light);
    background: var(--color-bg-surface);
}

.pgino-bottom-sheet-header h2 {
    min-width: 0;
    margin: 0;
    color: var(--color-text-primary);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.pgino-bottom-sheet-close {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: var(--radius-pill);
    background: var(--color-bg-muted);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: background-color var(--duration-normal) var(--ease-standard), color var(--duration-normal) var(--ease-standard), transform var(--duration-normal) var(--ease-standard);
}

.pgino-bottom-sheet-close:hover {
    background: var(--color-primary-light);
    color: var(--color-primary);
}

.pgino-bottom-sheet-close:active {
    transform: scale(0.96);
}

.pgino-bottom-sheet-close:focus-visible {
    outline: 3px solid var(--color-primary-alpha-22);
    outline-offset: 2px;
}

.pgino-bottom-sheet-close .ti {
    font-size: 20px;
    line-height: 1;
}

.pgino-bottom-sheet-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: var(--space-4);
    padding-bottom: max(var(--space-4), var(--pgino-bottom-safe-gap, env(safe-area-inset-bottom, 0px)));
}

@media (min-width: 480px) {
    .pgino-bottom-sheet[open] {
        align-items: center;
        padding: var(--space-5);
    }

    .pgino-bottom-sheet-surface {
        width: min(100%, var(--app-max-width));
        max-height: calc(100dvh - (var(--space-5) * 2));
        border-bottom: 1px solid var(--color-border-light);
        border-radius: var(--radius-2xl);
    }
}

@keyframes pgino-bottom-sheet-backdrop-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes pgino-bottom-sheet-surface-in {
    from {
        opacity: 0;
        transform: translateY(var(--space-3));
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .pgino-bottom-sheet::backdrop,
    .pgino-bottom-sheet-surface {
        animation: none;
    }

    .pgino-bottom-sheet-close {
        transition: none;
    }
}
