/* Foodics AR demo landing page
 * Mobile-first. Most visitors scan a QR with their phone, not open on desktop.
 */

:root {
    --foodics-purple: #440099;
    --foodics-purple-dark: #35007a;
    --foodics-purple-light: #faf8fc;
    --ink: #1a1a1a;
    --ink-soft: #4a4a4a;
    --rule: #e8e4ef;
    --shadow: 0 2px 8px rgba(68, 0, 153, 0.06), 0 8px 24px rgba(68, 0, 153, 0.08);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #ffffff;
    color: var(--ink);
    line-height: 1.5;
    min-height: 100vh;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* --- Header --- */

.site-header {
    text-align: center;
    padding: 24px 20px 16px;
    border-bottom: 1px solid var(--rule);
}

.logo {
    height: 40px;
    margin-bottom: 16px;
}

.title {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
    font-weight: 600;
    font-size: 20px;
    line-height: 1.2;
}

.title-en {
    color: var(--ink);
}

.title-ar {
    color: var(--ink-soft);
    font-weight: 500;
    font-size: 18px;
}

.subtitle {
    color: var(--ink-soft);
    font-size: 14px;
    max-width: 520px;
    margin: 0 auto;
}

.subtitle strong {
    color: var(--foodics-purple);
    font-weight: 600;
}

/* --- Dish grid --- */

.menu-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

@media (min-width: 640px) {
    .menu-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
        padding: 24px;
    }
}

@media (min-width: 960px) {
    .menu-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.dish-card {
    background: #ffffff;
    border: 1px solid var(--rule);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}

.viewer {
    width: 100%;
    height: 280px;
    background: var(--foodics-purple-light);
    --poster-color: var(--foodics-purple-light);
}

@media (min-width: 640px) {
    .viewer {
        height: 320px;
    }
}

.dish-meta {
    padding: 16px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-top: 1px solid var(--rule);
}

.dish-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--ink);
}

.dish-name-ar {
    font-size: 16px;
    font-weight: 500;
    color: var(--ink-soft);
}

.dish-price {
    margin-top: 6px;
    font-size: 16px;
    font-weight: 600;
    color: var(--foodics-purple);
}

/* --- AR button (injected into <model-viewer> slot) --- */

.ar-button {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 28px;
    background: var(--foodics-purple);
    color: #ffffff;
    border: none;
    border-radius: 999px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.2px;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(68, 0, 153, 0.35);
    transition: background 120ms ease, transform 80ms ease;
    -webkit-tap-highlight-color: transparent;
}

.ar-button:hover,
.ar-button:focus-visible {
    background: var(--foodics-purple-dark);
    outline: none;
}

.ar-button:active {
    transform: translateX(-50%) scale(0.97);
}

/* Lock AR button until its USDZ has finished preloading. Prevents an early
 * tap from firing AR Quick Look against a still-downloading file, which
 * fails with "Object can't be loaded" on iPhone. */
model-viewer:not([data-ready]) .ar-button {
    opacity: 0.5;
    cursor: wait;
    pointer-events: none;
}

/* --- Footer --- */

.site-footer {
    text-align: center;
    padding: 32px 20px 40px;
    border-top: 1px solid var(--rule);
    color: var(--ink-soft);
    font-size: 13px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.site-footer .hint {
    font-size: 12px;
    opacity: 0.7;
}
