/* ============================================
   QR MENÜ - Public CSS (v3)
   Dark/Light mode, tüm stiller değişkenlerle
   ============================================ */

* { box-sizing: border-box; }

:root {
    --accent: #d2691e;
    --radius: 14px;
    --img-radius: 50%;
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --shadow-card: 0 8px 32px rgba(0,0,0,.5);
    --shadow-modal: 0 30px 90px rgba(0,0,0,.6);
    --transition: .25s ease;
}

/* DARK MODE (default) */
:root,
:root[data-theme="dark"],
html[data-theme="dark"],
body[data-theme="dark"] {
    --bg: var(--dark-bg, #0e0e0e);
    --card: var(--dark-card, #1a1a1a);
    --card-2: rgba(255,255,255,.04);
    --text: var(--dark-text, #f0f0f0);
    --text-dim: rgba(240,240,240,.7);
    --text-mute: rgba(240,240,240,.45);
    --border: rgba(255,255,255,.08);
    --header-bg: rgba(14,14,14,.92);
    --modal-bg: var(--dark-card, #1a1a1a);
    --backdrop: rgba(0,0,0,.7);
    --btn-bg: rgba(255,255,255,.06);
    --btn-hover: rgba(255,255,255,.12);
    --cat-overlay: linear-gradient(90deg, rgba(0,0,0,.85) 0%, rgba(0,0,0,.55) 50%, rgba(0,0,0,.2) 100%);
    --cat-fallback: #2a2a2a;
}

/* LIGHT MODE */
:root[data-theme="light"],
html[data-theme="light"],
body[data-theme="light"] {
    --bg: var(--light-bg, #f6f5f0);
    --card: var(--light-card, #ffffff);
    --card-2: rgba(0,0,0,.025);
    --text: var(--light-text, #1a1a1a);
    --text-dim: rgba(26,26,26,.7);
    --text-mute: rgba(26,26,26,.5);
    --border: rgba(0,0,0,.08);
    --header-bg: rgba(255,255,255,.92);
    --modal-bg: var(--light-card, #ffffff);
    --backdrop: rgba(0,0,0,.5);
    --btn-bg: rgba(0,0,0,.05);
    --btn-hover: rgba(0,0,0,.1);
    --cat-overlay: linear-gradient(90deg, rgba(0,0,0,.7) 0%, rgba(0,0,0,.4) 50%, rgba(0,0,0,.15) 100%);
    --cat-fallback: #e8e8e8;
    --shadow-card: 0 4px 16px rgba(0,0,0,.08);
}

/* ============================================
   ARKA PLAN SİSTEMİ
   3 tip: theme (mode'a göre), color (sabit), image (resim+overlay)
   ============================================ */
html {
    margin: 0;
    padding: 0;
    min-height: 100%;
    transition: background-color var(--transition);
}
body {
    margin: 0;
    padding: 0;
    background-color: transparent;
    color: var(--text);
    font-family: var(--font-family);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    transition: color var(--transition);
}

/* Tip: theme - dark/light moda göre */
html[data-bg="theme"] {
    background-color: var(--bg);
    background-image: none;
}
/* Tip: color - sabit renk (mode'tan bağımsız) */
html[data-bg="color"] {
    background-color: var(--bg-fixed, #0e0e0e);
    background-image: none;
}
/* Tip: image - inline style ile uygulanır (linear-gradient + url) */
/* html[data-bg="image"] inline style.lar PHP'den geliyor */

img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }

/* ============================================
   HEADER
   ============================================ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--header-bg);
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}
body[data-header="glass"] .site-header {
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}
body[data-header="solid"] .site-header {
    background: var(--card);
}

.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.brand { display: flex; align-items: center; min-width: 0; flex: 1; }
.logo { max-height: 44px; width: auto; }
.brand-text {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: .3px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }

.icon-btn, .info-btn {
    background: var(--btn-bg);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 12px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    transition: all .2s;
}
.icon-btn { padding: 8px; }
.icon-btn:hover, .info-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* Sun/moon icon değişimi */
.icon-btn .ic-sun { display: none; }
.icon-btn .ic-moon { display: block; }
body[data-theme="light"] .icon-btn .ic-sun { display: block; }
body[data-theme="light"] .icon-btn .ic-moon { display: none; }

/* ============================================
   STICKY KATEGORİ NAVİGASYONU
   ============================================ */
.cat-nav {
    position: sticky;
    top: 70px;
    z-index: 45;
    background: var(--header-bg);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
body[data-header="glass"] .cat-nav {
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}
body[data-header="solid"] .cat-nav { background: var(--card); }
.cat-nav::-webkit-scrollbar { display: none; }
.cat-nav-inner {
    display: flex;
    gap: 6px;
    padding: 10px 16px;
    white-space: nowrap;
    max-width: 1100px;
    margin: 0 auto;
    width: max-content;
    min-width: 100%;
}
.cat-nav-item {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: var(--btn-bg);
    color: var(--text);
    border-radius: 999px;
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none;
    transition: all .2s;
    border: 1px solid transparent;
    cursor: pointer;
}
.cat-nav-item:hover {
    background: var(--btn-hover);
    color: var(--text);
}
.cat-nav-item.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
}

@media (max-width: 480px) {
    .cat-nav { top: 60px; }
    .cat-nav-inner { padding: 8px 12px; gap: 5px; }
    .cat-nav-item { padding: 7px 13px; font-size: 13px; }
}

/* ============================================
   MODAL (Bilgi popup) - FIXED & RESPONSIVE
   ============================================ */
.modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.modal[aria-hidden="false"] {
    display: flex;
    animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: var(--backdrop);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    cursor: pointer;
}

.modal-dialog {
    position: relative;
    background: var(--modal-bg);
    color: var(--text);
    border-radius: var(--radius);
    width: 100%;
    max-width: 460px;
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-modal);
    border: 1px solid var(--border);
    animation: scaleIn .25s cubic-bezier(.34,1.56,.64,1);
    overflow: hidden;
}
@keyframes scaleIn {
    from { transform: scale(.92); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    background: var(--btn-bg);
    color: var(--text);
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s;
}
.modal-close:hover { background: var(--accent); color: #fff; }

.modal-body {
    padding: 32px 26px 26px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal-logo {
    max-height: 60px;
    width: auto;
    margin: 0 auto 12px;
}

.modal-title {
    margin: 0 0 20px;
    color: var(--accent);
    font-size: 22px;
    text-align: center;
}

.info-item {
    margin-bottom: 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.info-item:last-of-type { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.info-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 6px;
}

.info-item p {
    margin: 0;
    color: var(--text-dim);
    line-height: 1.6;
    font-size: 15px;
}
.info-item a { color: var(--text); }
.info-item a:hover { color: var(--accent); }

.social-links {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}
.social-btn {
    background: var(--btn-bg);
    color: var(--text) !important;
    padding: 10px 16px;
    border-radius: 999px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all .2s;
    flex: 1;
    justify-content: center;
    min-width: 120px;
}
.social-btn:hover { background: var(--accent); color: #fff !important; }

/* ============================================
   MENU
   ============================================ */
.menu {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-dim);
}

/* ============================================
   KATEGORİ - Card layout (default, görselli)
   ============================================ */
.category {
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-card);
    transition: background var(--transition);
}
.category-header {
    position: relative;
    width: 100%;
    border: none;
    padding: 0;
    cursor: pointer;
    color: inherit;
    text-align: left;
    overflow: hidden;
    display: block;
    background: transparent;
    font-family: inherit;
}

/* Card style (banner görselli) */
body[data-cat="card"] .category-header {
    min-height: 140px;
}
body[data-cat="card"] .cat-bg {
    position: absolute; inset: 0;
    background-size: cover;
    background-position: center;
    background-color: var(--cat-fallback);
    transition: transform .5s;
}
body[data-cat="card"] .category-header:hover .cat-bg { transform: scale(1.04); }
body[data-cat="card"] .cat-overlay {
    position: absolute; inset: 0;
    background: var(--cat-overlay);
}
body[data-cat="card"] .cat-title-wrap {
    position: relative;
    padding: 28px 60px 28px 28px;
    z-index: 1;
}
body[data-cat="card"] .cat-title {
    color: #fff;
    text-shadow: 0 2px 8px rgba(0,0,0,.6);
}
body[data-cat="card"] .cat-desc {
    color: rgba(255,255,255,.85);
    text-shadow: 0 1px 4px rgba(0,0,0,.6);
}

/* Banner style (sade, ikon ve metin) */
body[data-cat="banner"] .category-header {
    background: var(--card);
    padding: 0;
}
body[data-cat="banner"] .cat-title-wrap {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 56px 18px 20px;
}
body[data-cat="banner"] .cat-icon {
    width: 52px; height: 52px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--card-2);
    flex-shrink: 0;
    border: 2px solid var(--border);
}
body[data-cat="banner"] .cat-icon img {
    width: 100%; height: 100%; object-fit: cover;
}
body[data-cat="banner"] .cat-title { color: var(--text); }
body[data-cat="banner"] .cat-desc { color: var(--text-dim); }
body[data-cat="banner"] .chevron {
    background: var(--btn-bg);
    color: var(--text);
}

.cat-title {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: .3px;
    line-height: 1.2;
}
.cat-desc {
    margin: 4px 0 0;
    font-size: 13.5px;
    line-height: 1.4;
}

.chevron {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px; height: 36px;
    background: rgba(255,255,255,.18);
    color: #fff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .3s, background .2s;
    z-index: 2;
}
.category-header[aria-expanded="true"] .chevron {
    transform: translateY(-50%) rotate(180deg);
    background: var(--accent);
    color: #fff;
}

/* Ürün listesi açılır */
.products-wrap {
    max-height: 0;
    overflow: hidden;
    transition: max-height .5s ease;
}
.products {
    padding: 8px 20px 22px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
}
@media (min-width: 720px) {
    .products { grid-template-columns: 1fr 1fr; column-gap: 36px; padding: 8px 26px 26px; }
}

.no-products {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-mute);
    padding: 20px;
    font-style: italic;
}

/* ============================================
   ÜRÜN
   ============================================ */
.product {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}
.product:last-child { border-bottom: none; }
@media (min-width: 720px) {
    .product:nth-last-child(2):nth-child(odd) { border-bottom: none; }
}

.product-img {
    flex: 0 0 64px;
    width: 64px;
    height: 64px;
    border-radius: var(--img-radius);
    overflow: hidden;
    background: var(--card-2);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--border);
}
.product-img img { width: 100%; height: 100%; object-fit: cover; }
.no-img { font-size: 28px; opacity: .4; }

.product-body { flex: 1; min-width: 0; }
.product-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 4px;
}
.product-name {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
}

/* Fiyat stilleri */
.product-price {
    white-space: nowrap;
    flex-shrink: 0;
    font-weight: 700;
}
body[data-price="accent"] .product-price {
    color: var(--accent);
    font-size: 18px;
}
body[data-price="boxed"] .product-price {
    background: var(--accent);
    color: #fff;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 14px;
}
body[data-price="underline"] .product-price {
    color: var(--text);
    font-size: 17px;
    border-bottom: 2px solid var(--accent);
    padding-bottom: 2px;
}

.product-desc {
    margin: 4px 0 0;
    color: var(--text-dim);
    font-size: 13.5px;
    line-height: 1.5;
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-mute);
    font-size: 13px;
    border-top: 1px solid var(--border);
    margin-top: 30px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 480px) {
    .header-inner { padding: 12px 14px; }
    .brand-text { font-size: 17px; }
    .info-btn span { display: none; }
    .menu { padding: 14px; gap: 10px; }
    body[data-cat="card"] .category-header { min-height: 120px; }
    body[data-cat="card"] .cat-title-wrap { padding: 20px 52px 20px 18px; }
    body[data-cat="banner"] .cat-title-wrap { padding: 14px 50px 14px 16px; gap: 12px; }
    body[data-cat="banner"] .cat-icon { width: 44px; height: 44px; }
    .cat-title { font-size: 20px; }
    .cat-desc { font-size: 12.5px; }
    .chevron { right: 12px; width: 32px; height: 32px; border-radius: 8px; }
    .product-img { flex-basis: 56px; width: 56px; height: 56px; }
    .product-name { font-size: 15.5px; }
    body[data-price="accent"] .product-price { font-size: 16px; }
    .product-desc { font-size: 13px; }
    .modal-body { padding: 28px 20px 22px; }
    .modal-title { font-size: 19px; }
}

/* Font seçenekleri */
body { font-family: var(--font-family); }
