/* Shared customer action launcher (FAB -> bottom sheet) + Wi-Fi / table modals.
   Included by layouts/menu.php for every template; themed via --ym-* vars set
   per-template, with safe fallbacks. RTL-safe (logical inset properties). */

:root {
    --yma-primary: var(--ym-primary, #c0392b);
    --yma-card: var(--ym-card, #ffffff);
    --yma-muted: var(--ym-muted, #8a8a8a);
    /* Templates expose their body text color as --ym-ink (light on dark themes,
       dark on light themes) - bind to it so labels stay readable everywhere. */
    --yma-text: var(--ym-ink, #1f2430);
}

/* ---- FAB ---- */
.ym-actions-fab {
    position: fixed;
    /* JS (menu.js) refines this with the VisualViewport so the button clears the
       browser's bottom toolbar; this is the no-JS / safe-area fallback. */
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    inset-inline-end: 16px;
    height: 60px;
    padding: 0;
    border: none;
    border-radius: 30px;
    background: var(--yma-primary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .35);
    cursor: pointer;
    z-index: 1200;
    transition: transform .15s ease;
}
.ym-actions-fab:active { transform: scale(.94); }

/* Round icon area - the button is a circle until the label expands it into a pill. */
.ym-actions-fab-ico {
    width: 60px;
    height: 60px;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
}
.ym-actions-fab .ym-actions-fab-close { display: none; }
.ym-actions-fab.open .ym-actions-fab-open { display: none; }
.ym-actions-fab.open .ym-actions-fab-close { display: inline; }

/* "Services" label - shown briefly on load, then collapses to just the icon. */
.ym-actions-fab-label {
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    white-space: nowrap;
    font-size: 15px;
    font-weight: 600;
    padding-inline-end: 0;
    transition: max-width .35s ease, opacity .25s ease, padding .35s ease;
}
.ym-actions-fab.has-label .ym-actions-fab-label {
    max-width: 160px;
    opacity: 1;
    padding-inline-end: 20px;
}

/* Attention pulse ring (brand color), removed by JS once the guest engages. */
.ym-actions-fab.pulsing::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: var(--yma-primary);
    z-index: -1;
    animation: ymFabPulse 2.2s ease-out infinite;
}
@keyframes ymFabPulse {
    0% { transform: scale(1); opacity: .55; }
    70% { transform: scale(1.45); opacity: 0; }
    100% { transform: scale(1.45); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .ym-actions-fab.pulsing::before { animation: none; }
}

/* ---- backdrop ---- */
.ym-actions-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .42);
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease;
    z-index: 1190;
}
.ym-actions-backdrop.show { opacity: 1; visibility: visible; }

/* ---- bottom sheet ---- */
.ym-actions-sheet {
    position: fixed;
    inset-inline: 0;
    inset-block-end: 0;
    background: var(--yma-card);
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -8px 28px rgba(0, 0, 0, .2);
    padding: 10px 16px calc(18px + env(safe-area-inset-bottom, 0px));
    transform: translateY(110%);
    transition: transform .26s cubic-bezier(.32, .72, 0, 1);
    z-index: 1210;
    max-width: 720px;
    margin-inline: auto;
}
.ym-actions-sheet.open { transform: translateY(0); }
.ym-actions-grab { width: 38px; height: 4px; border-radius: 3px; background: #d8d8de; margin: 4px auto 12px; }
.ym-actions-sheet-title { font-size: 13px; font-weight: 700; color: var(--yma-muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 12px; }
.ym-actions-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

.ym-act {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px 6px;
    border: none;
    background: transparent;
    border-radius: 12px;
    cursor: pointer;
    text-decoration: none;
    color: var(--yma-text);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
    text-align: center;
    transition: background .12s ease;
}
.ym-act:active { background: rgba(127, 127, 127, .12); }
.ym-act.busy { opacity: .5; pointer-events: none; }
.ym-act-ic { width: 60px; height: 60px; border-radius: 16px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 30px; }
.ym-act-label { color: var(--yma-text); opacity: .95; }

/* per-action icon colors */
.ym-act-ic-waiter { background: var(--yma-primary); }
.ym-act-ic-bill { background: #34495e; }
.ym-act-ic-wifi { background: #2c7be5; }
.ym-act-ic-review { background: #f5a623; }
.ym-act-ic-survey { background: #8e44ad; }
.ym-act-ic-whatsapp { background: #25D366; }
.ym-act-ic-instagram { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }

/* ---- modals (table / wifi) ---- */
.ym-actions-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1220;
}
.ym-actions-modal.open { display: flex; }
.ym-actions-modal-card {
    position: relative;
    background: var(--yma-card);
    color: var(--yma-text);
    width: 100%;
    max-width: 340px;
    border-radius: 16px;
    padding: 22px 20px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, .32);
}
.ym-actions-modal-close { position: absolute; inset-block-start: 10px; inset-inline-end: 10px; border: none; background: transparent; font-size: 22px; color: var(--yma-muted); cursor: pointer; }
.ym-actions-modal-title { margin: 0 0 4px; font-size: 17px; }
.ym-actions-modal-sub { margin: 0 0 14px; font-size: 12px; color: var(--yma-muted); }
.ym-table-form input { width: 100%; border: 1.5px solid #d8d8de; border-radius: 10px; padding: 12px; font-size: 16px; text-align: center; margin-bottom: 12px; }
.ym-actions-btn { width: 100%; border: none; background: var(--yma-primary); color: #fff; border-radius: 10px; padding: 12px; font-size: 14px; font-weight: 600; cursor: pointer; }
.ym-actions-btn-sm { border: none; background: var(--yma-primary); color: #fff; border-radius: 7px; padding: 6px 12px; font-size: 12px; font-weight: 600; cursor: pointer; }

/* ---- wifi modal ---- */
.ym-wifi-qr { width: 160px; height: 160px; margin: 4px auto 14px; }
.ym-wifi-qr svg { width: 100%; height: 100%; }
.ym-wifi-field { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #f5f5f7; border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.ym-wifi-lbl { display: block; font-size: 9px; text-transform: uppercase; letter-spacing: .04em; color: var(--yma-muted); }
.ym-wifi-val { font-size: 14px; font-weight: 600; word-break: break-all; }
