/* ==========================================================================
   MenuMax - Mobile-First Minimal Pastel Light Theme (Clean Utility Classes)
   ========================================================================== */

:root {
    --font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    
    /* Pastel Theme Palette */
    --bg-page: #f8fafc;
    --bg-surface: #ffffff;
    --bg-subtle: #f1f5f9;
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    --border-color: rgba(15, 23, 42, 0.08);
    --border-focus: rgba(225, 29, 72, 0.4);
    
    --brand-primary: #e11d48;
    --brand-primary-rgb: 225, 29, 72;
    --brand-secondary: #0f172a;
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.12);
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.4;
    overflow-x: hidden;
    user-select: none;
    -webkit-user-select: none;
}

/* Utility Helper Classes */
.is-hidden { display: none; }
.is-flex { display: flex; }
.is-block { display: block; }
.is-inline { display: inline; }

.badge-vegan { background-color: #16a34a !important; color: #ffffff !important; }
.badge-glutenfree { background-color: #d97706 !important; color: #ffffff !important; }
.badge-chef { background-color: #9333ea !important; color: #ffffff !important; }

/* App Shell */
.mobile-app-shell {
    max-width: 900px;
    margin: 0 auto;
    min-height: 100vh;
    background-color: var(--bg-page);
    display: flex;
    flex-direction: column;
    position: relative;
    padding-bottom: 80px;
    touch-action: pan-y;
}

/* STICKY TOP HEADER */
.app-header {
    position: sticky;
    top: 0;
    z-index: 90;
    background-color: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border-color);
    padding: 10px 14px;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.header-main-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.back-btn-header {
    background: var(--bg-subtle);
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    color: var(--text-primary);
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.15s ease;
}

.back-btn-header:active {
    transform: scale(0.9);
    background: #e2e8f0;
}

.brand-header-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand-logo-img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-color);
}

.venue-name {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
}

.table-tag {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--brand-primary);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.header-right-tools {
    display: flex;
    align-items: center;
    gap: 6px;
}

.tool-btn {
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    padding: 5px 10px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* SEARCH BAR */
.search-bar-wrapper {
    position: relative;
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    padding: 6px 12px;
    gap: 8px;
}

.search-box i {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.search-box input {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    font-size: 0.82rem;
    font-family: var(--font-family);
    color: var(--text-primary);
}

.search-box button {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
}

/* MAIN CONTENT & VIEW SECTIONS */
.app-main-content {
    padding: 12px;
    position: relative;
    flex: 1;
}

.view-section {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    width: 100%;
}

.view-section.active {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   0. WELCOME / KAPAK GÖRSELİ EKRANI (PERFECTLY CENTERED SPLASH)
   ========================================================================== */
#welcomeView {
    min-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 24px 16px;
    margin: 0 auto;
    width: 100%;
    background-color: var(--bg-page);
    position: relative;
    box-sizing: border-box;
}

.splash-container {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    text-align: center;
    box-sizing: border-box;
}

.splash-art-wrapper {
    margin: 10px auto;
    width: 220px;
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.splash-mascot-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Touch Finger Action Button with Pulsing Concentric Circles */
.splash-touch-action {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin: 20px auto;
}

.splash-touch-button {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: var(--brand-primary);
    color: #ffffff;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    box-shadow: 0 8px 24px rgba(var(--brand-primary-rgb), 0.35);
    transition: transform 0.2s ease;
}

.splash-touch-action:active .splash-touch-button {
    transform: scale(0.92);
}

.ripple-outer-ring {
    position: absolute;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: rgba(var(--brand-primary-rgb), 0.12);
    animation: pulseRing 2s infinite ease-in-out;
}

.ripple-middle-ring {
    position: absolute;
    width: 106px;
    height: 106px;
    border-radius: 50%;
    background: rgba(var(--brand-primary-rgb), 0.22);
    animation: pulseRing 2s infinite ease-in-out 0.3s;
}

@keyframes pulseRing {
    0% { transform: scale(0.88); opacity: 0.7; }
    50% { transform: scale(1.08); opacity: 1; }
    100% { transform: scale(0.88); opacity: 0.7; }
}

.splash-touch-caption {
    margin-top: 14px;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    text-transform: uppercase;
}

/* Bottom Brand Typography */
.splash-brand-footer {
    margin: 20px auto;
}

.splash-brand-name {
    font-family: 'Outfit', 'Plus Jakarta Sans', sans-serif;
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 4px;
}

.splash-tagline {
    font-size: 0.88rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.splash-table-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding: 6px 14px;
    background: var(--bg-subtle);
    color: var(--brand-primary);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 800;
    border: 1px solid var(--border-color);
}

/* SECTION TITLES */
.section-title {
    margin-bottom: 14px;
    text-align: center;
}

.section-title h2 {
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.category-group-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0 14px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border-color);
}

.category-group-head i {
    color: var(--brand-primary);
    font-size: 1.1rem;
}

.category-group-head h2 {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-primary);
}

/* ==========================================================================
   3 SÜTUNLU GRID SİSTEMİ (3 COLUMNS GRID FOR CATEGORIES & PRODUCTS)
   ========================================================================== */
.square-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

@media (max-width: 400px) {
    .square-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
}

/* SQUARE CARDS */
.square-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

.square-card:active {
    transform: scale(0.95);
}

/* 1:1 Aspect Ratio Image Container */
.square-image-container {
    width: 100%;
    aspect-ratio: 1 / 1;
    position: relative;
    overflow: hidden;
    background-color: var(--bg-subtle);
}

.square-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.square-card:hover .square-image-container img {
    transform: scale(1.05);
}

.count-pill {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(4px);
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: var(--radius-full);
}

.badge-tag {
    position: absolute;
    top: 5px;
    left: 5px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(225, 29, 72, 0.9);
    color: #fff;
    font-size: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* SQUARE CARD FOOTER */
.square-card-footer {
    padding: 8px 6px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    flex: 1;
    min-height: 52px;
}

.category-name, .product-name {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-unit-sub {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-weight: 600;
}

.product-price-val {
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--brand-primary);
    margin-top: 2px;
}

/* FLOATING BOTTOM NAV */
.bottom-nav-bar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 900px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border-color);
    padding: 8px 16px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 100;
    transition: transform 0.25s ease;
}

.nav-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    font-size: 0.68rem;
    font-weight: 700;
    cursor: pointer;
    transition: color 0.2s ease;
}

.nav-btn i { font-size: 1.1rem; }
.nav-btn.active { color: var(--brand-primary); }

.badge-rel { position: relative; }
.cart-bubble {
    position: absolute;
    top: -4px;
    right: -8px;
    background: var(--brand-primary);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 800;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* MODAL OVERLAYS & BOTTOM SHEETS */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 200;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-sheet {
    background: var(--bg-surface);
    width: 100%;
    max-width: 600px;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: 20px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .modal-sheet {
    transform: translateY(0);
}

.modal-close-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    background: var(--bg-subtle);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.modal-square-img {
    width: 100%;
    aspect-ratio: 16 / 10;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 14px;
}

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

.modal-title-price {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
}

.modal-title-price h2 {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-primary);
}

.detail-price {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--brand-primary);
    white-space: nowrap;
}

.detail-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.badges-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}

.badge-tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 800;
}

.badge-tag-pill.vegan { background: rgba(34, 197, 94, 0.15); color: #16a34a; }
.badge-tag-pill.veg { background: rgba(16, 185, 129, 0.15); color: #059669; }
.badge-tag-pill.gf { background: rgba(245, 158, 11, 0.15); color: #d97706; }
.badge-tag-pill.spicy { background: rgba(239, 68, 68, 0.15); color: #dc2626; }
.badge-tag-pill.chef { background: rgba(168, 85, 247, 0.15); color: #9333ea; }
.badge-tag-pill.unit { background: var(--bg-subtle); color: var(--text-secondary); border: 1px solid var(--border-color); }

.qty-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    font-size: 0.9rem;
    font-weight: 700;
}

.qty-stepper {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-subtle);
    padding: 4px 10px;
    border-radius: var(--radius-full);
}

.step-btn {
    background: #fff;
    border: 1px solid var(--border-color);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

.note-input-box input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-family: var(--font-family);
    outline: none;
    margin-bottom: 14px;
}

.action-btn {
    width: 100%;
    padding: 14px;
    border-radius: var(--radius-md);
    font-weight: 800;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.primary-action-btn { background: var(--brand-primary); color: #fff; }
.secondary-action-btn { background: var(--bg-subtle); color: var(--text-primary); }

.basket-items-container {
    max-height: 240px;
    overflow-y: auto;
    margin-bottom: 14px;
}

.basket-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.basket-summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 1.05rem;
    margin-bottom: 16px;
    padding-top: 10px;
    border-top: 2px solid var(--border-color);
}

.app-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: #0f172a;
    color: #fff;
    padding: 12px 20px;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-lg);
    z-index: 300;
    transition: transform 0.3s ease;
}

.app-toast.active { transform: translateX(-50%) translateY(0); }
