:root {
    --primary: #EF3B36;
    --primary-light: #FDECEC;
    --bg-color: #F8F9FA;
    --card-bg: #FFFFFF;
    --text-dark: #1A1A1A;
    --text-gray: #757575;
    --text-light: #A0A0A0;
    --border-color: #F0F0F0;
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 8px 24px rgba(239, 59, 54, 0.15);
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Plus Jakarta Sans', sans-serif; -webkit-tap-highlight-color: transparent; }

body { 
    background-color: #E2E8F0; 
    display: flex; 
    justify-content: center; 
    align-items: center;
    min-height: 100vh;
}

/* Mobil Cihaz Konteyneri */
.app-container {
    width: 100%;
    max-width: 414px;
    height: 100vh;
    height: 100dvh; /* Safari mobil için dinamik yükseklik */
    max-height: 896px; 
    background-color: var(--bg-color);
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* --- HEADER & ARAMA --- */
.header {
    background-color: var(--card-bg);
    padding: 24px 20px 16px;
    border-bottom: 1px solid var(--border-color);
    z-index: 10;
}

.top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.user-profile { display: flex; align-items: center; gap: 12px; }
.user-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 2px solid var(--primary-light); }
.user-info h1 { font-size: 0.85rem; color: var(--text-gray); font-weight: 500; }
.user-info p { font-size: 1.1rem; color: var(--text-dark); font-weight: 700; }

.table-badge {
    background-color: var(--primary-light);
    color: var(--primary);
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
}

.search-area {
    display: flex;
    gap: 12px;
}

.search-box {
    flex: 1;
    background-color: var(--bg-color);
    border-radius: 14px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}
.search-box:focus-within { border-color: var(--primary); background-color: var(--card-bg); box-shadow: var(--shadow-sm); }
.search-box input { border: none; background: transparent; width: 100%; font-size: 0.9rem; outline: none; color: var(--text-dark); }
.search-box input::placeholder { color: var(--text-light); }

.filter-btn {
    background-color: var(--bg-color);
    border: none;
    border-radius: 14px;
    width: 48px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: 0.2s;
}
.filter-btn:active { transform: scale(0.95); background-color: #E2E8F0; }

/* --- ANA İÇERİK ALANI --- */
.content-wrapper {
    display: flex;
    flex: 1;
    overflow: hidden;
    margin-bottom: 70px; 
}

/* Sol Menü (Kategoriler) */
.sidebar {
    width: 85px;
    background-color: var(--card-bg);
    padding: 16px 0;
    overflow-y: auto;
    border-right: 1px solid var(--border-color);
}
.sidebar::-webkit-scrollbar { display: none; }

.category {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 14px 0;
    cursor: pointer;
    position: relative;
}

/* Fotoğraflı Kategori İkonu Yapısı */
.cat-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background-color: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    border: 2px solid transparent; /* Varsayılan çerçeve gizli */
    padding: 2px; /* Aktif olduğunda çerçevenin fotoğrafı ezmemesi için boşluk */
}

.cat-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.cat-name { font-size: 0.7rem; color: var(--text-gray); font-weight: 600; text-align: center; }

/* Aktif Kategori Stilleri (Fotoğrafa Çerçeve) */
.category.active .cat-icon { 
    border-color: var(--primary); 
    box-shadow: var(--shadow-md); 
    transform: translateY(-2px); 
    background-color: var(--card-bg);
}
.category.active .cat-name { color: var(--text-dark); font-weight: 700; }

/* Aktif Kategori İşaretçisi */
.category.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 24px;
    background-color: var(--primary);
    border-radius: 0 4px 4px 0;
}

/* Sağ Alan (Ürünler) */
.menu-grid {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    align-content: flex-start;
    background-color: var(--bg-color);
}
.menu-grid::-webkit-scrollbar { display: none; }

/* Ürün Kartı */
.product-card {
    background-color: var(--card-bg);
    border-radius: 20px;
    padding: 10px;
    box-shadow: var(--shadow-sm);
    position: relative;
    display: flex;
    flex-direction: column;
}

.img-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 12px;
}

.product-img { width: 100%; height: 100%; object-fit: cover; }

.badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(4px);
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--primary);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}


.product-info { display: flex; flex-direction: column; flex: 1; }

.product-title { font-size: 0.85rem; font-weight: 700; color: var(--text-dark); margin-bottom: 4px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-desc { font-size: 0.65rem; color: var(--text-light); margin-bottom: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.price { font-size: 0.95rem; font-weight: 800; color: var(--primary); }

.add-btn {
    width: 32px;
    height: 32px;
    background-color: var(--text-dark);
    color: white;
    border: none;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: 0.2s;
}
.add-btn:active { transform: scale(0.9); background-color: var(--primary); }

/* --- ALT NAVİGASYON (BOTTOM BAR) --- */
.bottom-nav {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 70px;
    background-color: var(--card-bg);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0 10px;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.03);
    z-index: 20;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-light);
    cursor: pointer;
    position: relative;
    flex: 1;
    text-align: center;
}

.nav-item svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: 0.3s; }
.nav-item span { font-size: 0.65rem; font-weight: 600; transition: 0.3s; }

.nav-item.active { color: var(--primary); }
.nav-item.active svg { fill: var(--primary-light); }

.cart-badge {
    position: absolute;
    top: -4px;
    right: 12px;
    background-color: var(--primary);
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid var(--card-bg);
}

/* --- PRODUCT MODAL --- */
.product-modal {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 100;
    display: none;
    flex-direction: column;
    justify-content: flex-end;
}
.product-modal.active { display: flex; }

.modal-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    z-index: 101;
}

.modal-content {
    position: relative;
    z-index: 102;
    background: var(--card-bg);
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -10px 25px rgba(0,0,0,0.1);
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex; flex-direction: column;
    max-height: 90%;
    overflow-y: auto;
}

@keyframes slideUp { 
    from { transform: translateY(100%); } 
    to { transform: translateY(0); } 
}

.close-modal {
    position: absolute;
    top: 16px; right: 16px;
    background: rgba(255,255,255,0.9);
    border: none;
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    cursor: pointer; z-index: 10;
    box-shadow: var(--shadow-sm);
}

.modal-img-container { 
    width: 100%; 
    aspect-ratio: 16/10; 
    border-radius: 24px 24px 0 0; 
    overflow: hidden; 
}
.modal-img-container img { 
    width: 100%; height: 100%; object-fit: cover; 
}

.modal-body { 
    padding: 24px 20px; 
    display: flex; flex-direction: column; 
}

.modal-title { 
    font-size: 1.2rem; font-weight: 800; 
    color: var(--text-dark); margin-bottom: 8px; 
}

.modal-desc { 
    font-size: 0.85rem; color: var(--text-gray); 
    line-height: 1.5; margin-bottom: 16px; 
}

.modal-footer {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: 20px; padding-top: 16px; 
    border-top: 1px solid var(--border-color);
}

.modal-price { 
    font-size: 1.4rem; font-weight: 800; color: var(--primary); 
}

.modal-add-btn {
    background: var(--text-dark); color: white;
    padding: 12px 24px; border: none; border-radius: 14px;
    font-size: 0.95rem; font-weight: 700; cursor: pointer;
    transition: 0.2s;
}
.modal-add-btn:active { 
    transform: scale(0.95); background: var(--primary); 
}

/* --- ALLERGEN BADGES --- */
.allergen-badge {
    background: #fef3c7;
    color: #d97706;
    padding: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid #fde68a;
    display: inline-flex;
    justify-content: center;
    align-items: center;
}
.allergen-badge svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}
.allergen-text { display: none; }

.modal-allergens .allergen-badge {
    width: auto;
    height: auto;
    padding: 4px 10px;
    border-radius: 12px;
}
.modal-allergens .allergen-text { 
    display: inline-block; 
    margin-left: 4px; 
    font-size: 0.65rem; 
    font-weight: 700; 
}

/* --- FILTER CHIPS --- */
.filter-chip {
    padding: 8px 14px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: var(--bg-color);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-gray);
    cursor: pointer;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
}
.filter-chip svg {
    width: 16px;
    height: 16px;
    margin-right: 6px;
    flex-shrink: 0;
}
.filter-chip.active {
    border-color: var(--primary) !important;
    background: var(--primary) !important;
    color: white !important;
}

/* --- TOAST NOTIFICATION --- */
.toast-notification {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--text-dark);
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 200;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.toast-notification.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* SweetAlert2 Theme Overrides */
.swal2-popup { border-radius: 24px !important; font-family: 'Plus Jakarta Sans', sans-serif !important; }
.swal2-title { font-weight: 800 !important; color: var(--text-dark) !important; }
.swal2-html-container { color: var(--text-gray) !important; font-weight: 500 !important; }
.swal2-confirm, .swal2-cancel { border-radius: 12px !important; font-weight: 700 !important; padding: 12px 24px !important; }
