:root {
    --bs-primary: #7c3aed;
    --bs-primary-rgb: 124, 58, 237;
    --bs-link-color: #7c3aed;
    --bs-link-hover-color: #6d28d9;
}

body, button, input, select, textarea {
    font-family: Vazirmatn, system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Noto Sans Arabic", sans-serif;
}

* { font-family: inherit; }

.app-body {
    background: radial-gradient(1200px 700px at 90% -10%, rgba(124, 58, 237, 0.24), transparent 62%),
        radial-gradient(1000px 700px at 0% 10%, rgba(249, 115, 22, 0.18), transparent 62%),
        radial-gradient(900px 520px at 60% 80%, rgba(14, 165, 233, 0.14), transparent 60%),
        linear-gradient(180deg, #f8fafc 0%, #f6f7fb 40%, #f1f5f9 100%);
    min-height: 100vh;
    color: #0f172a;
    font-size: 15.5px;
    display: flex;
    flex-direction: column;
}

.app-body > main {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
}

.menu-page {
    flex: 1 0 auto;
    min-height: 0;
}

.menu-shell {
    flex: 1 0 auto;
    min-height: 0;
}

.menu-loader {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: radial-gradient(900px 520px at 50% 100%, rgba(124, 58, 237, 0.10), transparent 60%),
        rgba(248, 250, 252, 0.70);
    backdrop-filter: blur(10px);
    z-index: 50;
}

.js .menu-page.is-loading .menu-shell {
    visibility: hidden;
}

.js .menu-page.is-loading .menu-loader {
    display: flex;
}

.menu-loader-card {
    width: min(420px, 92vw);
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(15, 23, 42, 0.10);
    border-radius: 18px;
    box-shadow: 0 22px 50px rgba(15, 23, 42, 0.14);
    padding: 16px 16px 14px 16px;
    text-align: center;
}

.menu-loader-spinner {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 3px solid rgba(124, 58, 237, 0.20);
    border-top-color: rgba(124, 58, 237, 0.95);
    margin: 4px auto 10px auto;
    animation: menuSpin 900ms linear infinite;
}

.menu-loader-text {
    color: rgba(15, 23, 42, 0.70);
    font-weight: 600;
    font-size: 0.98rem;
}

@keyframes menuSpin {
    to { transform: rotate(360deg); }
}

.app-nav {
    background: rgba(255, 255, 255, 0.75);
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(10px);
}

.card.app-card {
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(15, 23, 42, 0.08);
    color: #0f172a;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.10);
    border-radius: 16px;
    backdrop-filter: blur(14px);
}

.app-card .card-title, .app-card .card-text { color: #0f172a; }

.badge.app-badge {
    background: rgba(124, 58, 237, 0.10);
    border: 1px solid rgba(124, 58, 237, 0.25);
    color: #4c1d95;
}

.accordion-item.app-acc {
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(15, 23, 42, 0.08);
    color: #0f172a;
    border-radius: 16px;
    overflow: hidden;
    backdrop-filter: blur(14px);
}

.accordion-button {
    background: rgba(255, 255, 255, 0.60);
    color: #0f172a;
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.accordion-button:not(.collapsed) {
    background: rgba(124, 58, 237, 0.10);
    color: #0f172a;
}

.form-control, .form-select {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(15, 23, 42, 0.12);
    color: #0f172a;
}

.form-control:focus, .form-select:focus {
    background: rgba(255, 255, 255, 1);
    border-color: rgba(124, 58, 237, 0.55);
    color: #0f172a;
    box-shadow: 0 0 0 .25rem rgba(124, 58, 237, 0.15);
}

.table {
    --bs-table-color: #0f172a;
    --bs-table-bg: rgba(255, 255, 255, 0.70);
    --bs-table-border-color: rgba(15, 23, 42, 0.10);
}

.btn-primary {
    box-shadow: 0 12px 24px rgba(124, 58, 237, 0.20);
}

.text-muted { color: rgba(15, 23, 42, 0.60) !important; }

.menu-footer {
    margin-top: auto;
    padding-top: 14px;
}

.menu-footer-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(15, 23, 42, 0.10);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    color: rgba(124, 58, 237, 0.92);
    text-decoration: none;
    font-weight: 700;
}

.menu-footer-link:hover {
    background: rgba(255, 255, 255, 0.82);
    border-color: rgba(124, 58, 237, 0.22);
    color: rgba(124, 58, 237, 1);
    text-decoration: none;
}

.menu-footer .menu-footer-label {
    color: rgba(15, 23, 42, 0.62);
    font-weight: 500;
}

.menu-tabs {
    position: relative;
}

.menu-tabs-scroll {
    position: relative;
    overflow: auto hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 6px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 14px;
    backdrop-filter: blur(14px);
}

.menu-tabs-scroll::-webkit-scrollbar {
    display: none;
}

.menu-tabs-list {
    display: flex;
    gap: 8px;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    scroll-snap-type: x mandatory;
}

.menu-tab {
    scroll-snap-align: start;
    white-space: nowrap;
    border-radius: 999px;
    color: rgba(15, 23, 42, 0.78);
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(15, 23, 42, 0.12);
    padding: 9px 14px;
    text-decoration: none;
    font-weight: 500;
    line-height: 1.2;
}

.menu-tabs-list::before,
.menu-tabs-list::after {
    content: "";
    flex: 0 0 8px;
}

.menu-tab:hover {
    color: rgba(15, 23, 42, 0.90);
    border-color: rgba(124, 58, 237, 0.28);
}

.menu-tab.active {
    color: #1f0a4d;
    background: linear-gradient(180deg, rgba(124, 58, 237, 0.16) 0%, rgba(124, 58, 237, 0.10) 100%);
    border-color: rgba(124, 58, 237, 0.38);
    box-shadow: 0 10px 20px rgba(124, 58, 237, 0.12);
}

.menu-tabs-scroll::before,
.menu-tabs-scroll::after {
    content: "";
    position: absolute;
    top: 1px;
    bottom: 1px;
    width: 42px;
    pointer-events: none;
    opacity: 1;
    transition: opacity 120ms ease;
}

.menu-tabs-scroll::before {
    right: 0;
    border-radius: 14px 0 0 14px;
    background: linear-gradient(270deg, rgba(255, 255, 255, 0.72) 0%, rgba(255, 255, 255, 0) 100%);
}

.menu-tabs-scroll::after {
    left: 0;
    border-radius: 0 14px 14px 0;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.72) 0%, rgba(255, 255, 255, 0) 100%);
}

.menu-tabs-scroll.at-end::before {
    opacity: 0;
}

.menu-tabs-scroll.at-start::after {
    opacity: 0;
}

.menu-tabs-arrow {
    display: none;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.14);
    background: rgba(255, 255, 255, 0.92);
    color: rgba(15, 23, 42, 0.72);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
    z-index: 2;
}

.menu-tabs-arrow:disabled {
    opacity: 0.35;
}

.menu-tabs-arrow-prev {
    left: 6px;
}

.menu-tabs-arrow-next {
    right: 6px;
}

.menu-tabs-scroll.dragging {
    cursor: grabbing;
}

@media (min-width: 992px) {
    .menu-tabs-arrow {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.menu-item .card-body {
    padding: 12px;
}

.menu-item-thumb {
    width: 100%;
    aspect-ratio: 4 / 3;
    height: auto;
    margin: 10px 10px 0 10px;
    width: calc(100% - 20px);
    border-radius: 16px;
    object-fit: cover;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(255, 255, 255, 0.9);
    display: block;
}

.menu-item-title {
    line-height: 1.35;
}

.menu-price {
    white-space: nowrap;
}

.menu-desc {
    font-size: 0.92rem;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.menu-variants {
    border-top: 1px dashed rgba(15, 23, 42, 0.14);
    padding-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.menu-details {
    border-top: 1px dashed rgba(15, 23, 42, 0.14);
    padding-top: 10px;
}

.menu-details[open] {
    padding-bottom: 2px;
}

.menu-details-summary {
    list-style: none;
    cursor: pointer;
    font-size: 0.92rem;
    color: rgba(15, 23, 42, 0.70);
    user-select: none;
}

.menu-details-summary::-webkit-details-marker {
    display: none;
}

.menu-details-summary::before {
    content: "◂";
    display: inline-block;
    margin-left: 8px;
    transform: translateY(-1px);
    color: rgba(15, 23, 42, 0.55);
}

.menu-details[open] .menu-details-summary::before {
    content: "▾";
}

.menu-details .menu-variants {
    border-top: 0;
    padding-top: 10px;
}

.menu-variant-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 0.92rem;
}

.menu-variant-name {
    color: rgba(15, 23, 42, 0.72);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.menu-variant-price {
    white-space: nowrap;
    color: rgba(15, 23, 42, 0.82);
    font-variant-numeric: tabular-nums;
}

@media (max-width: 575.98px) {
    .accordion-button {
        padding-top: 0.85rem;
        padding-bottom: 0.85rem;
    }
    .menu-tabs-scroll::before,
    .menu-tabs-scroll::after {
        display: none;
    }
    .menu-item .card-body {
        padding: 10px 12px 12px 12px;
    }
    .menu-item-thumb {
        margin: 10px 10px 0 10px;
        width: calc(100% - 20px);
    }
}

@media (min-width: 992px) {
    .menu-item .card-body {
        padding: 10px;
    }
}
