/* ==========================================================================
   Restaurant Table Assist — Customer UI (mobile-first)
   ========================================================================== */

.rta-customer-theme {
    --rta-bg: #f2f2f7;
    --rta-surface: #ffffff;
    --rta-text: #1c1c1e;
    --rta-muted: #6e6e73;
    --rta-line: rgba(60, 60, 67, 0.12);
    --rta-accent: #0a84ff;
    --rta-accent-dark: #0060df;
    --rta-success: #248a3d;
    --rta-danger: #ff3b30;
    --rta-warning: #ff9f0a;
    --rta-radius: 22px;
    --rta-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
    --rta-ease: cubic-bezier(0.22, 1, 0.36, 1);

    max-width: 760px;
    margin: 0 auto;
    padding: 14px;
    padding-bottom: calc(14px + env(safe-area-inset-bottom));
    background: var(--rta-bg);
    color: var(--rta-text);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
}

.rta-customer-theme *,
.rta-customer-theme *::before,
.rta-customer-theme *::after {
    box-sizing: border-box;
}

/* ---------- Cards ---------- */
.rta-customer-theme .rta-card {
    background: var(--rta-surface);
    border-radius: var(--rta-radius);
    padding: 18px;
    margin-bottom: 16px;
    border: none;
    box-shadow: var(--rta-shadow);
}

/* ---------- Hero header ---------- */
.rta-customer-theme .rta-table-header {
    background: linear-gradient(135deg, #0a84ff 0%, #5e5ce6 100%);
    color: #fff;
    padding: 20px 18px 18px;
    position: relative;
    overflow: hidden;
}

.rta-customer-theme .rta-table-header::after {
    content: "";
    position: absolute;
    width: 220px;
    height: 220px;
    right: -70px;
    top: -90px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0) 70%);
    pointer-events: none;
}

.rta-customer-theme .rta-header-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
    position: relative;
    z-index: 1;
}

.rta-customer-theme .rta-header-brand img {
    background: #fff;
    padding: 6px;
    border-radius: 16px !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

.rta-customer-theme .rta-icon-plate {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.22);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.9rem;
    flex-shrink: 0;
}

.rta-customer-theme .rta-header-brand h2 {
    margin: 0;
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #fff;
    line-height: 1.15;
}

.rta-customer-theme .rta-subtitle {
    margin: 4px 0 0;
    font-size: 0.9rem;
    color: var(--rta-muted);
}

.rta-customer-theme .rta-table-header .rta-subtitle {
    color: rgba(255, 255, 255, 0.85);
}

/* ---------- Table picker ---------- */
.rta-customer-theme .rta-table-picker {
    position: relative;
    z-index: 1;
    padding: 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.18);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.rta-customer-theme .rta-table-picker label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.9);
}

.rta-customer-theme .rta-input-group {
    display: flex;
    gap: 8px;
}

.rta-customer-theme .rta-input-group input[type="text"] {
    flex: 1;
    min-width: 0;
    height: 52px;
    padding: 0 16px;
    border: 2px solid transparent;
    border-radius: 14px;
    background: #fff;
    color: var(--rta-text);
    font-size: 1.15rem;
    font-weight: 700;
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

.rta-customer-theme .rta-input-group input[type="text"]::placeholder {
    color: #aeaeb2;
    font-weight: 500;
}

.rta-customer-theme .rta-input-group input[type="text"]:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.3);
}

.rta-customer-theme .rta-table-picker .rta-btn-primary {
    background: #1c1c1e;
    color: #fff;
    height: 52px;
    padding: 0 20px;
}

.rta-customer-theme .rta-table-picker .rta-btn-primary:hover {
    background: #000;
}

/* ---------- Buttons ---------- */
.rta-customer-theme .rta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 0 22px;
    border: none;
    border-radius: 14px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.15s var(--rta-ease), background-color 0.2s, box-shadow 0.2s;
}

.rta-customer-theme .rta-btn:active {
    transform: scale(0.97);
}

.rta-customer-theme .rta-btn-primary {
    background: var(--rta-accent);
    color: #fff;
}

.rta-customer-theme .rta-btn-primary:hover {
    background: var(--rta-accent-dark);
}

.rta-customer-theme .rta-btn-success {
    background: var(--rta-success);
    color: #fff;
}

.rta-customer-theme .rta-btn-success:hover {
    background: #1d7433;
}

/* ---------- Badges ---------- */
.rta-customer-theme .rta-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.2;
}

.rta-customer-theme .rta-badge-info {
    background: #e5f1ff;
    color: #0060df;
    border: none;
}

.rta-customer-theme .rta-badge-warning {
    background: #fff1d6;
    color: #b25e00;
}

.rta-customer-theme .rta-badge-success {
    background: #dcf5e3;
    color: #1d7433;
}

.rta-customer-theme .rta-table-picker .rta-badge-info {
    margin-top: 12px;
    background: rgba(255, 255, 255, 0.95);
    color: #0a4fd6;
}

/* ---------- Tracker ---------- */
.rta-customer-theme .rta-tracker-box {
    border-left: none;
    padding: 18px;
}

.rta-customer-theme .rta-tracker-box h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.rta-customer-theme .rta-tracker-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.rta-customer-theme .rta-tracker-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px;
    border-radius: 16px;
    background: var(--rta-bg);
    border: none;
}

.rta-customer-theme .rta-tracker-info h4 {
    margin: 0 0 2px;
    font-size: 1rem;
    font-weight: 700;
}

.rta-customer-theme .rta-tracker-info p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--rta-muted);
}

/* ---------- Options grid ---------- */
.rta-customer-theme .rta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.rta-customer-theme .rta-grid-item {
    --tint: #e5f1ff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 168px;
    padding: 18px 12px 16px;
    text-align: center;
    background: var(--rta-surface);
    border: none;
    border-radius: var(--rta-radius);
    box-shadow: var(--rta-shadow);
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    transition: transform 0.2s var(--rta-ease), box-shadow 0.2s;
}

.rta-customer-theme .rta-grid-item:nth-child(8n+1) { --tint: #e5f1ff; }
.rta-customer-theme .rta-grid-item:nth-child(8n+2) { --tint: #e0f6fb; }
.rta-customer-theme .rta-grid-item:nth-child(8n+3) { --tint: #fff1d6; }
.rta-customer-theme .rta-grid-item:nth-child(8n+4) { --tint: #ffe4e1; }
.rta-customer-theme .rta-grid-item:nth-child(8n+5) { --tint: #e8f8ec; }
.rta-customer-theme .rta-grid-item:nth-child(8n+6) { --tint: #efe8ff; }
.rta-customer-theme .rta-grid-item:nth-child(8n+7) { --tint: #fde7f3; }
.rta-customer-theme .rta-grid-item:nth-child(8n+8) { --tint: #fff7c9; }

.rta-customer-theme .rta-grid-item:active {
    transform: scale(0.96);
}

@media (hover: hover) {
    .rta-customer-theme .rta-grid-item:hover {
        transform: translateY(-4px);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04), 0 16px 32px rgba(10, 132, 255, 0.16);
    }
}

.rta-customer-theme .rta-item-icon {
    width: 62px;
    height: 62px;
    margin-bottom: 12px;
    border-radius: 20px;
    background: var(--tint);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.9rem;
    line-height: 1;
}

.rta-customer-theme .rta-item-title {
    margin-bottom: 4px;
    font-size: 0.98rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--rta-text);
    line-height: 1.2;
}

.rta-customer-theme .rta-item-desc {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.78rem;
    line-height: 1.3;
    color: var(--rta-muted);
}

/* ---------- Social & review bar ---------- */
.rta-customer-theme .rta-social-review-bar {
    margin-top: 16px !important;
    padding: 20px 16px !important;
    border: none !important;
    border-radius: var(--rta-radius) !important;
    box-shadow: var(--rta-shadow);
}

.rta-customer-theme .rta-review-buttons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    transition: transform 0.15s var(--rta-ease);
}

.rta-customer-theme .rta-review-buttons a:active {
    transform: scale(0.96);
}

/* ---------- Modal / bottom sheet ---------- */
.rta-customer-theme .rta-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
    background: rgba(0, 0, 0, 0.45);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.rta-customer-theme .rta-modal {
    width: 100%;
    max-width: 520px;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--rta-surface);
    border-radius: 28px 28px 0 0;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2);
    animation: rtaSheetUp 0.35s var(--rta-ease);
}

@keyframes rtaSheetUp {
    from { transform: translateY(40px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

.rta-customer-theme .rta-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 8px;
    background: transparent;
    border: none;
    position: relative;
}

.rta-customer-theme .rta-modal-header::before {
    content: "";
    position: absolute;
    top: 8px;
    left: 50%;
    width: 38px;
    height: 5px;
    border-radius: 3px;
    background: rgba(60, 60, 67, 0.2);
    transform: translateX(-50%);
}

.rta-customer-theme .rta-modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.rta-customer-theme .rta-modal-close {
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(118, 118, 128, 0.16);
    color: var(--rta-muted);
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.rta-customer-theme .rta-modal-close:hover {
    background: rgba(118, 118, 128, 0.28);
    color: var(--rta-text);
}

.rta-customer-theme .rta-modal-body {
    padding: 8px 20px 12px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.rta-customer-theme .rta-modal-body label {
    display: block;
    margin: 8px 0 8px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--rta-muted);
}

.rta-customer-theme .rta-modal-body select,
.rta-customer-theme .rta-modal-body textarea,
.rta-customer-theme .rta-modal-body input {
    width: 100%;
    min-height: 50px;
    margin-bottom: 14px;
    padding: 12px 14px;
    border: 2px solid transparent;
    border-radius: 14px;
    background: var(--rta-bg);
    color: var(--rta-text);
    font-family: inherit;
    font-size: 1rem;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color 0.2s, background 0.2s;
}

.rta-customer-theme .rta-modal-body select {
    padding-right: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1.5l6 6 6-6' fill='none' stroke='%236e6e73' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
}

.rta-customer-theme .rta-modal-body textarea {
    resize: none;
    line-height: 1.4;
}

.rta-customer-theme .rta-modal-body select:focus,
.rta-customer-theme .rta-modal-body textarea:focus,
.rta-customer-theme .rta-modal-body input:focus {
    outline: none;
    border-color: var(--rta-accent);
    background: #fff;
}

.rta-customer-theme .rta-modal-footer {
    padding: 8px 20px calc(20px + env(safe-area-inset-bottom));
    background: transparent;
    border: none;
    text-align: center;
}

.rta-customer-theme .rta-modal-footer .rta-btn {
    width: 100%;
    min-height: 54px;
    font-size: 1.05rem;
}

/* ---------- Toast ---------- */
.rta-customer-theme .rta-toast {
    position: fixed;
    left: 50%;
    bottom: calc(24px + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    z-index: 1000000;
    width: max-content;
    max-width: calc(100vw - 32px);
    padding: 14px 22px;
    border-radius: 999px;
    background: rgba(28, 28, 30, 0.92);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.rta-customer-theme .rta-text-muted {
    color: var(--rta-muted);
}

/* ---------- Tablet & up ---------- */
@media (min-width: 600px) {
    .rta-customer-theme {
        padding: 24px;
        border-radius: 32px;
    }

    .rta-customer-theme .rta-table-header {
        padding: 28px 26px 24px;
    }

    .rta-customer-theme .rta-header-brand h2 {
        font-size: 1.75rem;
    }

    .rta-customer-theme .rta-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 16px;
    }

    .rta-customer-theme .rta-grid-item {
        min-height: 184px;
        padding: 22px 14px 18px;
    }

    .rta-customer-theme .rta-modal-overlay {
        align-items: center;
        padding: 20px;
    }

    .rta-customer-theme .rta-modal {
        border-radius: 28px;
    }

    .rta-customer-theme .rta-modal-header::before {
        display: none;
    }

    .rta-customer-theme .rta-modal-footer {
        padding-bottom: 20px;
    }

    .rta-customer-theme .rta-toast {
        bottom: 32px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .rta-customer-theme *,
    .rta-customer-theme *::before,
    .rta-customer-theme *::after {
        animation: none !important;
        transition: none !important;
    }
}

/* ---------- Menu card ---------- */
.rta-customer-theme .rta-menu-card {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
    padding: 16px 18px;
    border-radius: var(--rta-radius);
    background: linear-gradient(135deg, #ff9f0a 0%, #ff375f 100%);
    color: #fff;
    box-shadow: 0 8px 24px rgba(255, 55, 95, 0.28);
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    transition: transform 0.2s var(--rta-ease);
}

.rta-customer-theme .rta-menu-card:active { transform: scale(0.97); }
.rta-customer-theme .rta-menu-card:focus-visible { outline: 3px solid rgba(255, 255, 255, 0.8); outline-offset: 2px; }

.rta-customer-theme .rta-menu-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.25);
    font-size: 1.7rem;
    flex-shrink: 0;
}

.rta-customer-theme .rta-menu-card-text { flex: 1; display: flex; flex-direction: column; }
.rta-customer-theme .rta-menu-card-text strong { font-size: 1.1rem; letter-spacing: -0.01em; }
.rta-customer-theme .rta-menu-card-text span { font-size: 0.85rem; opacity: 0.9; }
.rta-customer-theme .rta-menu-card-arrow { font-size: 2rem; line-height: 1; opacity: 0.85; }

/* ---------- Menu viewer inside modal ---------- */
.rta-customer-theme .rta-modal-body .rta-menu-pdf {
    width: 100%;
    margin-bottom: 12px;
    color: #fff;
}

.rta-customer-theme .rta-menu-image { margin-bottom: 16px; }

.rta-customer-theme .rta-menu-image-title {
    margin-bottom: 8px;
    font-size: 0.95rem;
    font-weight: 700;
}

.rta-customer-theme .rta-menu-image img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 16px;
    background: var(--rta-bg);
}

/* ---------- Active table + change button ---------- */
.rta-customer-theme .rta-active-wrap {
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.rta-customer-theme .rta-active-wrap .rta-badge {
    margin-top: 0;
}

.rta-customer-theme .rta-change-table-btn {
    min-height: 40px;
    padding: 0 14px;
    border: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s var(--rta-ease);
}

.rta-customer-theme .rta-change-table-btn:hover { background: rgba(255, 255, 255, 0.34); }
.rta-customer-theme .rta-change-table-btn:active { transform: scale(0.96); }