/* doc-project | public/assets/css/postal-keypad.css | place le clavier postal tactile sous son champ après défilement et conserve une interface responsive */

.postal-code-control {
    position: relative;
}

.postal-keypad {
    position: absolute;
    z-index: 45;
    top: calc(100% + 8px);
    left: 0;
    display: grid;
    width: min(100%, 350px);
    gap: 14px;
    padding: 16px;
    border: 1px solid rgba(23, 53, 47, .14);
    border-radius: 20px;
    background:
        radial-gradient(circle at top right, rgba(232, 200, 159, .5), transparent 42%),
        var(--white);
    box-shadow: 0 22px 55px rgba(23, 53, 47, .22);
    animation: postalKeypadIn .2s ease-out;
}

.postal-keypad[hidden] {
    display: none !important;
}

.postal-keypad__heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--ink);
}

.postal-keypad__heading strong {
    font-family: var(--font-serif);
    font-size: 1.05rem;
}

.postal-keypad__heading span {
    padding: 4px 8px;
    border-radius: 999px;
    background: var(--sage);
    color: var(--ink-soft);
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.postal-keypad__keys {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
}

.postal-keypad__keys button {
    min-height: 52px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--paper);
    color: var(--ink);
    font: inherit;
    font-size: 1.18rem;
    font-weight: 850;
    cursor: pointer;
    touch-action: manipulation;
    user-select: none;
    transition: transform .12s ease, background .12s ease, border-color .12s ease;
}

.postal-keypad__keys button:hover,
.postal-keypad__keys button:focus-visible {
    outline: none;
    border-color: var(--accent);
    background: var(--paper-warm);
}

.postal-keypad__keys button:active {
    transform: scale(.94);
}

.postal-keypad__keys .postal-keypad__action {
    color: var(--accent-dark);
    font-size: .78rem;
}

@keyframes postalKeypadIn {
    from { opacity: 0; transform: translateY(8px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 780px) {
    .postal-code-control {
        scroll-margin-top: 12px;
    }

    .postal-keypad {
        position: absolute;
        top: calc(100% + 8px);
        right: 0;
        bottom: auto;
        left: 0;
        box-sizing: border-box;
        width: 100%;
        max-width: none;
        margin: 0;
    }

    .postal-keypad__keys button {
        min-height: 58px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .postal-keypad {
        animation: none;
    }
}