:root {
    --background: oklch(0.98 0.005 80);
    --foreground: oklch(0.25 0.04 40);
    --card: oklch(1 0 0);
    --primary: oklch(0.55 0.12 55);
    --secondary: oklch(0.92 0.02 80);
    --muted-foreground: oklch(0.50 0.03 40);
    --accent: oklch(0.78 0.14 85);
    --border: oklch(0.90 0.02 80);
    --ring: oklch(0.78 0.14 85);
    --beige-light: oklch(0.96 0.02 80);
    --brown: oklch(0.45 0.08 40);
}

* {
    box-sizing: border-box;
    border-color: var(--border);
    outline-color: color-mix(in oklch, var(--ring) 50%, transparent);
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    background: var(--background);
    color: var(--foreground);
    font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: geometricPrecision;
}

button {
    font: inherit;
}

button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--ring);
    outline-offset: 2px;
}

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

picture {
    display: contents;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--beige-light);
}

::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--brown);
}

.menu-app {
    min-height: 100vh;
    background: var(--background);
}

.menu-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgb(255 255 255 / 0.95);
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.05);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 1rem;
}

.header-home {
    text-align: center;
}

.header-home h1 {
    margin: 0;
    color: var(--primary);
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 2rem;
}

.header-home p {
    margin: 0.25rem 0 0;
    color: var(--muted-foreground);
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.header-drilldown {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.back-button {
    display: inline-flex;
    width: 2.25rem;
    height: 2.25rem;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 9999px;
    background: var(--secondary);
    color: var(--foreground);
    cursor: pointer;
    transition: background-color 150ms ease, transform 150ms ease;
}

.back-button:hover {
    background: color-mix(in oklch, var(--secondary) 80%, transparent);
}

.back-button:active {
    transform: scale(0.96);
}

.back-button svg {
    width: 1.25rem;
    height: 1.25rem;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.header-title {
    min-width: 0;
    flex: 1;
}

.header-title h2 {
    margin: 0;
    color: var(--foreground);
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.75rem;
}

.header-title p {
    margin: 0;
    color: var(--muted-foreground);
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.menu-main {
    padding: 1rem 1rem 6rem;
}

.menu-view {
    animation: menuFadeIn 220ms ease both;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.category-card,
.product-card {
    border: 0;
    cursor: pointer;
    appearance: none;
}

.category-card {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.10), 0 2px 4px -2px rgb(0 0 0 / 0.10);
    transition: box-shadow 300ms ease, transform 300ms ease;
}

.category-card:hover,
.category-card.is-active {
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.10), 0 8px 10px -6px rgb(0 0 0 / 0.10);
}

.category-card:active {
    transform: scale(0.985);
}

.category-card picture {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.category-card img,
.product-card img,
.product-hero-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.category-card img {
    position: absolute;
    top: 0;
    left: 0;
}

.category-card img,
.product-card img {
    transition: transform 500ms ease;
}

.category-card:hover img,
.product-card:hover img {
    transform: scale(1.05);
}

.image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgb(0 0 0 / 0.70), rgb(0 0 0 / 0.20), transparent);
}

.category-copy {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    padding: 0.75rem;
    color: #fff;
    text-align: center;
}

.category-icon {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 1.5rem;
    line-height: 2rem;
}

.category-name {
    display: block;
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.18;
}

.category-name-ar {
    display: block;
    margin-top: 0.125rem;
    font-size: 0.75rem;
    line-height: 1rem;
    opacity: 0.9;
}

.products-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
}

.product-card {
    overflow: hidden;
    width: 100%;
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.10), 0 2px 4px -2px rgb(0 0 0 / 0.10);
    text-align: left;
    transition: box-shadow 300ms ease, transform 300ms ease;
}

.product-card:hover,
.product-card.is-active {
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.10), 0 8px 10px -6px rgb(0 0 0 / 0.10);
}

.product-card:active {
    transform: scale(0.992);
}

.product-image {
    display: block;
    position: relative;
    overflow: hidden;
    aspect-ratio: 4 / 3;
}

.product-copy {
    display: block;
    padding: 1rem;
}

.product-name {
    display: block;
    color: var(--foreground);
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.5rem;
}

.product-name-ar,
.product-description {
    display: block;
    color: var(--muted-foreground);
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.product-name-ar {
    margin-top: 0.125rem;
}

.product-description {
    margin-top: 0.5rem;
}

.product-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.variant-count {
    border-radius: 9999px;
    background: color-mix(in oklch, var(--accent) 10%, transparent);
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1rem;
    padding: 0.25rem 0.5rem;
    white-space: nowrap;
}

.from-price {
    color: var(--primary);
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.25rem;
    white-space: nowrap;
}

.variant-wrap {
    display: grid;
    gap: 1rem;
}

.ui-card {
    overflow: hidden;
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.10), 0 2px 4px -2px rgb(0 0 0 / 0.10);
}

.product-hero-image {
    position: relative;
    aspect-ratio: 16 / 9;
}

.product-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgb(0 0 0 / 0.60), transparent);
}

.product-hero-copy {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    gap: 0.25rem;
    padding: 1rem;
    color: #fff;
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.variants-card {
    border-radius: 1rem;
}

.variants-heading {
    background: color-mix(in oklch, var(--secondary) 50%, transparent);
    padding: 0.75rem 1rem;
}

.variants-heading h4 {
    margin: 0;
    color: var(--foreground);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.5rem;
}

.variants-heading p {
    margin: 0;
    color: var(--muted-foreground);
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.variants-list {
    display: grid;
}

.variant-row {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border: 0;
    border-top: 1px solid var(--border);
    background: #fff;
    color: inherit;
    padding: 1rem;
    text-align: left;
    cursor: pointer;
    transition: background-color 150ms ease;
}

.variant-row:first-child {
    border-top: 0;
}

.variant-row:hover,
.variant-row.is-active {
    background: color-mix(in oklch, var(--secondary) 30%, transparent);
}

.variant-title {
    display: grid;
    min-width: 0;
    flex: 1;
    gap: 0.125rem;
}

.variant-title span:first-child {
    color: var(--foreground);
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.5rem;
}

.variant-title span:last-child {
    color: var(--muted-foreground);
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.variant-price {
    flex: 0 0 auto;
    margin-left: 1rem;
    color: var(--primary);
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.75rem;
    text-align: right;
    white-space: nowrap;
}

.menu-footer {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    border-top: 1px solid var(--border);
    background: rgb(255 255 255 / 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 0.75rem 1rem;
}

.menu-footer p {
    margin: 0;
    color: var(--muted-foreground);
    font-size: 0.75rem;
    line-height: 1rem;
    text-align: center;
}

.hero-section {
    text-align: center;
}

.ui-button {
    border: 0;
    border-radius: 9999px;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    font-weight: 600;
    padding: 0.625rem 1rem;
}

.modal-shell {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: grid;
    place-items: center;
    padding: 1rem;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgb(0 0 0 / 0.45);
}

.modal-panel {
    position: relative;
    width: min(100%, 32rem);
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
}

.is-hidden {
    display: none !important;
}

@keyframes menuFadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (min-width: 640px) {
    .menu-header {
        padding-top: 1.25rem;
        padding-bottom: 1.25rem;
    }

    .header-home h1 {
        font-size: 1.875rem;
        line-height: 2.25rem;
    }

    .header-home p,
    .menu-footer p {
        font-size: 1rem;
        line-height: 1.5rem;
    }

    .header-title h2 {
        font-size: 1.25rem;
        line-height: 1.75rem;
    }

    .menu-main {
        padding: 1.5rem 1.5rem 6rem;
    }

    .categories-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 1rem;
    }

    .category-copy {
        padding: 1rem;
    }

    .category-icon {
        font-size: 1.875rem;
        line-height: 2.25rem;
    }

    .category-name,
    .product-name {
        font-size: 1rem;
        line-height: 1.5rem;
    }

    .category-name-ar {
        font-size: 0.875rem;
        line-height: 1.25rem;
    }

    .products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .product-name {
        font-size: 1.125rem;
        line-height: 1.75rem;
    }

    .product-hero-image {
        aspect-ratio: 21 / 9;
    }
}

@media (min-width: 1024px) {
    .categories-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .products-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
