
:root {
    /* ----- Palette ----- */
    --color-primary: #6a0206;
    --primary-rgb: 106, 2, 6;              
    --color-bg: #ecdacc;
    --bg-rgb: 236, 218, 204;   
    --color-text: #2a0b0d;                 
    --color-muted: rgba(var(--primary-rgb), 0.72); 

    /* ----- Surfaces ----- */
    --color-card: rgba(255, 255, 255, 0.6);
    --color-border: rgba(var(--primary-rgb), 0.12);
    --color-divider: rgba(var(--primary-rgb), 0.25);
    --shadow: 0 4px 14px rgba(var(--primary-rgb), 0.08);
    --shadow-hover: 0 10px 26px rgba(var(--primary-rgb), 0.18);
    --radius: 18px;
    --whatsapp: #25d366;

    /* ----- Fonts ----- */
    --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-script: 'Dancing Script', 'Brush Script MT', cursive;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-body);
    color: var(--color-text);
    background-color: var(--color-bg);
    /* Paper-like grain, drawn with an inline SVG so no image file is needed */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.06'/%3E%3C/svg%3E");
}

/* Centered column: full width on mobile, 600px max on larger screens */
.menu {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 clamp(16px, 5vw, 24px) 110px;   /* extra bottom space so the floating button never covers content */
}

/* ---------- Header ---------- */
.hero {
    text-align: center;
    padding: clamp(28px, 8vw, 48px) 0 clamp(20px, 6vw, 32px);
}

.hero__logo {
    display: block;
    width: clamp(84px, 24vw, 120px);
    height: auto;
    margin: 0 auto 16px;
}

/* "— COFFEE HOUSE —" with thin lines on both sides */
.eyebrow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 0;
    font-size: clamp(11px, 3vw, 13px);
    font-weight: 600;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--color-text);
}

.eyebrow::before,
.eyebrow::after {
    content: "";
    flex: 0 0 clamp(28px, 10vw, 48px);
    height: 1px;
    background: rgba(var(--primary-rgb), 0.45);
}

.tagline {
    margin: 10px 0 0;
    font-family: var(--font-script);
    font-size: clamp(28px, 8vw, 38px);
    line-height: 1.1;
    color: var(--color-primary);
}

/* The curved brush stroke under the tagline */
.tagline__stroke {
    display: block;
    width: clamp(150px, 42vw, 210px);
    height: auto;
    margin: 2px auto 0;
    opacity: 0.8;
}

/* ---------- Category cards ---------- */
.cards {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: clamp(12px, 3.5vw, 18px);
}

.card {
    --icon-w: clamp(56px, 17vw, 78px);

    position: relative;
    display: grid;
    grid-template-columns: var(--icon-w) minmax(0, 1fr) 44%;   /* icon | text | photo */
    min-height: clamp(104px, 29vw, 136px);
    overflow: hidden;
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    background: var(--color-card);
    box-shadow: var(--shadow);
    color: inherit;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* 1. Icon, with a thin vertical divider */
.card__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: clamp(12px, 3.5vw, 18px) 0;
    border-right: 1px solid var(--color-divider);
    color: var(--color-primary);
}

.card__icon img,
.card__icon svg {
    display: block;
    width: clamp(26px, 8vw, 36px);
    height: clamp(26px, 8vw, 36px);
    object-fit: contain;
}

/* 2. Title + 2-line subtitle */
.card__body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    padding: 12px clamp(10px, 3vw, 16px);
}

.card__title {
    font-size: clamp(15px, 4.4vw, 19px);
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-text);
}

.card__sub {
    margin-top: 4px;
    font-size: clamp(11px, 3.1vw, 13px);
    line-height: 1.35;
    color: var(--color-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 3. Photo: its left edge fades into the card background */
.card__media {
    position: relative;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 40%);
            mask-image: linear-gradient(to right, transparent 0%, #000 40%);
}

.card__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

/* Shown when a category has no photo yet */
.card__media--empty {
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.08), rgba(var(--primary-rgb), 0.28));
}

/* Chevron button, bottom-right over the photo */
.card__chevron {
    position: absolute;
    right: 10px;
    bottom: 10px;
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    color: var(--color-primary);
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

/* Tap / keyboard focus (phones and keyboards) */
.card:active,
.card:focus-visible {
    transform: scale(1.02);
    box-shadow: var(--shadow-hover);
    outline: none;
}
.card:active .card__media img,
.card:focus-visible .card__media img { transform: scale(1.05); }
.card:active .card__chevron,
.card:focus-visible .card__chevron { transform: translateX(3px); }

/* Mouse hover (desktop only, so phones don't get "stuck" hover after a tap) */
@media (hover: hover) {
    .card:hover {
        transform: scale(1.02);
        box-shadow: var(--shadow-hover);
    }
    .card:hover .card__media img { transform: scale(1.05); }
    .card:hover .card__chevron { transform: translateX(3px); }
}

/* ---------- Category page: tab bar ---------- */
.tabs {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 16px;
    /* stretch to the screen edges, so scrolling content never peeks out at the sides */
    margin: 0 calc(-1 * clamp(16px, 5vw, 24px));
    padding: 0 clamp(16px, 5vw, 24px);
    background: rgba(var(--bg-rgb), 0.94);
    -webkit-backdrop-filter: blur(8px);
            backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--color-border);
}

/* Hamburger icon on the far left */
.tabs__menu {
    flex: none;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    color: var(--color-primary);
    -webkit-tap-highlight-color: transparent;
}

/* Horizontally scrollable list of tabs, scrollbar hidden */
.tabs__list {
    position: relative;               /* lets the script measure tab positions */
    display: flex;
    gap: 24px;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
}
.tabs__list::-webkit-scrollbar { display: none; }

/* Tabs are <button>s, so reset the default button look */
.tab {
    position: relative;
    flex: none;
    padding: 14px 0;
    border: 0;
    background: none;
    font: inherit;
    font-size: clamp(14px, 3.8vw, 15px);
    font-weight: 500;
    color: var(--color-muted);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.25s ease;
}

/* Active tab: bold burgundy with a thick rounded bar underneath */
.tab.is-active {
    font-weight: 700;
    color: var(--color-primary);
}
.tab.is-active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 3px;
    border-radius: 3px;
    background: var(--color-primary);
}

@media (hover: hover) {
    .tab:hover { color: var(--color-primary); }
}

/* ---------- Category page: heading + panels ---------- */
.panel[hidden] { display: none; }

.section-title {
    margin: 24px 0 14px;
    font-size: clamp(1.35rem, 5vw, 1.5rem);
    font-weight: 700;
    color: var(--color-text);
}

/* ---------- Category page: item cards ---------- */
.items {
    list-style: none;
    margin: 0 0 24px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.item {
    --thumb: clamp(88px, 26vw, 105px);

    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    border-radius: 16px;
    border: 1px solid var(--color-border);
    background: var(--color-card);
    box-shadow: var(--shadow);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

/* Square thumbnail */
.item__thumb {
    flex: none;
    width: var(--thumb);
    height: var(--thumb);
    border-radius: 12px;
    overflow: hidden;
}

.item__thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.25s ease;
}

/* Shown when an item has no image yet */
.item__thumb--empty {
    display: grid;
    place-items: center;
    background: rgba(var(--primary-rgb), 0.08);
    color: rgba(var(--primary-rgb), 0.35);
}

/* Right side: text on top, price at the bottom */
.item__body {
    flex: 1;
    min-width: 0;                      /* lets long text truncate instead of overflowing */
    min-height: var(--thumb);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 6px;
    padding: 2px 0;
}

.item__name {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item__desc {
    margin: 4px 0 0;
    font-size: 0.85rem;
    line-height: 1.35;
    color: var(--color-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.item__price {
    display: flex;
    justify-content: flex-end;
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-primary);
}

/* Tap / keyboard (phones) */
.item:active {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}
.item:active .item__thumb img { transform: scale(1.04); }

/* Mouse hover (desktop only) */
@media (hover: hover) {
    .item:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-hover);
    }
    .item:hover .item__thumb img { transform: scale(1.04); }
}

.empty {
    padding: 40px 0;
    text-align: center;
    list-style: none;
    color: var(--color-muted);
}

@media (prefers-reduced-motion: reduce) {
    .item,
    .item__thumb img,
    .tab { transition: none; }

    .item:hover,
    .item:active { transform: none; }
}


/* ---------- Floating action button (speed dial) ---------- */
.fab {
    position: fixed;
    right: max(20px, env(safe-area-inset-right));
    bottom: max(20px, env(safe-area-inset-bottom));
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}

.fab__actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

/* Hidden by default */
.fab__action {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(14px) scale(0.92);
    transform-origin: right bottom;
    transition:
        opacity 0.25s ease,
        transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1),
        visibility 0s linear 0.3s;
}

/* Revealed, one after the other (bottom item first) */
.fab.is-open .fab__action {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
    transition:
        opacity 0.25s ease,
        transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1),
        visibility 0s;
}
.fab.is-open .fab__action:nth-child(2) { transition-delay: 0.03s; }
.fab.is-open .fab__action:nth-child(1) { transition-delay: 0.09s; }

.fab__label {
    padding: 8px 14px;
    border-radius: 999px;
    background: #fff;
    color: var(--color-text);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.fab__btn {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.fab__btn--whatsapp { background: var(--whatsapp); }
.fab__btn--map      { background: var(--color-primary); }

/* Main button */
.fab__toggle {
    position: relative;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--color-primary);
    box-shadow: 0 6px 18px rgba(var(--primary-rgb), 0.4);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.35s ease;
}

.fab.is-open .fab__toggle { transform: rotate(90deg); }

/* White dot (closed) that becomes an X (open) */
.fab__dot,
.fab__bar {
    position: absolute;
    top: 50%;
    left: 50%;
    background: #fff;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.fab__dot {
    width: 12px;
    height: 12px;
    margin: -6px 0 0 -6px;
    border-radius: 50%;
}

.fab__bar {
    width: 18px;
    height: 2px;
    margin: -1px 0 0 -9px;
    border-radius: 2px;
    transform: rotate(0deg) scaleX(0);
}

.fab.is-open .fab__dot { transform: scale(0); opacity: 0; }
.fab.is-open .fab__bar--a { transform: rotate(45deg) scaleX(1); }
.fab.is-open .fab__bar--b { transform: rotate(-45deg) scaleX(1); }

/* ---------- Accessibility: respect "reduce motion" ---------- */
@media (prefers-reduced-motion: reduce) {
    .card,
    .card__media img,
    .card__chevron,
    .fab__action,
    .fab__toggle,
    .fab__dot,
    .fab__bar {
        transition: none;
    }
    .card:active,
    .card:focus-visible,
    .card:hover { transform: none; }
}

/* ==========================================================================
   Language toggle + floating button icon
   ========================================================================== */

.hero { position: relative; }

/* ---------- EN | عربي toggle ---------- */
.lang-toggle {
    position: absolute;
    top: 14px;
    inset-inline-end: 0;
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    border-radius: 999px;
    border: 1px solid rgba(var(--primary-rgb), 0.22);
    background: rgba(255, 255, 255, 0.6);
    box-shadow: 0 2px 8px rgba(var(--primary-rgb), 0.08);
}

.lang-toggle__opt {
    padding: 6px 13px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1;
    color: var(--color-primary);
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.25s ease, color 0.25s ease;
}

/* Arabic text looks small next to Latin letters, so give it a little more size */
.lang-toggle__opt[lang="ar"] { font-size: 14px; }

/* The current language */
.lang-toggle__opt.is-active {
    background: var(--color-primary);
    color: #fff;
    box-shadow: 0 2px 6px rgba(var(--primary-rgb), 0.3);
}

@media (hover: hover) {
    a.lang-toggle__opt:hover { background: rgba(var(--primary-rgb), 0.1); }
}

/* ---------- Floating button: plus that turns into an X ---------- */
.fab__dot,
.fab__bar { display: none; }               /* old dot and bars: no longer used */

.fab__toggle {
    display: grid;
    place-items: center;
    color: #fff;
}

.fab.is-open .fab__toggle { transform: none; }   /* the old rule rotated the whole button */

.fab__toggle svg {
    transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.fab.is-open .fab__toggle svg { transform: rotate(135deg); }

/* ==========================================================================
   Header picture + language button
   ========================================================================== */

/* The header is now just the picture (it already contains the name and tagline) */
.hero__brand {
    margin: 0;
    line-height: 0;
}

.hero__logo {
    display: block;
    width: clamp(220px, 68vw, 340px);   /* bigger or smaller to taste */
    max-width: 100%;
    height: auto;
    margin: 0 auto;
}

.hero { padding-bottom: clamp(16px, 5vw, 26px); }

/* ---------- Language button: round, bottom-left ---------- */
.lang-fab {
    position: fixed;
    left: max(20px, env(safe-area-inset-left));
    bottom: max(20px, env(safe-area-inset-bottom));
    z-index: 1000;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--color-primary);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    box-shadow: 0 6px 18px rgba(var(--primary-rgb), 0.4);
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

/* Arabic letters look small next to Latin ones */
.lang-fab[lang="ar"] { font-size: 15px; }

.lang-fab:active { transform: scale(0.95); }

@media (hover: hover) {
    .lang-fab:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 24px rgba(var(--primary-rgb), 0.5);
    }
}

/* ==========================================================================
   Full menu, "All" tabs, category title
   ========================================================================== */

/* The `hidden` attribute must always win (the script uses it to filter) */
[hidden] { display: none !important; }

/* ---------- Category title: "which category you are in" ---------- */
.cat-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 6px 0 16px;
    font-size: clamp(1.2rem, 5.5vw, 1.5rem);
    font-weight: 700;
    color: var(--color-text);
}

.cat-title::before,
.cat-title::after {
    content: "";
    flex: 0 0 clamp(24px, 8vw, 40px);
    height: 1px;
    background: rgba(var(--primary-rgb), 0.45);
}

/* ---------- "View full menu" button on the home page ---------- */
.full-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: clamp(14px, 4vw, 20px);
    padding: 14px 20px;
    border-radius: var(--radius);
    background: var(--color-primary);
    color: #fff;
    font-size: clamp(14px, 4vw, 16px);
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 6px 18px rgba(var(--primary-rgb), 0.3);
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.full-menu-btn:active { transform: scale(0.98); }

@media (hover: hover) {
    .full-menu-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 24px rgba(var(--primary-rgb), 0.4);
    }
}

/* ---------- Full menu: two-row top bar ---------- */
.tabs--stacked {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
}

.tabs__row {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Row 2 lines up under the tabs of row 1 */
.tabs__row--sub {
    padding: 6px 0 10px;
}

.chips {
    display: flex;
    flex: 1;
    gap: 8px;
    min-width: 0;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
}
.chips::-webkit-scrollbar { display: none; }

.chip {
    flex: none;
    padding: 7px 14px;
    border: 1px solid var(--color-divider);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.55);
    color: var(--color-primary);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.chip.is-active {
    border-color: var(--color-primary);
    background: var(--color-primary);
    color: #fff;
}

/* ---------- Full menu: headings ---------- */
.cat { margin-bottom: 12px; }

.cat-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 26px 0 2px;
    font-size: clamp(1.35rem, 5vw, 1.6rem);
    font-weight: 700;
    color: var(--color-text);
}

.cat-heading::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--color-divider);
}

.sub-heading {
    margin: 18px 0 10px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-primary);
}

/* ==========================================================================
   Fixed sizes: every card stays the same size, photos get cropped to fit
   ========================================================================== */

/* ---------- Category cards ---------- */
.card {
    height: clamp(104px, 29vw, 136px);    /* the same for every card */
    min-height: 0;
    grid-template-rows: minmax(0, 1fr);
}

/* The photo fills its box exactly and never changes the card's size */
.card__media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Long text can't push the card taller either */
.card__body {
    min-height: 0;
    overflow: hidden;
}

.card__title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---------- Item cards ---------- */
.item {
    height: clamp(120px, 34vw, 132px);    /* the same for every card, with or without a description */
    align-items: center;
}

/* The thumbnail is always an exact square, whatever the photo's shape */
.item__thumb {
    flex: none;
    aspect-ratio: 1 / 1;
}

.item__thumb img {
    object-fit: cover;
    object-position: center;
}

/* The text column fills the card, so the price always sits at the bottom corner */
.item__body {
    align-self: stretch;
    min-height: 0;
    overflow: hidden;
}
