/* ===================================
   QR Menu – Refined Warmth
   Premium Cafe / Restaurant Theme
   =================================== */

/* ── Design Tokens ── */
:root {
    /* Core */
    --color-primary: #1B1B1B;
    --color-primary-light: #2E2E2E;
    --color-accent: #8B6914;
    --color-accent-light: #A67C2E;
    --color-accent-soft: rgba(139, 105, 20, 0.07);
    --color-accent-gradient: linear-gradient(135deg, #8B6914 0%, #A67C2E 100%);
    --color-success: #3A7D5C;
    --color-warning: #C4930A;
    --color-error: #B83232;

    /* Surfaces */
    --color-surface: #FAFAF7;
    --color-surface-alt: #F5F4F0;
    --color-background: #F0EEE9;
    --color-card: #FFFFFF;
    --color-card-hover: #FEFEFE;
    --color-cream: #F0EDE6;

    /* Text */
    --color-text-primary: #1B1B1B;
    --color-text-secondary: #5A5A5A;
    --color-text-muted: #8A8A8A;
    --color-text-light: #FFFFFF;
    --color-text-accent: #8B6914;

    /* Borders */
    --color-border: rgba(0, 0, 0, 0.07);
    --color-border-hover: rgba(139, 105, 20, 0.25);
    --color-accent-bg-subtle: rgba(139, 105, 20, 0.08);
    --color-accent-border-subtle: rgba(139, 105, 20, 0.15);
    --color-accent-shadow: rgba(139, 105, 20, 0.3);

    /* Typography */
    --font-heading: 'Cormorant Garamond', 'Georgia', 'Times New Roman', serif;
    --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    --font-size-xs: 11px;
    --font-size-sm: 13px;
    --font-size-base: 14.5px;
    --font-size-lg: 16px;
    --font-size-xl: 18px;
    --font-size-2xl: 24px;
    --font-size-3xl: 32px;
    --font-size-4xl: 42px;

    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;

    --letter-spacing: -0.01em;
    --letter-spacing-wide: 0.08em;

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;

    /* Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 24px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.03);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.05);
    --shadow-lg: 0 6px 20px rgba(0,0,0,0.07);
    --shadow-xl: 0 12px 36px rgba(0,0,0,0.10);
    --shadow-card: 0 1px 3px rgba(0,0,0,0.03), 0 1px 2px rgba(0,0,0,0.02);
    --shadow-card-hover: 0 4px 14px rgba(0,0,0,0.07);
    --shadow-accent: 0 4px 14px rgba(139,105,20,0.12);

    /* Layout */
    --max-width: 520px;
    --header-height: 56px;
    --bottom-nav-height: 60px;
    --safe-area-top: env(safe-area-inset-top, 0px);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);

    /* Transitions */
    --transition-fast: 160ms ease;
    --transition-normal: 260ms ease;
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset ── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-normal);
    letter-spacing: var(--letter-spacing);
    line-height: 1.6;
    color: var(--color-text-primary);
    background: var(--color-background);
    min-height: 100vh;
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: var(--font-weight-semibold);
    line-height: 1.25;
    color: var(--color-text-primary);
}

h1 { font-size: var(--font-size-3xl); }
h2 { font-size: var(--font-size-2xl); }
h3 { font-size: var(--font-size-xl); }
h4 { font-size: var(--font-size-lg); }

p { margin-bottom: var(--spacing-md); }

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color var(--transition-fast);
}
a:hover { color: var(--color-accent-light); }

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol { list-style: none; }

button {
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
    border: none;
    background: none;
    padding: 0;
    color: inherit;
}
button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

input, textarea {
    font-family: inherit;
    font-size: inherit;
    border: none;
    outline: none;
}

/* ── App Container ── */
.app-container {
    max-width: var(--max-width);
    margin: 0 auto;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--color-surface);
    position: relative;
    overflow: hidden;
}

/* ── Header ── */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    height: calc(var(--header-height) + var(--safe-area-top));
    padding-top: var(--safe-area-top);
    padding-left: var(--spacing-md);
    padding-right: var(--spacing-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--color-border);
}

.header__title {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: var(--font-weight-bold);
    letter-spacing: -0.02em;
    color: var(--color-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    text-align: center;
    padding: 0 var(--spacing-sm);
}

.header--home .header__title {
    text-align: left;
    flex: unset;
    padding: 0;
}

.header__actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.header__btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
    transition: all var(--transition-fast);
    flex-shrink: 0;
}
.header__btn:hover {
    color: var(--color-accent);
    background: var(--color-accent-soft);
}
.header__btn svg {
    width: 20px;
    height: 20px;
}

/* ── Header Logo ── */
.header__logo {
    display: flex;
    align-items: center;
    height: 36px;
    flex-shrink: 0;
    text-decoration: none;
}
.header__logo img {
    height: 100%;
    width: auto;
    max-width: 160px;
    object-fit: contain;
}
.header--home .header__logo {
    flex: unset;
}

/* ── Language Switcher ── */
.lang-switcher {
    display: flex;
    gap: 1px;
    background: var(--color-surface-alt);
    padding: 3px;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
}

.lang-switcher__btn {
    padding: 6px 12px;
    font-family: var(--font-body);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    letter-spacing: var(--letter-spacing-wide);
    border-radius: 6px;
    color: var(--color-text-muted);
    transition: all var(--transition-fast);
    text-transform: uppercase;
}

.lang-switcher__btn.active {
    background: var(--color-primary);
    color: var(--color-text-light);
    box-shadow: var(--shadow-sm);
}

.lang-switcher__btn:not(.active):hover {
    color: var(--color-text-primary);
}

/* ── Main Content ── */
.main-content {
    position: relative;
    z-index: 1;
    padding-bottom: var(--spacing-2xl);
}

.main-content--with-nav {
    padding-bottom: calc(var(--bottom-nav-height) + var(--safe-area-bottom) + var(--spacing-lg));
}

.main-content--full {
    position: relative;
    height: calc(100vh - var(--header-height) - var(--bottom-nav-height) - var(--safe-area-top) - var(--safe-area-bottom));
    height: calc(100dvh - var(--header-height) - var(--bottom-nav-height) - var(--safe-area-top) - var(--safe-area-bottom));
    padding: 0;
    overflow: hidden;
}

/* ── Empty State ── */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-2xl) var(--spacing-xl);
    text-align: center;
}

.empty-state__icon {
    width: 56px;
    height: 56px;
    margin-bottom: var(--spacing-lg);
    color: var(--color-text-muted);
    opacity: 0.4;
}

.empty-state__icon svg {
    width: 100%;
    height: 100%;
}

.empty-state__text {
    font-family: var(--font-body);
    font-size: var(--font-size-base);
    color: var(--color-text-muted);
    font-weight: var(--font-weight-normal);
}

/* ── Loading ── */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-2xl);
}

.loading__spinner {
    width: 32px;
    height: 32px;
    border: 2px solid var(--color-cream);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: spin 700ms linear infinite;
}

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

/* ── Utilities ── */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.text-center { text-align: center; }
.text-accent { color: var(--color-accent); }
.text-muted { color: var(--color-text-muted); }
.text-success { color: var(--color-success); }
.text-error { color: var(--color-error); }
