/* ==========================================================================
   Pizzabey QR Menü — Yeni Tasarım (modern food-delivery stili)
   ========================================================================== */

:root {
    --ink: #1a1a1a;
    --ink-soft: #2b2b2b;
    --muted: #707579;
    --muted-2: #9aa0a6;
    --line: #ededed;
    --line-strong: #e0e0e0;
    --bg: #ffffff;
    --bg-soft: #f6f7f9;
    --primary: #fe7e00;          /* marka turuncusu (CTA / vurgu) */
    --primary-dark: #e86f00;
    --primary-ink: #ffffff;
    --success: #1faa59;
    --danger: #e23744;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
    --shadow-md: 0 6px 24px rgba(16, 24, 40, .10);
    --header-h: 132px;           /* mobil sticky header yüksekliği (yaklaşık) */
    --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font);
    color: var(--ink);
    background: var(--bg-soft);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* ---------------------------------------------------------------- Header */
.app-header {
    position: sticky;
    top: 0;
    z-index: 200;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
}

.app-header__top {
    max-width: 1180px;
    margin: 0 auto;
    padding: 8px 18px 8px 12px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 0;
    margin: 0;
}

.brand__logo {
    height: 104px;
    width: auto;
    max-width: none;
    padding: 0;
    margin: 0;
    border: 0;
    border-radius: 0;
    object-fit: contain;
    flex: 0 0 auto;
    display: block;
    background: transparent;
    vertical-align: top;
}

.brand__name {
    font-size: .9rem;
    font-weight: 600;
    letter-spacing: -.01em;
    color: var(--muted);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.search {
    margin-left: auto;
    display: flex;
    align-items: center;
    flex: 0 0 auto;
}

.search__btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border: 1.5px solid var(--line-strong);
    background: var(--bg);
    color: var(--ink);
    font-weight: 600;
    font-size: .95rem;
    padding: 10px 20px;
    border-radius: 999px;
    cursor: pointer;
    transition: border-color .2s, background .2s;
    white-space: nowrap;
}
.search__btn:hover { border-color: var(--ink); }
.search__btn i { font-size: .95rem; }

/* Genişleyen arama kutusu */
.search__field {
    display: none;
    align-items: center;
    gap: 8px;
    border: 1.5px solid var(--ink);
    background: var(--bg);
    border-radius: 999px;
    padding: 6px 8px 6px 16px;
    width: clamp(180px, 42vw, 360px);
}
.search.is-open .search__field { display: flex; }
.search.is-open .search__btn { display: none; }
.search__field input {
    border: 0;
    outline: 0;
    background: transparent;
    font-size: .95rem;
    width: 100%;
    color: var(--ink);
}
.search__close {
    border: 0;
    background: var(--bg-soft);
    color: var(--muted);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
}
.search__close:hover { color: var(--ink); }

/* Kategori sekmeleri (yatay) */
.cat-tabs {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 8px;
    display: flex;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
}
.cat-tabs::-webkit-scrollbar { display: none; }

.cat-tab {
    flex: 0 0 auto;
    position: relative;
    padding: 10px 12px 9px;
    font-size: .88rem;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    white-space: nowrap;
    border: 0;
    background: transparent;
    transition: color .2s;
}
.cat-tab::after {
    content: "";
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 0;
    height: 2px;
    border-radius: 2px 2px 0 0;
    background: transparent;
    transition: background .2s;
}
.cat-tab:hover { color: var(--ink-soft); }
.cat-tab.is-active { color: var(--ink); font-weight: 700; }
.cat-tab.is-active::after { background: var(--ink); }

/* ---------------------------------------------------------------- Layout */
.app-main {
    max-width: 1180px;
    margin: 0 auto;
    padding: 20px 18px 120px;
}

.layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 28px;
    align-items: start;
}

/* ---------------------------------------------------------- Ürün listesi */
.cat-section {
    scroll-margin-top: calc(var(--header-h) + 8px);
    margin-bottom: 36px;
}
.cat-section__title {
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: -.02em;
    margin: 6px 0 4px;
}
.cat-section__desc {
    color: var(--muted);
    margin: 0 0 12px;
    font-size: .95rem;
}

.product-list {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.product {
    display: flex;
    align-items: stretch;
    gap: 16px;
    padding: 18px;
    border-bottom: 1px solid var(--line);
    position: relative;
}
.product:last-child { border-bottom: 0; }

.product__media-col {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 104px;
}

.product__media {
    width: 100%;
    height: 104px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-soft);
}
.product__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.product__media--empty {
    display: grid;
    place-items: center;
    color: var(--muted-2);
    font-size: 1.6rem;
}

.product__body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.product__name {
    font-size: 1.08rem;
    font-weight: 700;
    margin: 0 0 6px;
    color: var(--ink);
    line-height: 1.25;
}

.product__desc {
    color: var(--muted);
    font-size: .9rem;
    line-height: 1.45;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product__footer {
    margin-top: auto;
    padding-top: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.product__price {
    font-size: .95rem;
    font-weight: 800;
    color: var(--ink);
    white-space: nowrap;
}

/* Sepete ekle butonu (resimdeki gibi: beyaz, ince kenarlı pill) */
.add-btn {
    border: 1.5px solid var(--line-strong);
    background: var(--bg);
    color: var(--ink);
    font-weight: 700;
    font-size: .82rem;
    padding: 6px 14px;
    border-radius: 999px;
    cursor: pointer;
    transition: all .18s ease;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(16,24,40,.05);
}
.add-btn:hover { border-color: var(--primary); color: var(--primary); }
.add-btn:active { transform: scale(.97); }

/* Miktar arttır/azalt */
.stepper {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    border: 1.5px solid var(--primary);
    border-radius: 999px;
    background: var(--bg);
    overflow: hidden;
}
.stepper__btn {
    border: 0;
    background: transparent;
    color: var(--primary);
    width: 28px;
    height: 28px;
    font-size: .82rem;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: background .15s;
}
.stepper__btn:hover { background: rgba(254,126,0,.10); }
.stepper__btn:active { transform: scale(.92); }
.stepper__val {
    min-width: 18px;
    text-align: center;
    font-weight: 800;
    color: var(--ink);
    font-size: .82rem;
    user-select: none;
}

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

.soldout {
    font-weight: 700;
    font-size: .9rem;
    color: var(--danger);
    background: rgba(226,55,68,.08);
    border-radius: 999px;
    padding: 9px 18px;
    white-space: nowrap;
}

/* Boş sonuç / boş menü */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--muted);
}
.empty-state i { font-size: 2.4rem; margin-bottom: 12px; color: var(--muted-2); }

/* ----------------------------------------------------------- Sepet paneli (geniş ekran) */
.cart-panel { display: none; }

@media (min-width: 992px) {
    .layout { grid-template-columns: minmax(0, 1fr) 340px; }
    .cart-panel {
        display: block;
        position: sticky;
        top: calc(var(--header-h-lg, 78px) + 16px);
        background: var(--bg);
        border: 1px solid var(--line);
        border-radius: var(--radius);
        box-shadow: var(--shadow-sm);
        overflow: hidden;
    }
}

.cart-panel__head {
    padding: 16px 18px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.cart-panel__head h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
}
.cart-panel__count {
    background: var(--primary);
    color: var(--primary-ink);
    font-size: .78rem;
    font-weight: 800;
    border-radius: 999px;
    padding: 3px 9px;
}

.cart-items {
    max-height: 46vh;
    overflow-y: auto;
    padding: 6px 0;
}
.cart-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
}
.cart-item__name { font-weight: 600; font-size: .92rem; line-height: 1.2; }
.cart-item__meta { color: var(--muted); font-size: .8rem; margin-top: 2px; }
.cart-item__price { margin-left: auto; font-weight: 800; font-size: .92rem; white-space: nowrap; }
.cart-item .stepper { transform: scale(.82); transform-origin: left center; }

.cart-empty {
    padding: 40px 18px;
    text-align: center;
    color: var(--muted);
    font-size: .92rem;
}
.cart-empty i { font-size: 2rem; display: block; margin-bottom: 10px; color: var(--muted-2); }

.cart-panel__foot { padding: 16px 18px; border-top: 1px solid var(--line); }
.cart-total-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 12px;
}
.cart-total-row span { color: var(--muted); font-weight: 600; }
.cart-total-row strong { font-size: 1.25rem; font-weight: 800; }

.btn-checkout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    background: var(--primary);
    color: var(--primary-ink);
    border: 0;
    border-radius: 999px;
    padding: 14px 18px;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    transition: background .2s, transform .1s;
}
.btn-checkout:hover { background: var(--primary-dark); }
.btn-checkout:active { transform: scale(.99); }
.btn-checkout[disabled] { background: var(--line-strong); color: var(--muted); cursor: not-allowed; }

.min-order-note {
    margin-top: 10px;
    font-size: .82rem;
    color: var(--danger);
    text-align: center;
}

/* --------------------------------------------------- Mobil sepet çubuğu */
.cart-bar {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 250;
    background: var(--primary);
    color: var(--primary-ink);
    border-radius: 16px;
    box-shadow: 0 8px 28px rgba(254,126,0,.40);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    transform: translateY(140%);
    transition: transform .28s cubic-bezier(.2,.8,.2,1);
}
.cart-bar.is-visible { transform: translateY(0); }
.cart-bar__count {
    background: rgba(255,255,255,.22);
    border-radius: 10px;
    padding: 6px 10px;
    font-weight: 800;
    font-size: .9rem;
}
.cart-bar__label { font-weight: 600; font-size: .82rem; opacity: .92; }
.cart-bar__total { font-weight: 800; font-size: 1.05rem; line-height: 1.1; }
.cart-bar__go {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(0,0,0,.16);
    color: #fff;
    padding: 11px 18px;
    border-radius: 999px;
    font-weight: 800;
    font-size: .95rem;
}
@media (min-width: 992px) { .cart-bar { display: none; } }

/* -------------------------------------------------------------- Toast */
.toast-stack {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: max-content;
    max-width: 92vw;
}
.toast-msg {
    background: var(--ink);
    color: #fff;
    padding: 11px 18px;
    border-radius: 999px;
    font-size: .9rem;
    font-weight: 600;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 8px;
    animation: toastIn .25s ease;
}
.toast-msg.is-success { background: var(--success); }
.toast-msg.is-error { background: var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

/* -------------------------------------------------------------- Footer */
.app-footer {
    background: #15171b;
    color: #c7ccd1;
    margin-top: 40px;
    padding: 40px 18px 110px;
}
@media (min-width: 992px) { .app-footer { padding-bottom: 40px; } }
.app-footer__inner {
    max-width: 1180px;
    margin: 0 auto;
    display: grid;
    gap: 28px;
    grid-template-columns: 1fr;
}
@media (min-width: 700px) { .app-footer__inner { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 992px) { .app-footer__inner { grid-template-columns: repeat(4, 1fr); } }
.app-footer h4 {
    color: var(--primary);
    font-size: 1.02rem;
    font-weight: 700;
    margin: 0 0 14px;
}
.app-footer p { margin: 0 0 8px; font-size: .92rem; line-height: 1.5; }
.app-footer i { width: 18px; color: var(--primary); margin-right: 8px; }
.app-footer a.social {
    display: inline-grid;
    place-items: center;
    width: 40px; height: 40px;
    border: 1px solid #3a3d44;
    border-radius: 50%;
    color: #fff;
    margin-top: 6px;
    transition: background .2s, border-color .2s;
}
.app-footer a.social:hover { background: var(--primary); border-color: var(--primary); }

/* Mobil iletişim butonları (alt köşe yerine footer içi/üstü) */
.view-banner {
    max-width: 1180px;
    margin: 0 auto 6px;
    background: #fff7ec;
    border: 1px solid #ffe2bd;
    color: #92600f;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: .9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Sadece-görüntüleme modunda sepet/footer butonları gizli */
.is-view-only .cart-bar,
.is-view-only .cart-panel { display: none !important; }

@media (min-width: 992px) {
    :root { --header-h: 78px; }
    .brand__logo { height: 112px; }
    .brand__name { font-size: .95rem; }
    .cat-section__title { font-size: 1.6rem; }
}

/* mobil */
@media (max-width: 991px) {
    .app-header__top {
        flex-wrap: wrap;
        gap: 8px;
        padding: 6px 12px 6px 10px;
    }
    .brand {
        flex: 1 1 auto;
        min-width: 0;
        align-items: center;
        gap: 6px;
    }
    .search {
        margin-left: 0;
        flex: 1 1 100%;
        width: 100%;
    }
    .search__btn {
        width: 100%;
        justify-content: flex-start;
        padding: 7px 14px;
        font-size: .82rem;
        gap: 8px;
        border-width: 1px;
    }
    .search__btn i { font-size: .85rem; }
    .search__field {
        width: 100%;
        padding: 5px 8px 5px 14px;
    }
    .search__field input { font-size: .85rem; }

    .product__name { font-size: .95rem; }
    .product__desc {
        font-size: .78rem;
        -webkit-line-clamp: 5;
        line-clamp: 5;
    }
    .product__price { font-size: .82rem; }
    .add-btn {
        font-size: .75rem;
        padding: 5px 12px;
    }
}

/* ------------------------------------------------------- Resim tıklanabilir */
.product__media.has-lb { cursor: zoom-in; }
.product__media.has-lb img { transition: opacity .15s; }
.product__media.has-lb:hover img { opacity: .88; }

/* --------------------------------------------------------- Resim Lightbox */
.lb-overlay {
    position: fixed;
    inset: 0;
    z-index: 9200;
    background: rgba(0, 0, 0, .92);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
    padding: 20px;
}
.lb-overlay.is-open {
    opacity: 1;
    pointer-events: all;
}
.lb-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, .15);
    border: 0;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: grid;
    place-items: center;
    font-size: .9rem;
    font-family: inherit;
}
.lb-close:hover { background: rgba(255, 255, 255, .28); }
.lb-img-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: min(92vw, 520px);
    max-height: 72vh;
}
.lb-img {
    max-width: 100%;
    max-height: 72vh;
    border-radius: 14px;
    object-fit: contain;
    transform: scale(.88);
    transition: transform .26s cubic-bezier(.32, 0, .15, 1);
    display: block;
}
.lb-overlay.is-open .lb-img { transform: scale(1); }
.lb-caption {
    margin-top: 14px;
    color: rgba(255, 255, 255, .85);
    font-size: .88rem;
    font-weight: 600;
    text-align: center;
    max-width: min(92vw, 520px);
    line-height: 1.4;
}

/* -------------------------------------------------- Besin Değerleri Rozeti */
.nutr-btn {
    position: static;
    transform: none;
    background: var(--bg-soft);
    color: var(--ink);
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: .01em;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid var(--line);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    font-family: inherit;
    transition: background .15s, border-color .15s;
    line-height: 1;
    max-width: 100%;
}
.nutr-btn i { color: var(--primary); font-size: .58rem; }
.nutr-btn:hover { background: #fff7ec; border-color: #ffe2bd; }

/* -------------------------------------------------- Besin Değerleri Sheet */
.nutr-overlay {
    position: fixed;
    inset: 0;
    z-index: 9100;
    background: rgba(0, 0, 0, .38);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s ease;
}
.nutr-overlay.is-open {
    opacity: 1;
    pointer-events: all;
}
.nutr-sheet {
    background: var(--bg);
    width: 100%;
    max-width: 480px;
    border-radius: 20px 20px 0 0;
    padding: 20px 20px 32px;
    transform: translateY(100%);
    transition: transform .28s cubic-bezier(.32, 0, .15, 1);
}
.nutr-overlay.is-open .nutr-sheet {
    transform: translateY(0);
}
.nutr-sheet__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.nutr-sheet__title {
    font-size: .95rem;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.3;
    max-width: calc(100% - 40px);
}
.nutr-sheet__close {
    border: 0;
    background: var(--bg-soft);
    color: var(--muted);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: grid;
    place-items: center;
    font-size: .78rem;
    flex: 0 0 auto;
}
.nutr-sheet__close:hover { color: var(--ink); }
.nutr-table {
    width: 100%;
    border-collapse: collapse;
}
.nutr-table tr { border-bottom: 1px solid var(--line); }
.nutr-table tr:last-child { border-bottom: 0; }
.nutr-table th {
    text-align: left;
    font-size: .82rem;
    color: var(--muted);
    font-weight: 500;
    padding: 11px 0;
    width: 55%;
}
.nutr-table td {
    text-align: right;
    font-size: .9rem;
    font-weight: 700;
    color: var(--ink);
    padding: 11px 0;
}
.nutr-row--kcal th { color: var(--ink); font-weight: 600; }
.nutr-row--kcal td { color: var(--primary); font-size: 1rem; }
.nutr-disclaimer {
    margin: 14px 0 0;
    font-size: .72rem;
    color: var(--muted-2);
    text-align: center;
}

/* küçük telefonlar */
@media (max-width: 380px) {
    .app-header__top { padding: 4px 10px 4px 8px; gap: 6px; }
    .search__btn {
        padding: 6px 12px;
        font-size: .78rem;
    }
    .product__media-col { width: 84px; }
    .product__media { height: 84px; }
    .product { padding: 14px; gap: 12px; }
    .product__name { font-size: .88rem; }
    .product__desc {
        font-size: .72rem;
        -webkit-line-clamp: 6;
        line-clamp: 6;
    }
    .product__price { font-size: .76rem; }
    .add-btn {
        font-size: .7rem;
        padding: 4px 10px;
    }
    .brand__logo { height: 92px; }
    .brand__name { font-size: .82rem; }
}
