/* Phase 4 live-cleanup - Menu entry order-method chooser
   (class-rm-method-chooser.php). Same bottom-anchored/centered dialog
   language as Quick View - a compact, blocking step before ordering, not a
   full sheet. The Continue button's colours and states are shared with the other
   primary buttons in ui.css; colours are the Theme tokens (class-rm-theme.php)
   with the earlier literal as the fallback. */

.rm-method-chooser-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, .55);
    z-index: 110000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.rm-method-chooser-backdrop[hidden] {
    display: none;
}

.rm-method-chooser-panel {
    position: relative;
    background: var(--rm-surface, #ffffff);
    color: var(--rm-text, #1f2933);
    border-radius: 14px;
    width: min(420px, 100%);
    padding: 28px 24px 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
}

#rm-method-chooser-title {
    margin: 0 0 20px;
    padding-right: 32px;
    font-size: 1.2em;
    text-align: center;
}

.rm-method-chooser-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* One option plus, under it, its canonical ordering note (opens later / unavailable). */
.rm-method-chooser-choice {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.rm-method-chooser-choice .rm-method-chooser-option {
    width: 100%;
}

.rm-method-chooser-option:disabled,
.rm-method-chooser-option.is-closed {
    cursor: not-allowed;
    opacity: .6;
}

.rm-method-chooser-note {
    margin: 0;
    padding: 0 4px;
    font-size: .88em;
    line-height: 1.4;
    color: var(--rm-muted, #4b5563);
}

.rm-method-chooser-option {
    box-sizing: border-box;
    margin: 0;
    padding: 16px 20px;
    border: 1px solid var(--rm-border, #e5e7eb) !important;
    border-radius: 10px;
    background: var(--rm-surface, #ffffff) !important;
    box-shadow: none !important;
    color: var(--rm-text, #1f2933) !important;
    font: inherit;
    font-weight: 600;
    font-size: 1em;
    cursor: pointer;
    text-align: center;
    appearance: none;
    -webkit-appearance: none;
}

.rm-method-chooser-option:hover,
.rm-method-chooser-option:focus-visible {
    border-color: var(--rm-primary, #2563eb) !important;
    background: var(--rm-primary-tint, #eff6ff) !important;
    color: var(--rm-primary-hover, #1d4ed8) !important;
}

/* Keyboard focus is an outline on top of the hover colours: the colour change
   alone was the only cue before. */
.rm-method-chooser-option:focus-visible {
    outline: 2px solid var(--rm-focus, #2563eb);
    outline-offset: 2px;
}

.rm-method-chooser-postcode-label {
    display: block;
    margin: 0 0 16px;
    font-weight: 600;
}

/* Scoped to the panel so a theme's own input styling cannot restyle it; the border
   meets 3:1 against the panel (WCAG 1.4.11). */
.rm-method-chooser-panel .rm-method-chooser-postcode-input {
    display: block;
    width: 100%;
    min-height: 44px;
    box-sizing: border-box;
    margin-top: 8px;
    padding: 12px 14px;
    border: 1px solid var(--rm-border-strong, #8b93a1);
    border-radius: var(--rm-radius, 8px);
    background: var(--rm-surface, #ffffff);
    color: var(--rm-text, #1f2933);
    font: inherit;
    font-weight: 400;
}

.rm-method-chooser-panel .rm-method-chooser-postcode-input:focus-visible {
    outline: 2px solid var(--rm-focus, #2563eb);
    outline-offset: 1px;
}

/* Colours, states and the theme-button floor come from ui.css; only the size
   and shape are local. Scoped to the panel like the other RM buttons. */
.rm-method-chooser-panel .rm-method-chooser-continue {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 14px 20px;
    border-radius: var(--rm-radius, 8px);
    font-size: 1em;
    line-height: 1.2;
}

.rm-method-chooser-message {
    margin: 0 0 4px;
    text-align: center;
}

.rm-method-chooser-error {
    margin: 0 0 12px;
    padding: 10px 12px;
    border-radius: 6px;
    background: var(--rm-danger-tint, #fef2f2);
    color: var(--rm-danger, #b91c1c);
    font-size: .9em;
}

.rm-method-chooser-error[hidden] {
    display: none;
}

/* Hardened against theme `button` styles - same principle/floor as the close
   button in ui.css, but positioned in the panel's corner. */
.rm-method-chooser-panel .rm-method-chooser-close {
    position: absolute;
    top: 14px;
    right: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    margin: 0;
    padding: 0;
    border: 0 !important;
    border-radius: 999px;
    background: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    color: var(--rm-text, #1f2933) !important;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.rm-method-chooser-panel .rm-method-chooser-close:hover,
.rm-method-chooser-panel .rm-method-chooser-close:focus-visible {
    background: rgba(0, 0, 0, .06) !important;
    outline: none;
}

.rm-method-chooser-panel .rm-method-chooser-close:focus-visible {
    box-shadow: 0 0 0 2px var(--rm-focus, #2563eb) !important;
}

.rm-method-chooser-close svg {
    display: block;
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

/* Touch: the corner close button grows to a 44px target. */
@media (pointer: coarse) {
    .rm-method-chooser-panel .rm-method-chooser-close {
        top: 10px;
        right: 10px;
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
    }
}
