/* ==========================================================
   Avocado.jo — Mobile-first luxury menu
   Base styles target phones; media queries scale up to desktop
   ========================================================== */

:root {
    /* Light luxury palette */
    --bg: #faf7f0;              /* warm ivory */
    --bg-2: #f2ede0;
    --surface: #ffffff;
    --surface-2: #fbf7ec;
    --text: #1f2a1a;            /* deep olive-ink */
    --text-soft: #3a4a32;
    --muted: #7a7466;
    --gold: #b8912a;            /* rich luxury gold */
    --gold-2: #d4af37;
    --gold-soft: #f0e2b0;
    --green: #4b6a34;           /* avocado green accent */
    --green-deep: #2f4a20;
    --border: rgba(184, 145, 42, 0.28);
    --border-soft: rgba(31, 42, 26, 0.08);
    --shadow: 0 20px 45px rgba(31, 42, 26, 0.10);
    --shadow-sm: 0 6px 16px rgba(31, 42, 26, 0.08);
    --radius: 16px;

    /* Safe areas for notched phones */
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);

    /* Sticky-tabs height (used for scroll offsets) */
    --tabs-h: 56px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; overflow-x: clip; }

body {
    font-family: "Cairo", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
    background:
            radial-gradient(1200px 800px at 85% -10%, #fff6dc 0%, transparent 55%),
            radial-gradient(900px 700px at -10% 15%, #eaf1dc 0%, transparent 55%),
            var(--bg);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    line-height: 1.55;
    font-size: 15px;
}

img { display: block; max-width: 100%; }
button { font-family: inherit; }

/* ==========================================================
   HERO (mobile-first) — branded background + transparent logo
   ========================================================== */
.hero {
    position: relative;
    min-height: 62vh;
    display: grid;
    place-items: center;
    text-align: center;
    overflow: hidden;
    border-bottom: 1px solid var(--border);
    padding-top: var(--safe-top);
    background:
            linear-gradient(
                    180deg,
                    rgba(20, 30, 16, 0.82) 0%,
                    rgba(20, 30, 16, 0.58) 45%,
                    rgba(20, 30, 16, 0.18) 80%,
                    transparent 100%
            ),
            #20c997;
    background-size: cover;
    background-position: center;
}
.hero__bg {
    position: absolute; inset: 0;
    background-size: cover;
    background-position: center;
    filter: blur(3px) brightness(0.75) saturate(1.15);
    transform: scale(1.08);
    transition: opacity .8s ease;
    opacity: 0;                 /* slideshow fades in over the base image */
}
.hero__bg.is-active { opacity: 0.5; }
.hero__overlay {
    position: absolute; inset: 0;
    background:
            radial-gradient(closest-side at 50% 42%, rgba(0,0,0,0) 0%, rgba(20,30,16,0.35) 70%, rgba(20,30,16,0.6) 100%),
            linear-gradient(180deg, transparent 55%, var(--bg) 100%);
}
.hero__content { position: relative; z-index: 1; padding: 34px 20px; width: 100%; }

.hero__logo {
    width: clamp(140px, 42vw, 230px);
    height: auto;
    margin: 0 auto 6px;
    display: block;
    filter: drop-shadow(0 8px 26px rgba(0,0,0,0.45));
    animation: heroLogoIn .9s cubic-bezier(.2,.9,.3,1.1) both;
}
@keyframes heroLogoIn {
    from { opacity: 0; transform: translateY(14px) scale(0.94); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.brand__mark { font-size: 64px; filter: drop-shadow(0 6px 16px rgba(0,0,0,.5)); }

.hero__subtitle {
    margin: 8px 0 0;
    font-size: 16px;
    color: #fff;
    font-weight: 700;
    opacity: .96;
    letter-spacing: 6px;
    text-shadow: 0 2px 12px rgba(0,0,0,.5);
}
.hero__seo {
    margin: 6px 0 0;
    font-size: 12px;
    color: rgba(255,255,255,0.88);
    font-weight: 600;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 10px rgba(0,0,0,.45);
}
.hero__divider {
    display: flex; align-items: center; justify-content: center; gap: 12px;
    margin: 18px auto 12px;
    max-width: 260px;
}
.hero__divider::before,
.hero__divider::after {
    content: ""; flex: 1; height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold-2), transparent);
}
.hero__divider span {
    width: 9px; height: 9px; transform: rotate(45deg);
    background: var(--gold-2);
    box-shadow: 0 0 12px rgba(212,175,55,.7);
}
.hero__desc {
    color: rgba(255,255,255,0.92);
    max-width: 620px;
    margin: 0 auto;
    font-size: 13.5px;
    padding: 0 8px;
    text-shadow: 0 2px 10px rgba(0,0,0,.5);
}
.hero__cta {
    display: inline-block;
    margin-top: 22px;
    padding: 12px 22px;
    border-radius: 999px;
    background: #D4AF37FF;
    color: #fff;
    font-weight: 800;
    font-size: 14px;
    text-decoration: none;
    letter-spacing: 1px;
    box-shadow: 0 10px 24px rgba(184, 145, 42, .3);
    transition: transform .2s ease, box-shadow .2s ease;
}
.hero__cta:active { transform: translateY(1px); }

/* ==========================================================
   STICKY MINI-HEADER — compact brand bar + category tabs
   ========================================================== */
.nav {
    position: relative;
    z-index: 20;
    background: rgba(250, 247, 240, 0.92);
    backdrop-filter: blur(16px) saturate(1.3);
    -webkit-backdrop-filter: blur(16px) saturate(1.3);
    border-bottom: 1px solid var(--border-soft);
    transition: box-shadow .3s ease, background .3s ease;
}
.nav.is-fixed {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
}
.nav.is-stuck {
    background: rgba(250, 247, 240, 0.98);
    box-shadow: 0 8px 24px rgba(31, 42, 26, 0.10);
    border-bottom-color: var(--border);
}

.nav__bar {
    display: flex;
    align-items: center;
    gap: 10px;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    padding: 0 12px;
    transition: max-height .32s ease, opacity .25s ease, padding .32s ease;
}
.nav.is-stuck .nav__bar {
    max-height: 56px;
    opacity: 1;
    padding-top: max(8px, var(--safe-top));
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-soft);
}

.nav__brand {
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 11px;
    background: #fff;
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    transition: transform .15s ease, box-shadow .2s ease;
}
.nav__brand:active { transform: scale(0.94); }

.nav__logo {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.nav__context {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.nav__label {
    font-size: 10px;
    color: var(--muted);
    font-weight: 700;
    letter-spacing: 0.4px;
}

.nav__section {
    font-size: 15px;
    font-weight: 900;
    color: var(--gold);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity .2s ease;
}

.tabs {
    max-width: 100%;
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    padding-inline-start: max(12px, env(safe-area-inset-right));
    padding-inline-end: max(12px, env(safe-area-inset-left));
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    transition: padding .25s ease;
}
.nav.is-stuck .tabs {
    padding-top: 8px;
    padding-bottom: 8px;
    gap: 6px;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
    flex: 0 0 auto;
    padding: 10px 18px;
    min-height: 40px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    font-family: "Cairo", sans-serif;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background .25s ease, color .25s ease, border-color .25s ease, transform .1s ease, padding .25s ease, font-size .25s ease;
    white-space: nowrap;
    scroll-snap-align: center;
    box-shadow: var(--shadow-sm);
}
.nav.is-stuck .tab {
    padding: 8px 14px;
    min-height: 36px;
    font-size: 13px;
}
.tab:active { transform: scale(0.96); }
.tab.is-active {
    background: linear-gradient(180deg, var(--gold-2), var(--gold));
    border-color: var(--gold);
    color: #fff;
    box-shadow: 0 6px 18px rgba(184, 145, 42, .35);
}
.tab.tab--offers:not(.is-active) {
    border-color: rgba(184, 145, 42, 0.55);
    background: linear-gradient(180deg, #fffdf3, #fff);
    color: var(--green-deep);
}
.tab.tab--offers.is-active {
    background: linear-gradient(180deg, #e8c547, var(--gold));
}

.nav-spacer {
    height: 0;
    pointer-events: none;
}


/* ==========================================================
   MENU + SECTIONS
   ========================================================== */
.menu {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 14px 60px;
}

.section {
    padding-top: 28px;
    scroll-margin-top: calc(var(--tabs-h) + 12px);
}

/* ==========================================================
   SUB-DIVIDER — elegant gold ornament between sub-groups
   (spans full grid width)
   ========================================================== */
.sub-divider {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 22px 4px 6px;
    color: var(--gold);
    font-family: "Cairo", sans-serif;
    font-weight: 800;
    font-size: 16px;
    letter-spacing: 0.5px;
}
.sub-divider::before,
.sub-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold) 40%, var(--gold) 60%, transparent);
    opacity: 0.55;
}
.sub-divider__ornament {
    display: inline-block;
    width: 8px; height: 8px;
    transform: rotate(45deg);
    background: var(--gold);
    box-shadow: 0 0 8px rgba(184, 145, 42, .5);
    flex: 0 0 auto;
}
.sub-divider__note {
    grid-column: 1 / -1;
    margin: -2px 4px 8px;
    color: var(--muted);
    font-size: 12.5px;
    padding: 8px 12px;
    background: linear-gradient(180deg, #fffdf3, #fff);
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    line-height: 1.6;
}
.section__head {
    display: flex; align-items: center; gap: 14px;
    margin: 0 0 18px;
}
.section__head h2 {
    margin: 0;
    font-family: "Cairo", system-ui, sans-serif;
    font-size: clamp(22px, 5.5vw, 34px);
    color: var(--gold);
    font-weight: 900;
    letter-spacing: 0;
    white-space: nowrap;
}
.section__head::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--border), transparent);
}

/* Section note (top-group level, sits under the h2) */
.section__note {
    margin: -6px 0 22px;
    padding: 12px 16px;
    background: linear-gradient(180deg, #fffdf3, #fff);
    border: 1px solid var(--border);
    border-inline-start: 3px solid var(--gold);
    border-radius: 12px;
    color: var(--text-soft);
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.9;
    box-shadow: var(--shadow-sm);
    white-space: pre-line;    /* respect \n in JSON */
}

/* ==========================================================
   BADGES (on card media)
   ========================================================== */
.badge {
    position: absolute;
    top: 8px;
    inset-inline-start: 8px;
    z-index: 2;
    font-size: 10.5px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 999px;
    letter-spacing: 0.5px;
    color: #fff;
    box-shadow: 0 4px 10px rgba(31, 42, 26, 0.25);
    backdrop-filter: blur(4px);
}
.badge--signature { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #fff; }
.badge--spicy     { background: linear-gradient(180deg, #ef5b3d, #c8371e); }
.badge--new       { background: linear-gradient(180deg, #6ab04c, #3f7a2a); }
.badge--bestseller{ background: linear-gradient(180deg, #4b6a34, #2f4a20); }

/* ==========================================================
   CARDS — dynamic auto-fill grid, packs tightly (grid-auto-flow: dense)
   ========================================================== */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    grid-auto-flow: dense;
    gap: 12px;
    align-items: stretch;
}

/* Bigger cards on larger screens (still auto-fill / dynamic) */
@media (min-width: 560px) {
    .grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
}
@media (min-width: 768px) {
    .grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
}
@media (min-width: 1024px) {
    .grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 22px; }
}
@media (min-width: 1400px) {
    .grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
}

.card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.card:active { transform: scale(0.98); }

.card__media {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background:
            radial-gradient(120% 100% at 50% 0%, #fffdf3 0%, #f7f0dc 60%, #eee2c0 100%);
}
.card__media img {
    width: 100%; height: 100%;
    object-fit: contain;
    padding: 6px;
    transition: transform .5s ease;
}
.card__media::after {
    content: "";
    position: absolute; inset: 0;
    background: linear-gradient(180deg, transparent 75%, rgba(31,42,26,.10));
    pointer-events: none;
}

.card__body {
    padding: 10px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}
.card__title {
    margin: 0;
    font-size: 14.5px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.35;
}
.card__desc {
    margin: 0;
    font-size: 12px;
    color: var(--muted);
    line-height: 1.5;
    /* clamp long descriptions on mobile */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.attrs {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-top: 1px dashed var(--border);
    padding-top: 8px;
}
.attr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 12.5px;
}
.attr__name {
    color: var(--text-soft);
    font-weight: 600;
}
.attr__name:empty::before {
    content: "السعر";
    color: var(--muted);
    font-weight: 500;
}
.attr__price {
    color: var(--gold);
    font-weight: 800;
    font-family: "Cairo", system-ui, sans-serif;
    font-size: 15px;
    white-space: nowrap;
}
.attr__price::after {
    content: " JD";
    font-size: 10px;
    opacity: .8;
    margin-inline-start: 3px;
    letter-spacing: 1px;
}

/* Offers highlight */
#section-offers .card {
    border-color: rgba(184, 145, 42, .5);
    box-shadow: 0 10px 30px rgba(184, 145, 42, .12);
    background: linear-gradient(180deg, #fffdf3, #ffffff);
}

/* ==========================================================
   BACK TO TOP
   ========================================================== */
.to-top {
    position: fixed;
    bottom: calc(16px + var(--safe-bottom));
    inset-inline-start: 16px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: #fff;
    backdrop-filter: blur(8px);
    color: var(--gold);
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    z-index: 30;
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: opacity .25s ease, transform .25s ease, background .25s ease;
    box-shadow: 0 8px 22px rgba(31,42,26,.18);
}
.to-top.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.loading {
    text-align: center;
    color: var(--muted);
    padding: 40px 20px;
}
.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    padding-top: calc(16px + var(--safe-top));
    padding-bottom: calc(16px + var(--safe-bottom));
}
.modal.is-open { display: flex; }

.modal__backdrop {
    position: absolute; inset: 0;
    background: rgba(31, 42, 26, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: modalFadeIn .2s ease;
}

.modal__panel {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 480px;
    max-height: 92vh;
    background: var(--surface);
    border: 1px solid var(--gold);
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35), 0 0 0 4px rgba(184, 145, 42, 0.15);
    animation: modalScaleIn .28s cubic-bezier(.2,.9,.3,1.2);
}

@keyframes modalFadeIn {
    from { opacity: 0; } to { opacity: 1; }
}
@keyframes modalScaleIn {
    from { opacity: 0; transform: translateY(8px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal__close {
    position: absolute;
    top: 10px;
    inset-inline-end: 10px;
    z-index: 3;
    width: 38px; height: 38px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.92);
    color: var(--text);
    font-size: 22px;
    line-height: 1;
    font-weight: 700;
    cursor: pointer;
    display: grid;
    place-items: center;
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
    transition: transform .15s ease, background .2s ease;
}
.modal__close:hover { background: var(--gold-soft); }
.modal__close:active { transform: scale(0.92); }

.modal__media {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: radial-gradient(120% 100% at 50% 0%, #fffdf3 0%, #f7f0dc 60%, #eee2c0 100%);
    flex: 0 0 auto;
}
.modal__media img {
    width: 100%; height: 100%;
    object-fit: contain;
    padding: 10px;
    display: block;
}

.modal__body {
    padding: 18px 20px 22px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.modal__title {
    margin: 0;
    font-family: "Cairo", sans-serif;
    font-size: 22px;
    font-weight: 900;
    color: var(--text);
    line-height: 1.3;
}
.modal__desc {
    margin: 0;
    color: var(--text-soft);
    font-size: 14.5px;
    line-height: 1.75;
    white-space: pre-line;
}
.modal__prices {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
    padding-top: 14px;
    border-top: 1px dashed var(--border);
}
.modal__price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 12px;
    background: linear-gradient(180deg, #fffdf3, #fff);
    border: 1px solid var(--border-soft);
}
.modal__price-name {
    color: var(--text);
    font-weight: 700;
    font-size: 14.5px;
}
.modal__price-value {
    color: var(--gold);
    font-family: "Cairo", sans-serif;
    font-weight: 900;
    font-size: 20px;
    white-space: nowrap;
}
.modal__price-value::after {
    content: " JD";
    font-size: 11px;
    opacity: 0.75;
    margin-inline-start: 4px;
    letter-spacing: 1px;
    font-weight: 700;
}

body.modal-open { overflow: hidden; }

@media (min-width: 768px) {
    .modal__panel { max-width: 560px; }
    .modal__title { font-size: 26px; }
    .modal__desc { font-size: 15.5px; }
}

/* ==========================================================
   BADGES — hidden on cards (kept in data for future use)
   ========================================================== */
.badge { display: none !important; }

/* ==========================================================
   FOOTER — brand info, branches, phone
   ========================================================== */
.footer {
    margin-top: 40px;
    padding: 28px 16px calc(30px + var(--safe-bottom));
    background: linear-gradient(180deg, #1f2a1a 0%, #131a10 100%);
    color: #f2ede0;
    text-align: center;
    border-top: 3px solid var(--gold);
}
.footer .container {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 14px;
    line-height: 1.9;
}
.footer p { margin: 0; }
.footer p:first-child {
    color: var(--gold-2);
    font-weight: 800;
    font-size: 15px;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}
.footer a {
    color: #fff;
    text-decoration: none;
    font-weight: 800;
    border-bottom: 1px dashed var(--gold);
    padding-bottom: 1px;
    transition: color .2s ease;
}
.footer a:hover { color: var(--gold-2); }
.footer__social { margin-top: 8px; }
.footer__social a {
    color: var(--gold-2);
    border-bottom: none;
    font-weight: 700;
}
.footer__social a:hover { color: #fff; }

.menu-intro {
    text-align: center;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.8;
    padding: 0 16px 8px;
    max-width: 640px;
    margin: 0 auto;
}
