/* GENEL AYARLAR */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden; /* Sağ-sol titremesini kökten engeller */
    overflow-y: auto;   /* Mönüde aşağı kaydırmaya izin verir */
    font-family: 'Segoe UI', sans-serif;
    background-color: #f4f7f6;
    -webkit-text-size-adjust: 100%; /* Mobilde yazı boyutunun kendi kendine büyümesini engeller */
}

.mobile-container {
    max-width: 500px; 
    margin: 0 auto; 
    min-height: 100vh; 
    position: relative;
    background-color: white;
}

/* ÜST BİLGİ (LOGO & MASA) */
header {
    background-color: #2c3e50; 
    color: white; 
    padding: 15px 20px;
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    position: sticky; /* Sayfa kaysa da logo üstte kalsın */
    top: 0;
    z-index: 1001;
}

.logo { font-size: 22px; font-weight: bold; }
.logo span { color: #f1c40f; }

/* KATEGORİLER */
.categories {
    display: flex; 
    overflow-x: auto; 
    padding: 12px; 
    gap: 10px; 
    background: white;
    position: sticky;
    top: 56px; /* Header'ın hemen altında dursun */
    z-index: 1000;
    border-bottom: 1px solid #eee;
}

.categories button {
    padding: 8px 18px; 
    border-radius: 20px; 
    border: 1px solid #ddd; 
    background: #f8f9fa; 
    cursor: pointer; 
    white-space: nowrap;
    transition: 0.3s;
}

.categories button.active { 
    background: #f1c40f; 
    border-color: #f1c40f; 
    font-weight: bold; 
}

/* Ana mönü alanı: Ürünleri yan yana 2'li dizer */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 sütun garantisi */
    gap: 10px; /* Kutular arası mesafe */
    padding: 10px; /* Kenar boşluğu */
    width: 100%;
    box-sizing: border-box; /* Padding'i genişliğe dahil eder (Titremeyi keser) */
    padding-bottom: 250px !important;
}

.product-card {
    background: white;
    border-radius: 10px;
    border: 1px solid #eee;
    display: flex;
    flex-direction: column;
    align-items: center; /* İçindeki her şeyi merkeze çeker */
    text-align: center;
    width: 100%; /* Kendi hücresine tam oturur */
    box-sizing: border-box;
    overflow: visible !important; /* Kutunun dışarı taşmasına izin ver */
}

.product-img {
    width: 100%;
    height: 70px; /* Yüksekliği biraz kıstık */
    background: #fdfdfd;
    font-size: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-info {
    padding: 8px;
    width: 100%;
    box-sizing: border-box;
    overflow: visible !important;
    text-align: center; 
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 80px; /* Bilgi alanını sabitledik */
}
.product-info h3 {
    font-size: 13px; /* Yazıyı biraz küçülterek kutuya sığdırdık */
    margin: 5px 0;
    white-space: nowrap; /* Uzun isimler kutuyu bozmasın */
    overflow: hidden;
    text-overflow: ellipsis; /* Sığmayan yazıya ... koyar */
}
.product-info p { margin: 0 0 10px 0; color: #27ae60; font-weight: bold; }

/* EKLE BUTONU (Ürün Kartlarındaki) */
.add-btn {
    background: #27ae60; 
    color: white; 
    border: none;
    /* İşte o meşhur yeşil ayrım çizgisi */
    border-top: 4px solid #2ecc71; 
    padding: 10px 15px; 
    cursor: pointer;
    width: 100%;
    font-weight: bold;
    font-size: 14px;
    margin-top: 5px;
    /* Kartın alt köşelerine tam oturması için */
    border-radius: 0 0 12px 12px; 
    transition: 0.3s;
}
.add-btn:hover {
    background: #219150;
    border-top: 4px solid #27ae60;
}

/* SEPET BARI (SABİT ALT PANEL) */
.cart-bar {
    position: fixed; 
    bottom: 0; 
    width: 100%; 
    max-width: 500px;
    background: #2c3e50; 
    color: white; 
    padding: 10px 15px;
    display: flex;
    flex-direction: column; /* İçindekileri alt alta dizer (Sepet listesi + Toplam) */
    box-sizing: border-box;
    z-index: 1100;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.2);
    border-radius: 20px 20px 0 0;
}

/* SEPET LİSTESİ (KAYDIRILABİLİR ALAN) */
.sepet-ozet {
    color: #333 !important;
    background-color: #ffffff !important;
    max-height: 120px; /* Sepet çok uzamasın diye sınırladık */
    overflow-y: auto; /* İçerik taşarsa kendi içinde kaydır */
    border-radius: 10px;
    margin-bottom: 10px;
    padding: 5px;
}

.total-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0 10px 0;
}

.total-info b { font-size: 20px; color: #f1c40f; }

.order-btn { 
    background: #f1c40f; 
    border: none; 
    padding: 12px; 
    font-weight: bold; 
    border-radius: 10px; 
    width: 100%; 
    cursor: pointer;
    font-size: 16px;
}

/* SEPET İÇİNDEKİ SİLME [X] BUTONU */
.sepet-item button {
    color: #e74c3c !important; /* Canlı kırmızı */
    border: 1px solid #e74c3c !important;
    background: transparent;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    line-height: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
}

.sepet-item button:hover {
    background: #e74c3c;
    color: white !important;
}

/* HESAP İSTE / ÖDEME BUTONU (Turuncu Profesyonel) */
.pay-btn {
    background: #e67e22 !important; /* Turuncu */
    color: white !important;
    border: none;
    padding: 12px;
    font-weight: bold;
    border-radius: 10px;
    width: 100%;
    margin-top: 10px;
    cursor: pointer;
    font-size: 14px;
    text-transform: uppercase;
    box-shadow: 0 3px 6px rgba(0,0,0,0.1);
}

.pay-btn:hover {
    background: #d35400 !important;
}

/* ========================================= */
/* 🚀 LİSTE MODU: KESİN İTAAT PROTOKOLÜ (DOM CRUSHER) */
/* ========================================= */
.menu-grid.list-mode {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
}

/* KARTIN KENDİSİ ZORLA 50PX OLACAK */
.list-mode .product-card {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    height: 50px !important;
    min-height: 50px !important;
    padding: 5px 10px !important;
    border-radius: 8px !important;
    overflow: hidden !important;
}

/* 💥 ŞİFRE 1: KARTIN İÇİNDEKİ HER ŞEY TEK SATIRA MAHKUMDUR! */
.list-mode .product-card * {
    white-space: nowrap !important;
}

/* 💥 ŞİFRE 2: JS'İN GİZLEDİĞİ İÇ KUTULARI (DİV) ZORLA YAN YANA DİZ */
.list-mode .product-card > div {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    flex: 1 !important; /* Kalan tüm alanı kapla */
    gap: 10px !important;
    overflow: hidden !important;
}

/* 💥 ŞİFRE 3: ÜRÜN İSİMLERİ TAŞARSA "..." KOY (Bütün alanı yut) */
.list-mode .product-card h1, 
.list-mode .product-card h2, 
.list-mode .product-card h3, 
.list-mode .product-card h4 {
    flex: 1 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    font-size: 14px !important;
    text-align: left !important;
    margin: 0 !important;
}

/* FİYATI KORU (Esnemesini Yasakla) */
.list-mode .product-card p, 
.list-mode .product-card span {
    font-size: 14px !important;
    font-weight: bold !important;
    margin: 0 !important;
    flex-shrink: 0 !important; 
}

/* PORSİYON SEÇİCİ (Varsa) */
.list-mode .product-card select {
    flex: 0 0 75px !important;
    width: 75px !important;
    height: 30px !important;
    font-size: 12px !important;
    margin: 0 5px !important;
}

/* 💥 ŞİFRE 4: İSİMSİZ BUTON AVI (ANKET GRAFİĞİ İPTAL!) */
.list-mode .product-card .add-btn,
.list-mode .product-card button,
.list-mode .product-card input[type="button"],
.list-mode .product-card a {
    flex: 0 0 65px !important; /* ESNEMEK KESİNLİKLE YASAK */
    width: 65px !important;
    min-width: 65px !important;
    max-width: 65px !important;
    height: 32px !important;
    line-height: 32px !important; /* Yazıyı dikeyde tam ortalar */
    padding: 0 !important;
    margin: 0 0 0 auto !important; /* Tam sağa yaslar */
    border-radius: 6px !important;
    font-size: 13px !important;
    text-align: center !important; /* "EKLE" yazısını ortala */
    display: block !important; /* Kutu gibi davranmasını zorunlu kılar */
    box-sizing: border-box !important;
    background: #27ae60 !important; /* Rengini zorla yeşil yap */
    color: white !important;
    text-decoration: none !important; /* Eğer bu bir <a> etiketiyse alt çizgisini sil */
}

/* 💥 ŞİFRE 5: RESİM VE İKON SOYKIRIMI */
.list-mode .product-card img,
.list-mode .product-card i,
.list-mode .product-card svg,
.list-mode .product-card .icon {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}