/* =========================================
   1. GENEL AYARLAR (Sticky Footer İçin Güncellendi)
   ========================================= */
:root {
    --main-color: #d4af37;
    --price-color: #28a745;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    /* Varsayılan renk index.php'den geliyor */
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #e0e0e0;
    margin: 0; padding: 0;
    
    /* STICKY FOOTER AYARLARI */
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* Ekranın en az %100'ü kadar yüksek ol */
    
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
}

/* İçerik alanının (container) kalan boşluğu doldurmasını sağla */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 15px;
    width: 100%;
    flex: 1; /* Bu kod Footer'ı aşağı iter */
}

/* =========================================
   2. HEADER
   ========================================= */
header {
    background-color: rgba(0,0,0,0.95);
    padding: 15px 0;
    position: sticky; top: 0; z-index: 1000;
    border-bottom: 1px solid #333;
    width: 100%; display: flex; justify-content: center;
}

.header-center { width: 100%; max-width: 1100px; padding: 0 15px; margin: 0 auto; }
.header-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }

.logo-link { text-decoration: none; color: inherit; display: flex; align-items: center; }
.logo-link img { height: 60px; width: auto; max-width: 180px; object-fit: contain; transition: all 0.3s ease; }
.logo-link h1 { margin: 0; font-size: 20px; color: #fff; font-weight: bold; }
@media (max-width: 600px) { .logo-link img { height: 35px; max-width: 140px; } .logo-link h1 { font-size: 18px; } }

.lang-switch { display: flex; gap: 8px; }
.lang-btn { text-decoration: none; color: #fff; padding: 6px 10px; border: 1px solid #444; border-radius: 4px; font-size: 12px; background: #222; transition: 0.3s; }
.lang-btn.active { background: var(--main-color); color: #000; border-color: var(--main-color); font-weight: bold; }

#search-box { width: 100%; padding: 12px; border-radius: 25px; border: 1px solid #444; background-color: #222; color: #fff; outline: none; font-size: 15px; display: block; }

/* =========================================
   3. İÇERİK VE KATEGORİ BANNER
   ========================================= */
.container { max-width: 1100px; margin: 0 auto; padding: 15px; width: 100%; }

.category-banner {
    width: 100%; height: 70px;
    background-size: cover; background-position: center;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 20px; margin-top: 20px; margin-bottom: 10px;
    cursor: pointer; position: relative; overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.5); transition: transform 0.2s;
}
.category-banner:active { transform: scale(0.98); }
.category-banner::before { content: ""; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 1; }
.category-banner h2 { color: #fff; font-size: 18px; text-transform: uppercase; letter-spacing: 1px; text-shadow: 2px 2px 4px #000; z-index: 2; margin: 0; }
.category-banner::after { content: "▼"; color: var(--main-color); font-size: 16px; z-index: 2; transition: transform 0.3s; }
.category-banner.active::after { transform: rotate(180deg); }

/* =========================================
   4. ÜRÜN KARTLARI (BEYAZ & 9:16)
   ========================================= */
.accordion-content { display: none !important; opacity: 0; transition: opacity 0.4s ease-in-out; }
.accordion-content.show { display: grid !important; opacity: 1; grid-template-columns: repeat(2, 1fr); gap: 10px; }

.menu-item {
    display: flex; flex-direction: column;
    background-color: #ffffff; /* BEYAZ KART */
    border-radius: 8px; overflow: hidden;
    border: 1px solid #e0e0e0;
    height: 100%; box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.menu-item img {
    width: 100%;
    height: auto !important;
    aspect-ratio: 9 / 16 !important; /* DİKEY FORMAT */
    object-fit: cover; background-color: #f0f0f0;
}

.item-details {
    padding: 12px; display: flex; flex-direction: column; justify-content: space-between; flex-grow: 1;
    background-color: #ffffff;
}

.item-name { font-weight: 800; font-size: 15px; color: #000000; margin-bottom: 5px; display: block; }
.item-desc { font-size: 12px; color: #444444; margin-bottom: 10px; line-height: 1.4; }
.item-price { color: var(--price-color); font-weight: bold; font-size: 16px; text-align: right; margin-top: auto; }

/* Alerjen İkonları (Kart Üzerinde) */
/* --- ALERJEN İKONLARI DÜZELTME (MASAÜSTÜ VE MOBİL İÇİN) --- */
/* --- ALERJEN İKONLARI (KESİN ÇÖZÜM) --- */

.product-allergens {
    display: flex;
    gap: 5px;
    margin-top: 8px;
    flex-wrap: wrap;
    z-index: 5;
    position: relative;
}

/* !important komutları ile üstteki genel resim kurallarını eziyoruz */
.allergen-icon {
    /* 1. BOYUTLARI SABİTLE */
    width: 25px !important;
    height: 25px !important;
    min-width: 25px !important; /* Sıkışmayı önle */
    max-width: 25px !important; /* Genişlemeyi önle */
    min-height: 25px !important;
    max-height: 25px !important;

    /* 2. ORANI KARE YAP (Yumurtayı engeller) */
    aspect-ratio: 1 / 1 !important; 
    
    /* 3. RESMİ DÜZGÜN OTURT */
    object-fit: contain !important; /* Resmi sündürme, içine sığdır */
    
    /* 4. GÖRSEL TASARIM */
    background: #ffffff;
    border-radius: 50% !important; /* Tam yuvarlak */
    padding: 3px;
    border: 1px solid #ccc;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    
    /* 5. VARSA ESKİ MARJİNLERİ SIFIRLA */
    margin: 0 !important;
}

@media (min-width: 1024px) {
    .accordion-content.show { grid-template-columns: repeat(4, 1fr) !important; gap: 20px; }
    .menu-item:hover { transform: translateY(-5px); box-shadow: 0 15px 30px rgba(0,0,0,0.4); border-color: var(--main-color); }
}

/* =========================================
   8. ÜRÜN ÖNİZLEME MODAL (UZUN METİN KAYDIRMA FİKSİ)
   ========================================= */

/* Modalın Arka Planı */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    backdrop-filter: blur(5px);
    padding: 10px;
}

/* Modalın Kendisi (9:16) */
.modal-content {
    background-color: #ffffff;
    border-radius: 20px;
    height: 85vh; /* Ekranın %85'i */
    width: auto;
    aspect-ratio: 9 / 16 !important;
    max-width: 90vw;
    
    display: flex;
    flex-direction: column; /* Dikey yerleşim */
    position: relative;
    overflow: hidden; /* Taşan her şeyi gizle */
    box-shadow: 0 20px 50px rgba(0,0,0,0.8);
    animation: zoomIn 0.3s ease;
    margin: 0 auto;
}

@keyframes zoomIn { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* Kapatma Butonu */
.close-modal-btn {
    position: absolute; top: 15px; right: 15px; width: 35px; height: 35px;
    background: rgba(255,255,255,0.9); color: #000; border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    font-size: 20px; font-weight: bold; cursor: pointer; z-index: 20;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* Resim Alanı (Yüksekliğin %45'i - Metne yer açmak için biraz kıstık) */
.modal-img {
    width: 100%;
    height: 55%; 
    object-fit: cover;
    background-color: #eee;
    flex-shrink: 0; /* Resim asla büzülmesin */
}

/* --- METİN ALANI (BEYAZ ZEMİN - %55) --- */
.modal-body {
    padding: 20px;
    background-color: #ffffff;
    height: 45%; /* Kalan alan */
    display: flex;
    flex-direction: column; /* İçerikleri alt alta diz */
    border-top: 1px solid #eee;
    position: relative;
    overflow: hidden; /* Taşanları gizle */
}

/* 1. Başlık (SABİT) */
.modal-title { 
    font-size: 20px; 
    margin: 0 0 10px 0; 
    color: #000; 
    font-weight: 800; 
    text-transform: uppercase;
    flex-shrink: 0; /* Asla küçülme */
}

/* 2. Açıklama (ESNEK & KAYDIRILABİLİR) */
.modal-desc { 
    font-size: 14px; 
    color: #444; 
    line-height: 1.5; 
    font-weight: 500;
    
    /* BU KISIM ÇOK ÖNEMLİ: */
    flex-grow: 1;      /* Boş alanın tamamını kapla */
    overflow-y: auto;  /* Sığmazsan kaydırma çubuğu çıkar */
    min-height: 0;     /* Flexbox içinde scroll'un çalışması için şart */
    margin-bottom: 10px;
    padding-right: 5px; /* Scrollbar yapışmasın */
}

/* 3. Alerjenler (SABİT - EN ALTA YAKIN) */
.modal-allergens {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    
    padding-top: 10px;
    border-top: 1px solid #eee;
    
    flex-shrink: 0; /* Asla küçülme, kaybolma */
    min-height: 30px; /* Yer tutucu */
}

.modal-allergens span {
    width: 100%; display: block; font-weight: 700; color: #000;
    margin-bottom: 5px; text-transform: uppercase; font-size: 11px; letter-spacing: 0.5px;
}

.modal-allergens img {
    width: 28px; height: 28px; object-fit: contain;
    border-radius: 50%; background: #f9f9f9; padding: 3px; border: 1px solid #ddd;
}

/* 4. Fiyat (EN ALTTA SABİT) */
.modal-price { 
    font-size: 26px; 
    font-weight: bold; 
    color: var(--price-color);
    text-align: right; 
    margin-top: 10px; 
    flex-shrink: 0; /* Asla kaybolma */
}

/* Scrollbar Tasarımı */
.modal-desc::-webkit-scrollbar { width: 4px; }
.modal-desc::-webkit-scrollbar-thumb { background-color: #ccc; border-radius: 4px; }

/* =========================================
   6. ALERJEN LEGEND (EN ALTTA)
   ========================================= */
.legend-box { background: #1a1a1a; padding: 20px; margin-top: 30px; text-align: center; border-top: 2px solid var(--main-color); }
.legend-title { color: var(--main-color); font-size: 16px; margin-bottom: 10px; text-transform: uppercase; }
.legend-grid { display: flex; justify-content: center; flex-wrap: wrap; gap: 15px; }
.legend-item { display: flex; align-items: center; gap: 6px; color: #ccc; font-size: 13px; }

/* =========================================
   10. KOPYA KORUMASI (CSS)
   ========================================= */

body {
    /* Metin Seçimini Engelle */
    -webkit-user-select: none; /* Safari */
    -moz-user-select: none;    /* Firefox */
    -ms-user-select: none;     /* IE10+/Edge */
    user-select: none;         /* Standard */
}

img {
    /* Resim Sürüklemeyi Engelle */
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
    
    /* Resimlerin kaydedilmesini zorlaştır (Opsiyonel) */
    pointer-events: auto; 
}

/* DİKKAT: Input ve Textarea alanlarına yazı yazılabilmesi lazım! */
input, textarea {
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
}

/* =========================================
   11. FOOTER (ALT BİLGİ & İMZA)
   ========================================= */
footer {
    background-color: #000;
    border-top: 1px solid #333;
    padding: 30px 20px;
    text-align: center;
    margin-top: auto; /* Flex yapısında en alta gitmesini garantiler */
    font-size: 13px;
    color: #777;
    width: 100%; /* Genişliği garantile */
    padding-bottom: 80px; /* Mobilde 'Yukarı Çık' butonu üstüne gelmesin */
}

.footer-content p {
    margin: 5px 0;
}

/* Restoran İsmi */
.footer-restaurant {
    color: #fff;
    font-weight: bold;
}

/* Yazılımcı Linki */
.developer-link {
    color: #fff; /* Admin'den seçilen buton rengini alır */
    text-decoration: none;
    font-weight: bold;
    transition: 0.3s;
}

.developer-link:hover {
    color: #fff;
    text-decoration: underline;
}

/* =========================================
   12. YUKARI ÇIK BUTONU (GARANTİ ÇÖZÜM)
   ========================================= */
#scrollTopBtn {
    display: none; /* Başlangıçta gizli */
    position: fixed; /* Ekrana çivile */
    bottom: 25px; /* Aşağıdan mesafe */
    right: 20px; /* Sağdan mesafe */
    z-index: 10000 !important; /* EN ÜSTTE OLSUN */
    
    border: none;
    outline: none;
    background-color: var(--main-color); /* Admin rengi */
    color: #000;
    cursor: pointer;
    
    width: 45px;
    height: 45px;
    border-radius: 50%;
    font-size: 22px;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    transition: transform 0.3s, background-color 0.3s;
    
    /* İçeriği ortala */
    align-items: center;
    justify-content: center;
    padding: 0;
}

#scrollTopBtn:hover {
    transform: scale(1.15);
    filter: brightness(1.1);
}