:root {
    --brand: #D89B2E;
    --title-color: #1c1b19;
    --subtitle-color: #8a8578;
    --text-color: #2b2924;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: 'Segoe UI', Roboto, Arial, sans-serif;
    -webkit-text-size-adjust: 100%;
    padding-bottom: 30px;
}
a { text-decoration: none; color: inherit; }
button { font-family: inherit; }

/* ============================================================
   TEMPLATE BASE TOKENS (surface/bg per template - identitatea vizuala)
   ============================================================ */
body.tpl-classic      { background: #14130f; --surface: #1c1b19; --surface-2: #26241f; --border: #2c2a24; --on-surface: #fdf9ec; --on-surface-muted: #b5ac93; }
body.tpl-modern       { background: #faf9f6; --surface: #ffffff; --surface-2: #f3f0e8; --border: #eee6d3; --on-surface: #1c1b19; --on-surface-muted: #8a8578; }
body.tpl-vibrant      { background: #FFF8F0; --surface: #ffffff; --surface-2: #FFEFE0; --border: #FFE0C2; --on-surface: #2b2130; --on-surface-muted: #8a7a90; }
body.tpl-elegant-dark { background: #0E0C14; --surface: #17141F; --surface-2: #211D2C; --border: #322C40; --on-surface: #F5F1FA; --on-surface-muted: #A79CC0; }

body { color: var(--text-color); }

/* ============================================================
   COVER / HEADER
   ============================================================ */
.menu-cover {
    background-color: var(--surface);
    background-size: cover; background-position: center;
    position: relative; padding: 44px 20px 28px; text-align: center;
}
.menu-cover-overlay { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.25), rgba(0,0,0,.75)); }
body.tpl-modern .menu-cover-overlay, body.tpl-vibrant .menu-cover-overlay { display: none; }
body.tpl-modern .menu-cover, body.tpl-vibrant .menu-cover { border-bottom: 1px solid var(--border); }
.menu-header { position: relative; z-index: 1; }
.menu-logo { width: 82px; height: 82px; border-radius: 50%; object-fit: cover; border: 3px solid var(--brand); margin-bottom: 12px; box-shadow: 0 6px 20px rgba(0,0,0,.2); }
body.tpl-modern .menu-logo, body.tpl-vibrant .menu-logo { border-radius: 20px; }
.menu-header h1 { margin: 0; font-size: 24px; color: var(--title-color); letter-spacing: .2px; }
body.tpl-classic .menu-header h1, body.tpl-elegant-dark .menu-header h1 { color: #fff; }
.menu-address { color: var(--subtitle-color); font-size: 13px; margin: 9px 0 0; display: flex; align-items: center; justify-content: center; gap: 8px; }
body.tpl-classic .menu-address, body.tpl-elegant-dark .menu-address { color: #cfc7ac; }
.menu-address a { text-decoration: underline; text-underline-offset: 2px; }
.menu-share-btn {
    border: none; background: rgba(255,255,255,.18); color: inherit; width: 26px; height: 26px; border-radius: 50%;
    cursor: pointer; font-size: 13px; display: inline-flex; align-items: center; justify-content: center;
}
.menu-hours { font-size: 12.5px; color: var(--subtitle-color); margin: 8px 0 0; }
body.tpl-classic .menu-hours, body.tpl-elegant-dark .menu-hours { color: #cfc7ac; }
.btn-reservation {
    margin-top: 14px; border: none; background: var(--brand); color: #1c1b19; font-weight: 700;
    padding: 10px 22px; border-radius: 999px; cursor: pointer; font-size: 13.5px;
}

/* Cand exista poza de cover, textul din antet ramane mereu alb si lizibil,
   indiferent de template sau de culorile alese de client pentru titlu/subtitlu. */
.menu-cover.has-cover .menu-cover-overlay { display: block !important; }
.menu-cover.has-cover .menu-header h1,
.menu-cover.has-cover .menu-address,
.menu-cover.has-cover .menu-address a,
.menu-cover.has-cover .menu-hours {
    color: #ffffff !important;
    text-shadow: 0 1px 8px rgba(0,0,0,.55);
}
.menu-cover.has-cover .menu-share-btn { background: rgba(255,255,255,.25); }

/* ============================================================
   SUPEROFERTA / MENIUL ZILEI (slider automat)
   ============================================================ */
.offer-slider-wrap { max-width: 640px; margin: 16px auto 4px; padding: 0 16px; }
.offer-slider-title {
    font-size: 15px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px;
    color: var(--brand); margin: 0 0 10px; text-align: center;
}
.offer-slider { position: relative; border-radius: 16px; overflow: hidden; aspect-ratio: 16/9; background: var(--surface-2); }
.offer-slider-track { display: flex; height: 100%; transition: transform .4s ease; }
.offer-slide { flex: 0 0 100%; height: 100%; }
.offer-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.offer-nav {
    position: absolute; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border-radius: 50%;
    border: none; background: rgba(0,0,0,.4); color: #fff; font-size: 20px; cursor: pointer; display: flex;
    align-items: center; justify-content: center; z-index: 2;
}
.offer-nav-prev { left: 10px; }
.offer-nav-next { right: 10px; }
.offer-dots { position: absolute; bottom: 10px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; z-index: 2; }
.offer-dot { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.5); cursor: pointer; }
.offer-dot.active { background: #fff; width: 18px; border-radius: 4px; }

/* ============================================================
   MESAJ: masa nu e inca deschisa de ospatar
   ============================================================ */
.table-waiting-notice {
    max-width: 640px; margin: 14px auto 0; padding: 12px 16px; border-radius: 12px;
    background: var(--surface-2); color: var(--on-surface); border: 1px dashed var(--brand);
    font-size: 13px; text-align: center; font-weight: 600;
}

/* ============================================================
   GRID DE CATEGORII (carduri patrate, vedere initiala)
   ============================================================ */
.cat-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
    padding: 18px 16px 30px; max-width: 640px; margin: 0 auto;
}
.cat-card {
    aspect-ratio: 1 / 1; border-radius: 18px; border: 1px solid var(--border); background: var(--surface);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    cursor: pointer; padding: 14px; transition: transform .15s ease, box-shadow .15s ease;
    color: var(--on-surface);
}
.cat-card:active { transform: scale(.96); }
.cat-card-icon { font-size: 32px; }
.cat-card-name { font-weight: 700; font-size: 14.5px; text-align: center; line-height: 1.25; }
.cat-card-count { font-size: 11px; color: var(--on-surface-muted); }
body.tpl-vibrant .cat-card:nth-child(4n+1) { background: linear-gradient(150deg, var(--surface), var(--surface-2)); border-color: var(--brand); }
body.tpl-elegant-dark .cat-card { border-color: var(--brand); }

/* ============================================================
   BARA STICKY: buton "Toate categoriile" (sus, primul) + nav pastile (dedesubt)
   ============================================================ */
.sticky-top-bar {
    position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--border);
    display: flex; flex-direction: column;
}
.sticky-top-row { display: flex; align-items: stretch; }
.hamburger-btn {
    flex-shrink: 0; width: 48px; border: none; border-right: 1px solid var(--border); border-top: 1px solid var(--border);
    background: var(--surface); color: var(--on-surface); font-size: 19px; cursor: pointer;
}
.btn-back-sticky {
    flex: 1; display: block; border: none; border-top: 1px solid var(--border);
    background: var(--brand); color: #fff; font-weight: 700; font-size: 14px;
    cursor: pointer; padding: 12px 16px; text-align: center;
}
body.tpl-modern .btn-back-sticky, body.tpl-vibrant .btn-back-sticky { color: #1c1b19; }

/* Panou lateral (hamburger) cu toate categoriile */
.hamburger-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 65; opacity: 0; pointer-events: none;
    transition: opacity .2s ease;
}
.hamburger-overlay.open { opacity: 1; pointer-events: auto; }
.hamburger-panel {
    position: fixed; top: 0; left: -280px; width: 260px; height: 100%; background: var(--surface); color: var(--on-surface);
    z-index: 70; box-shadow: 4px 0 24px rgba(0,0,0,.25); transition: left .22s ease; overflow-y: auto; padding-bottom: 20px;
}
.hamburger-panel.open { left: 0; }
.hamburger-panel-head {
    display: flex; justify-content: space-between; align-items: center; padding: 16px; font-weight: 700; font-size: 15px;
    border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface);
}
.hamburger-panel a {
    display: block; padding: 13px 18px; font-size: 14px; color: var(--on-surface); border-bottom: 1px solid var(--border);
}
.hamburger-panel a:hover, .hamburger-panel a.active { background: var(--surface-2); color: var(--brand); font-weight: 600; }

/* ============================================================
   NAV ORIZONTALA (pill-uri) - urmareste automat categoria vizibila (scroll-spy)
   ============================================================ */
.menu-cats-nav {
    display: flex; gap: 8px; overflow-x: auto; padding: 12px 14px; background: var(--surface);
    scrollbar-width: none;
}
.menu-cats-nav::-webkit-scrollbar { display: none; }
.menu-cats-nav a {
    flex-shrink: 0; padding: 8px 16px; border-radius: 999px; background: var(--surface-2); color: var(--on-surface-muted);
    font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap;
}
.menu-cats-nav a.active { background: var(--brand); color: #fff; }
body.tpl-modern .menu-cats-nav a.active, body.tpl-vibrant .menu-cats-nav a.active { color: #1c1b19; }

/* ============================================================
   VEDERE DETALIU CATEGORIE
   ============================================================ */
.menu-content { padding: 10px 16px 20px; max-width: 640px; margin: 0 auto; }
.cat-title {
    font-size: 20px; color: var(--title-color); margin: 10px 0 16px; padding-bottom: 10px; border-bottom: 2px solid var(--brand);
    display: inline-block; letter-spacing: .2px;
}
body.tpl-classic .cat-title, body.tpl-elegant-dark .cat-title { color: #fff; }

/* Accordion subcategorii */
.accordion-item { border-radius: 14px; overflow: hidden; margin-bottom: 10px; border: 1px solid var(--border); }
.accordion-head {
    width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 14px 16px;
    background: var(--surface); border: none; cursor: pointer; font-weight: 700; font-size: 15px; color: var(--on-surface);
}
.accordion-head .acc-arrow { transition: transform .2s ease; color: var(--brand); }
.accordion-head.open .acc-arrow { transform: rotate(180deg); }
.accordion-body { background: var(--surface); padding: 0 12px 12px; }

/* ============================================================
   CARD PRODUS (imagine 16:9 sus + continut)
   ============================================================ */
.menu-items { display: flex; flex-direction: column; gap: 14px; margin-bottom: 6px; }
.menu-item {
    background: var(--surface); border-radius: 16px; overflow: hidden; border: 1px solid var(--border);box-shadow: rgba(0, 0, 0, 0.1) 0px 0px 5px 0px, rgba(0, 0, 0, 0.1) 0px 0px 1px 0px;
}
.menu-item-img-wrap { width: 100%; aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface-2); }
.menu-item-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.menu-item-photo-toggle { border-bottom: 1px solid var(--border); }
.menu-item-photo-toggle summary {
    cursor: pointer; padding: 12px 16px; font-size: 13px; font-weight: 600; color: var(--brand);
    list-style: none; display: flex; align-items: center; gap: 6px;
}
.menu-item-photo-toggle summary::-webkit-details-marker { display: none; }
.menu-item-photo-toggle[open] summary { border-bottom: 1px solid var(--border); }
.menu-item-body { padding: 14px 16px 16px; }
.menu-item-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.menu-item-top h3 { margin: 0; font-size: 16px; color: var(--on-surface); font-weight: 700; }
.menu-item-price { color: var(--brand); font-weight: 800; font-size: 15.5px; white-space: nowrap; }
.menu-item-desc { font-size: 13px; color: var(--on-surface-muted); margin: 6px 0 0; line-height: 1.45; }
.menu-item-meta { display: flex; gap: 10px; margin-top: 9px; font-size: 11.5px; color: var(--on-surface-muted); }
.menu-item-allergens { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.allergen-tag {
    font-size: 10.5px; background: var(--surface-2); color: var(--on-surface-muted); padding: 3px 9px; border-radius: 999px;
    border: 1px solid var(--border);
}
.menu-item-nutrition { margin-top: 9px; font-size: 11.5px; color: var(--on-surface-muted); }
.menu-item-nutrition summary { cursor: pointer; color: var(--brand); font-weight: 600; }
.menu-item-nutrition p { margin: 6px 0 0; }

.menu-item-add { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.qty-stepper { display: flex; align-items: center; gap: 10px; background: var(--surface-2); border-radius: 999px; padding: 4px 8px; }
.qty-btn { border: none; background: none; width: 24px; height: 24px; border-radius: 50%; font-size: 16px; cursor: pointer; color: var(--on-surface); font-weight: 700; }
.qty-btn:hover { background: rgba(0,0,0,.06); }
.qty-value { font-weight: 700; min-width: 16px; text-align: center; color: var(--on-surface); }
.btn-add-cart {
    flex: 1; border: none; background: var(--brand); color: #fff; font-weight: 700; padding: 10px 14px;
    border-radius: 999px; cursor: pointer; font-size: 13.5px;
}
body.tpl-modern .btn-add-cart, body.tpl-vibrant .btn-add-cart { color: #fff; }

.menu-empty { text-align: center; padding: 60px 20px; color: var(--on-surface-muted); }

/* ============================================================
   REZERVARE
   ============================================================ */
.reservation-section { max-width: 640px; margin: 10px auto 20px; padding: 22px 18px; background: var(--surface); border-radius: 18px; border: 1px solid var(--border); color: var(--on-surface); }
.reservation-section h2 { margin-top: 0; font-size: 18px; }
.btn-reservation-cta { display: inline-block; margin-top: 8px; background: var(--brand); color: #fff; font-weight: 700; padding: 12px 22px; border-radius: 999px; border: none; cursor: pointer; }
body.tpl-modern .btn-reservation-cta, body.tpl-vibrant .btn-reservation-cta { color: #1c1b19; }
.reservation-form { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.reservation-form .rf-row { display: flex; gap: 10px; }
.reservation-form input, .reservation-form textarea {
    flex: 1; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2);
    color: var(--on-surface); font-size: 14px; font-family: inherit; min-width: 0;
}
.reservation-contact { margin-top: 14px; font-size: 13px; color: var(--on-surface-muted); }
.alert-success-inline { background: #e7f6e8; color: #2f7d33; padding: 10px 14px; border-radius: 10px; font-size: 13.5px; }
.alert-error-inline { background: #fbe6e6; color: #b23a3a; padding: 10px 14px; border-radius: 10px; font-size: 13.5px; }

/* ============================================================
   COS DE COMANDA + WHATSAPP
   ============================================================ */
.cart-bar {
    position: fixed; left: 16px; right: 16px; max-width: 610px; margin: 0 auto;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    background: var(--title-color, #1c1b19); color: #fff; border-radius: 999px; padding: 10px 10px 10px 20px;
    display: flex; align-items: center; justify-content: space-between; box-shadow: 0 12px 30px rgba(0,0,0,.3); z-index: 40;
}
.cart-bar-inner { font-size: 13.5px; font-weight: 600; }
.btn-view-cart { border: none; background: var(--brand); color: #1c1b19; font-weight: 700; padding: 10px 18px; border-radius: 999px; cursor: pointer; font-size: 13px; }

.cart-drawer {
    position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 60; display: flex; align-items: flex-end;
    opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
.cart-drawer.open { opacity: 1; pointer-events: auto; }
.cart-drawer-inner {
    background: var(--surface); color: var(--on-surface); width: 100%; max-height: 82vh; overflow-y: auto;
    border-radius: 20px 20px 0 0; padding: 22px 20px calc(26px + env(safe-area-inset-bottom, 0px)); position: relative;
}
.cart-drawer .modal-close { position: absolute; top: 14px; right: 16px; background: none; border: none; font-size: 22px; cursor: pointer; color: var(--on-surface-muted); }
.cart-line { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); gap: 10px; }
.cart-line-info { display: flex; flex-direction: column; font-size: 13.5px; }
.cart-line-info span { font-size: 12px; color: var(--on-surface-muted); }
.cart-line-actions { display: flex; align-items: center; gap: 6px; }
.cart-line-actions .qty-btn { background: var(--surface-2); }
.cart-remove { border: none; background: none; cursor: pointer; font-size: 14px; margin-left: 4px; }
.table-number-input { width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--on-surface); font-size: 15px; margin-top: 6px; }
.table-locked-badge {
    background: var(--surface-2); border: 1px dashed var(--brand); border-radius: 10px; padding: 10px 14px;
    font-size: 13.5px; font-weight: 600; color: var(--brand); margin-bottom: 14px;
}
.order-note-input { width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--on-surface); font-size: 14px; margin-top: 6px; font-family: inherit; resize: vertical; }
.cart-total-row { display: flex; justify-content: space-between; font-size: 16px; margin: 16px 0; font-weight: 700; }
.btn-whatsapp-order { width: 100%; background: #25D366; color: #fff; border: none; padding: 14px; border-radius: 999px; font-weight: 700; font-size: 15px; cursor: pointer; }

/* ============================================================
   SELECTOR DE LIMBA (Google Translate) - buton plutitor + dropdown elegant
   ============================================================ */
.lang-switcher { position: fixed; top: 16px; right: 16px; z-index: 55; }
.lang-toggle-btn {
    width: 44px; height: 44px; border-radius: 50%; border: none; cursor: pointer;
    background: rgba(255,255,255,.95); box-shadow: 0 6px 18px rgba(0,0,0,.18); font-size: 20px;
    display: flex; align-items: center; justify-content: center;
}
.lang-dropdown {
    position: absolute; top: 52px; right: 0; background: var(--surface); color: var(--on-surface);
    border-radius: 14px; box-shadow: 0 12px 30px rgba(0,0,0,.2); border: 1px solid var(--border);
    padding: 8px; width: 240px; max-height: 340px; display: flex; flex-direction: column;
    opacity: 0; pointer-events: none; transform: translateY(-6px);
    transition: opacity .15s ease, transform .15s ease;
}
.lang-dropdown.open { opacity: 1; pointer-events: auto; transform: translateY(0); }
.lang-dropdown-title { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--on-surface-muted); padding: 4px 6px 6px; }
.lang-search-input {
    width: 100%; padding: 8px 10px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface-2);
    color: var(--on-surface); font-size: 13.5px; margin-bottom: 6px; font-family: inherit;
}
.lang-options-list { overflow-y: auto; flex: 1; }
.lang-no-results { padding: 14px 10px; font-size: 13px; color: var(--on-surface-muted); text-align: center; }
.lang-option {
    display: block; width: 100%; text-align: left; background: none; border: none;
    padding: 9px 10px; border-radius: 9px; font-size: 13.5px; cursor: pointer; color: var(--on-surface);
}
.lang-option:hover { background: var(--surface-2); }

/* Ascunde complet interfata si artefactele vizuale pe care Google Translate le adauga automat -
   pastram doar mecanismul de traducere, fara nicio urma vizuala a widget-ului Google. */
.goog-te-banner-frame, .goog-te-balloon-frame, .skiptranslate iframe { display: none !important; }
.goog-te-gadget { height: 0 !important; overflow: hidden !important; }
body { top: 0 !important; position: static !important; }
.goog-tooltip, .goog-tooltip:hover { display: none !important; }
.goog-text-highlight { background: none !important; box-shadow: none !important; }
/* Popup-ul de "evalueaza traducerea" pe care Google il afiseaza cand dai click pe un text tradus */
#goog-gt-tt, .goog-te-spinner-pos, [id^="goog-gt-"], [class*="goog-te-balloon"] { display: none !important; }
/* Google adauga un cursor/subliniere pe cuvintele traduse care sugereaza ca poti da click pentru feedback - il eliminam */
font.goog-text-highlight, .goog-text-highlight * { cursor: inherit !important; text-decoration: none !important; }
font[style*="vertical-align: inherit"] { vertical-align: baseline !important; }

/* ============================================================
   FOOTER
   ============================================================ */
.menu-footer { text-align: center; padding: 24px; font-size: 12px; color: var(--on-surface-muted); }
.menu-footer a { color: var(--brand); text-decoration: none; font-weight: 600; }

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