/* ==========================================================================
   DENGE — sağlıklı kase / vegan / salata (dm-tema F14)
   Kartın kenarından taşan yuvarlak tabak fotoğrafı, kalori halkası (günlük
   2.000 kcal referans alımına oranı; halka dolgusu = oran), alerjenler tam
   adıyla (Unbounded + Onest). Açık varsayılan; "Koyu" seçilirse gece yeşili.
   ========================================================================== */
:root {
    --dg-bg: #F2F6F1;
    --dg-card: #FFFFFF;
    --dg-ink: #1B2A1F;
    --dg-muted: #56675A;
    --dg-line: #E0E8DD;
    --dg-acc: var(--theme-color-1, #2F7D46);
    --dg-acc-soft: var(--theme-color-0_08, rgba(47, 125, 70, .08));
    --dg-acc-16: var(--theme-color-0_16, rgba(47, 125, 70, .16));
    --dg-acc-35: var(--theme-color-0_35, rgba(47, 125, 70, .35));
    --dg-on-acc: var(--theme-on-accent, #fff);
    --dg-acc2-soft: var(--theme-accent2-0_16, rgba(242, 165, 65, .16));
    --dg-acc2: var(--theme-accent2-1, #F2A541);
    --dg-shadow: rgba(27, 42, 31, .10);
    --dg-display: 'Unbounded', 'Onest', sans-serif;
    --dg-text: 'Onest', -apple-system, 'Segoe UI', sans-serif;
}
body[data-theme-mode="dark"] {
    --dg-bg: #0F1712;
    --dg-card: #16211A;
    --dg-ink: #E7F0E8;
    --dg-muted: #9FB3A4;
    --dg-line: rgba(231, 240, 232, .10);
    --dg-acc: var(--theme-accent-dark-1, #6FBF83);
    --dg-acc-soft: var(--theme-accent-dark-0_12, rgba(111, 191, 131, .12));
    --dg-acc-16: var(--theme-accent-dark-0_16, rgba(111, 191, 131, .16));
    --dg-acc-35: var(--theme-accent-dark-0_35, rgba(111, 191, 131, .35));
    --dg-on-acc: var(--theme-on-accent-dark, #111);
    --dg-shadow: rgba(0, 0, 0, .35);
}

body {
    margin: 0; color: var(--dg-ink);
    font-family: var(--dg-text);
    -webkit-font-smoothing: antialiased;
    background: var(--dg-bg);
}
body.noscroll { overflow: hidden; }

.overlay {
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(15, 30, 20, .45);
    opacity: 0; pointer-events: none; transition: opacity .25s;
}
.overlay.active { opacity: 1; pointer-events: auto; }

/* --- Başlık: sola yaslı kart --- */
.dg-head {
    position: relative; overflow: hidden;
    background: var(--dg-card);
    border-radius: 0 0 30px 30px;
    padding: 26px 18px 18px;
    box-shadow: 0 10px 30px var(--dg-shadow);
}
.dg-head::before, .dg-head::after { /* yaprak lekeleri */
    content: ''; position: absolute; border-radius: 50%; pointer-events: none;
}
.dg-head::before {
    width: 190px; height: 190px; top: -80px; inset-inline-end: -60px;
    background: var(--dg-acc-soft);
}
.dg-head::after {
    width: 90px; height: 90px; top: 34px; inset-inline-end: 58px;
    background: var(--dg-acc2-soft);
}
.dg-head-row { position: relative; z-index: 1; display: flex; align-items: center; gap: 14px; max-width: 1000px; margin: 0 auto; }
.dg-logo {
    width: 64px; height: 64px; flex: 0 0 64px; border-radius: 50%; object-fit: cover;
    box-shadow: 0 0 0 4px var(--dg-card), 0 0 0 6px var(--dg-acc-16);
}
.dg-head-text { min-width: 0; }
.dg-name {
    margin: 0; font-family: var(--dg-display); font-weight: 700;
    font-size: clamp(21px, 6.2vw, 30px); line-height: 1.12; letter-spacing: -.01em;
    color: var(--dg-ink); text-wrap: balance;
}
.dg-sub { margin: 5px 0 0; font-size: 13.5px; font-weight: 500; color: var(--dg-muted); }
.dg-actions {
    position: relative; z-index: 1;
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    max-width: 1000px; margin: 16px auto 0;
}
.dg-pill {
    display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
    background: var(--dg-acc-soft); color: var(--dg-ink);
    border: 0; border-radius: 999px;
    padding: 9px 14px; font-family: var(--dg-text); font-size: 13px; font-weight: 600; line-height: 1;
}
.dg-pill i { color: var(--dg-acc); font-size: 14px; }
.dg-pill:focus-visible, .dg-chip:focus-visible, .dg-add:focus-visible, .dg-servis:focus-visible, .dg-cartbar-btn:focus-visible {
    outline: 2px solid var(--dg-acc); outline-offset: 2px;
}

/* dil menüsü */
.dg-lang { position: relative; }
.dg-lang-menu {
    display: none; position: absolute; inset-inline-end: 0; inset-inline-start: auto; text-align: start;
    top: calc(100% + 8px); z-index: 960;
    min-width: 150px; max-width: calc(100vw - 24px); padding: 6px;
    background: var(--dg-card); border: 1px solid var(--dg-line); border-radius: 16px;
    box-shadow: 0 18px 40px var(--dg-shadow);
}
.dg-lang-menu.show { display: block; }
.dg-lang-menu .dropdown-item {
    display: block; padding: 9px 12px; border-radius: 10px; background: transparent;
    color: var(--dg-ink); font-size: 13.5px; font-weight: 500; text-decoration: none;
}
.dg-lang-menu .dropdown-item:hover, .dg-lang-menu .dropdown-item:focus { background: var(--dg-acc-soft); color: var(--dg-ink); }

/* --- Arama --- */
.dg-search-row { padding: 14px 16px 0; max-width: 1000px; margin: 0 auto; box-sizing: border-box; }
.dg-search-row[hidden] { display: none !important; }
.dg-search-row input {
    width: 100%; box-sizing: border-box; outline: none;
    background: var(--dg-card); color: var(--dg-ink);
    border: 1.5px solid var(--dg-line); border-radius: 16px;
    padding: 12px 16px; font-family: var(--dg-text); font-size: 15px;
}
.dg-search-row input::placeholder { color: var(--dg-muted); opacity: 1; }
.dg-search-row input:focus { border-color: var(--dg-acc); }

/* --- Çipler --- */
.dg-chips {
    position: sticky; top: 0; z-index: 500;
    display: flex; gap: 8px; overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; padding: 14px 16px 12px;
    background: linear-gradient(180deg, var(--dg-bg) 82%, transparent);
}
.dg-chips::-webkit-scrollbar { display: none; }
.dg-chip {
    flex: 0 0 auto; cursor: pointer; white-space: nowrap;
    background: var(--dg-card); color: var(--dg-ink);
    border: 1.5px solid var(--dg-line); border-radius: 14px;
    padding: 9px 15px; font-family: var(--dg-text); font-size: 13.5px; font-weight: 600; line-height: 1.1;
    transition: background .2s, color .2s, border-color .2s;
}
.dg-chip.active { background: var(--dg-acc); border-color: var(--dg-acc); color: var(--dg-on-acc); }

/* --- Gövde --- */
.dg-body { max-width: 1000px; margin: 0 auto; padding: 0 16px 150px; box-sizing: border-box; }
.dg-cat-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 22px 2px 16px; }
.dg-cat-title {
    margin: 0; font-family: var(--dg-display); font-weight: 600;
    font-size: 19px; line-height: 1.2; letter-spacing: -.01em; color: var(--dg-ink);
}
.dg-cat-count {
    background: var(--dg-acc-soft); color: var(--dg-acc);
    border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 700;
}
body[data-theme-mode="dark"] .dg-cat-count { color: var(--dg-ink); }
.dg-subhead {
    margin: 18px 2px 12px;
    font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
    color: var(--dg-muted);
}
.dg-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }

/* --- Ürün: tabak kenardan taşar --- */
.dg-item {
    position: relative; display: flex; gap: 14px; align-items: flex-start;
    background: var(--dg-card);
    border-radius: 24px;
    margin-inline-start: 12px;
    padding: 14px 14px 14px 0;
    padding-inline-start: 0; padding-inline-end: 14px;
    box-shadow: 0 8px 22px var(--dg-shadow);
}
.dg-plate {
    position: relative; flex: 0 0 104px; width: 104px; height: 104px;
    margin-inline-start: -12px; margin-top: 2px; cursor: pointer;
    border-radius: 50%;
    box-shadow: 0 0 0 5px var(--dg-card), 0 12px 24px rgba(27, 42, 31, .20);
    background: var(--dg-acc-soft);
}
.dg-plate img, .dg-item-noimg { width: 104px; height: 104px; border-radius: 50%; object-fit: cover; display: block; }
.dg-item-noimg { display: flex; align-items: center; justify-content: center; color: var(--dg-acc); font-size: 30px; }
.dg-item-type {
    position: absolute; bottom: 2px; inset-inline-end: 2px;
    width: 22px; height: 22px; padding: 0; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--dg-card); font-size: 7px; box-shadow: 0 2px 6px rgba(0, 0, 0, .15);
}
.dg-item-type.veg { color: #2F9E44; }
.dg-item-type.nonveg { color: #D9480F; }
.dg-item-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; min-height: 104px; }
.dg-item-name { margin: 2px 0 0; cursor: pointer; font-size: 16px; font-weight: 700; line-height: 1.25; color: var(--dg-ink); }
.dg-item-desc {
    margin: 4px 0 0; cursor: pointer;
    font-size: 13px; line-height: 1.5; color: var(--dg-muted);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.dg-facts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.dg-ring {
    position: relative; flex: 0 0 auto;
    display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
    width: 48px; height: 48px; border-radius: 50%;
    color: var(--dg-ink); line-height: 1;
}
.dg-ring::before { /* halka: dolgu = günlük referans alımın yüzdesi */
    content: ''; position: absolute; inset: 0; border-radius: 50%;
    background: conic-gradient(var(--dg-acc) calc(var(--p, 0) * 1%), var(--dg-line) 0);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4.5px));
            mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4.5px));
}
.dg-ring b { position: relative; font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.dg-ring small { position: relative; font-size: 8.5px; font-weight: 600; color: var(--dg-muted); margin-top: 1px; }
.dg-body .dg-algs { display: inline-flex; gap: 5px; flex-wrap: wrap; }
.dg-body .dg-algs i {
    display: inline-block; max-width: 100%; box-sizing: border-box;
    font-style: normal; font-size: 11.5px; font-weight: 600; line-height: 1.3;
    background: var(--dg-acc2-soft); color: var(--dg-ink);
    border-radius: 12px; padding: 4px 9px;
}
.dg-item-foot {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    margin-top: auto; padding-top: 12px;
}
.dg-item-price { font-size: 17px; font-weight: 700; color: var(--dg-ink); font-variant-numeric: tabular-nums; }
.dg-add {
    display: inline-flex; align-items: center; gap: 5px; cursor: pointer;
    background: var(--dg-acc); color: var(--dg-on-acc);
    border: 0; border-radius: 999px; padding: 9px 16px;
    font-family: var(--dg-text); font-size: 13px; font-weight: 700; line-height: 1;
    box-shadow: 0 8px 18px var(--dg-acc-35);
    transition: transform .12s;
}
.dg-add:active { transform: scale(.95); }

.dg-no-result[hidden] { display: none !important; }
.dg-no-result { text-align: center; padding: 28px 0; font-size: 14px; color: var(--dg-muted); }
.dg-brand { text-align: center; padding: 28px 0 0; font-size: 11.5px; color: var(--dg-muted); opacity: .8; }
.dg-body .dm-empty-cat { color: var(--dg-muted); }

#menuDetail .dg-algs { display: inline-flex; gap: 6px; flex-wrap: wrap; }
#menuDetail .dg-algs i {
    font-style: normal; font-size: 12px; font-weight: 600; color: #333;
    background: #F1F1F3; border-radius: 999px; padding: 4px 10px;
}

/* --- Sepet çubuğu --- */
.dg-cartbar {
    position: fixed; left: 14px; right: 14px;
    bottom: max(14px, env(safe-area-inset-bottom)); z-index: 900;
}
.dg-cartbar.none { display: none; }
.dg-cartbar-btn {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    width: 100%; min-height: 54px; cursor: pointer;
    background: var(--dg-acc); color: var(--dg-on-acc);
    border: 0; border-radius: 20px; padding: 0 18px;
    font-family: var(--dg-text); font-size: 14.5px; font-weight: 700;
    box-shadow: 0 14px 30px var(--dg-acc-35);
}
.dg-cartbar-count { opacity: .9; font-size: 13px; }
.dg-cartbar-price { font-variant-numeric: tabular-nums; }

/* --- Servis --- */
.dg-servis {
    position: fixed; inset-inline-end: 14px; bottom: 84px; z-index: 890; cursor: pointer;
    background: var(--dg-card); color: var(--dg-ink);
    border: 1.5px solid var(--dg-line); border-radius: 999px;
    padding: 11px 17px; font-family: var(--dg-text); font-size: 13px; font-weight: 700; line-height: 1;
    box-shadow: 0 12px 28px var(--dg-shadow);
}
.dg-servis i { color: var(--dg-acc); }

.dm-preview-bar { bottom: 140px !important; }

@media (min-width: 760px) {
    .dg-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 22px; }
    .dg-chips { flex-wrap: wrap; overflow-x: visible; justify-content: flex-start; max-width: 1000px; margin: 0 auto; box-sizing: border-box; }
    .dg-cartbar { left: 50%; right: auto; width: min(640px, calc(100vw - 28px)); transform: translateX(-50%); }
    .dg-servis { inset-inline-end: 24px; }
}
@media (max-width: 350px) {
    .dg-plate, .dg-plate img, .dg-item-noimg { width: 84px; height: 84px; }
    .dg-plate { flex-basis: 84px; }
    .dg-item-body { min-height: 84px; }
}
@media (prefers-reduced-motion: reduce) {
    .dg-chip, .dg-add { transition: none; }
}
