/* theme-smartmenu.css */

/* --- PREMIUM THEME VARIABLES --- */
:root { 
  --bg: #050505; 
  --card: #0a0a0a; 
  --border: 1px solid rgba(255,255,255,0.08);
  --text: #ffffff; 
  --muted: rgba(255,255,255,0.5);
  --gold: #D4AF37; 
  --gold-glow: rgba(212, 175, 55, 0.25);
  --grad-gold: linear-gradient(135deg, #D4AF37 0%, #AA8A28 100%);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --glass-bg: rgba(5, 5, 5, 0.65); 
  --glass-bg-scrolled: rgba(5, 5, 5, 0.45);
  --glass-border: rgba(255,255,255,0.05);
}

.theme-smartmenu {
    margin: 0; 
    background: var(--bg); 
    color: var(--text); 
    font-family: 'Inter', sans-serif; 
    height: 100dvh; 
    display: flex; 
    flex-direction: column; 
    overflow: hidden; 
    transition: background 0.5s var(--ease);
}

.theme-smartmenu * {
    box-sizing: border-box; 
    -webkit-tap-highlight-color: transparent; 
    outline: none;
}

.theme-smartmenu .app-wrapper {
    height: 100dvh;
    display: flex;
    flex-direction: column;
}

@keyframes reveal { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.reveal { opacity: 0; animation: reveal 0.8s var(--ease) forwards; }

@keyframes textBlur { 0% { filter: blur(10px); opacity: 0; transform: translateY(10px); } 100% { filter: blur(0); opacity: 1; transform: translateY(0); } }
.premium-text { animation: textBlur 1.2s ease forwards; font-family: 'Playfair Display', serif; font-style: italic; }

/* NAVBAR */
.theme-smartmenu .nav { 
    padding: 10px 20px; 
    padding-top: calc(env(safe-area-inset-top) + 10px); 
    display: flex; justify-content: space-between; align-items: center; 
    z-index: 1000; background: rgba(0,0,0,0.01); backdrop-filter: blur(10px); 
    border-bottom: var(--border); 
    height: auto; min-height: 60px; 
    position: relative; width: 100%; 
}
.theme-smartmenu .brand { 
    font-family: 'Playfair Display', serif; 
    color: var(--gold); 
    font-weight: 700; 
    letter-spacing: 2px; 
    font-size: 16px; 
    text-transform: uppercase; 
}

/* MAIN SCROLL AREA */
.theme-smartmenu #main-scroll { flex: 1; overflow-y: auto; padding-bottom: 50px; scroll-behavior: smooth; }

/* HERO */
.theme-smartmenu .hero { 
    position: relative; width: 100%; padding: 40px 20px 25px 20px; text-align: center; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; 
}
.theme-smartmenu .hero-bg-img { 
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; pointer-events: none; opacity: 0.4; mix-blend-mode: screen; 
}
.theme-smartmenu .hero-gradient-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(to bottom, transparent 0%, var(--bg) 100%); z-index: 1;
}
.theme-smartmenu .greet-badge { font-size: 12px; color: var(--gold); margin-bottom: 2px; display: block; position: relative; z-index: 2; }
.theme-smartmenu .hero-title { 
    font-family: 'Playfair Display', serif; font-size: 28px; margin: 0; font-weight: 600; line-height: 1.2; 
    background: linear-gradient(to right, var(--text), var(--muted)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; 
    position: relative; z-index: 2;
}

/* CATEGORY SCOLLER */
.theme-smartmenu .section-header { padding: 0 25px; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.theme-smartmenu .section-title { font-size: 10px; color: var(--muted); letter-spacing: 2px; text-transform: uppercase; font-weight: 600; }
.theme-smartmenu .scroll-hint { font-size: 10px; color: var(--gold); animation: bounceX 1.5s infinite; display: flex; align-items: center; gap: 4px; }
@keyframes bounceX { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(5px); } }

.theme-smartmenu .cat-scroller { display: flex; gap: 10px; overflow-x: auto; padding: 0 25px 20px 25px; scrollbar-width: none; scroll-snap-type: x mandatory; }
.theme-smartmenu .cat-scroller::-webkit-scrollbar { display: none; }
.theme-smartmenu .cat-card { min-width: 85px; height: 90px; background: var(--card); border: var(--border); border-radius: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; transition: 0.3s; scroll-snap-align: start; }
.theme-smartmenu .cat-card.active { background: var(--grad-gold) !important; border-color: transparent; box-shadow: 0 5px 15px -5px var(--gold-glow); }
.theme-smartmenu .cat-card.active .cat-icon { color: #000 !important; }
.theme-smartmenu .cat-icon { font-size: 18px; color: var(--gold); margin-bottom: 8px; transition: 0.3s; }
.theme-smartmenu .cat-name { font-size: 10px; color: var(--muted); text-align: center; width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: 0.3s; padding: 0 5px; }
.theme-smartmenu .cat-card.active .cat-name { color: #000 !important; font-weight: 700; }

/* STICKY HEADER & SEARCH */
.theme-smartmenu .items-header { 
    padding: 10px 25px 15px; display: flex; flex-direction: column; gap: 12px; 
    position: sticky; top: 0; z-index: 20; 
    background: var(--glass-bg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--glass-border); transition: background 0.4s ease; 
}
.theme-smartmenu .items-header.scrolled { background: var(--glass-bg-scrolled); }

.theme-smartmenu .search-container { position: relative; width: 100%; }
.theme-smartmenu .search-input { width: 100%; background: rgba(255,255,255,0.03); border: var(--border); padding: 10px 15px 10px 35px; border-radius: 12px; color: var(--text); font-family: 'Inter'; font-size: 13px; transition: 0.3s; }
.theme-smartmenu .search-input:focus { border-color: var(--gold); background: var(--card); }
.theme-smartmenu .search-icon-fixed { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 12px; }

.theme-smartmenu .header-controls-row { display: flex; justify-content: space-between; align-items: center; width: 100%; gap: 10px; margin-top: 4px; }
.theme-smartmenu .current-cat-title { font-family: 'Playfair Display'; font-size: 18px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }

.theme-smartmenu .filter-row { display: flex; gap: 8px; align-items: center; }
.theme-smartmenu .filter-chip { padding: 6px 12px; border-radius: 20px; font-size: 10px; font-weight: 600; background: rgba(255,255,255,0.05); color: var(--muted); border: 1px solid transparent; cursor: pointer; transition: 0.2s; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.theme-smartmenu .filter-chip.active { background: var(--card); color: var(--text); border-color: var(--gold); }

/* ITEMS LIST */
.theme-smartmenu .items-container { padding: 0 20px 20px 20px; display: flex; flex-direction: column; gap: 12px; min-height: 300px; }
.theme-smartmenu .menu-category-section { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }

.theme-smartmenu .item-card { background: var(--card); border: var(--border); padding: 12px; border-radius: 18px; display: flex; align-items: center; position: relative; transition: opacity 0.4s ease, transform 0.4s ease; }
.theme-smartmenu .thumb-wrapper { position: relative; flex-shrink: 0; margin-right: 15px; width: 78px; height: 78px; border-radius: 50%; overflow: hidden; background: #ffffff; border: 1.5px solid var(--gold); }
.theme-smartmenu .dish-thumb { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; position: absolute; top: 0; left: 0; z-index: 2; background: #ffffff; }
.theme-smartmenu .dish-placeholder { width: 100%; height: 100%; border-radius: 50%; background: #ffffff; display: flex; align-items: center; justify-content: center; position: absolute; top: 0; left: 0; z-index: 1; }

.theme-smartmenu .dish-info { flex: 1; padding-right: 5px; min-width: 0; overflow: hidden; } 
.theme-smartmenu .dish-name { font-weight: 600; font-size: 14px; margin-bottom: 4px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.theme-smartmenu .dish-desc { font-size: 11px; color: var(--muted); margin-bottom: 6px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.4; width: 100%; }

.theme-smartmenu .dish-price-wrapper { display: flex; align-items: center; gap: 8px; }
.theme-smartmenu .dish-price { font-family: 'Playfair Display'; color: var(--gold); font-weight: 700; font-size: 15px; }
.theme-smartmenu .old-price { text-decoration: line-through; color: var(--muted); font-size: 12px; font-family: 'Inter'; }

.theme-smartmenu .badge-absolute { position: absolute; top: -5px; left: -5px; background: #4ade80; color: #000; font-size: 9px; font-weight: 800; padding: 3px 6px; border-radius: 6px; z-index: 5; box-shadow: 0 2px 5px rgba(0,0,0,0.3); }

/* FOOTER / EXTRAS */
.theme-smartmenu .menu-footer { text-align: center; padding: 30px 20px; color: var(--muted); font-size: 12px; }
.theme-smartmenu .menu-footer a { color: var(--gold); text-decoration: none; }

.theme-smartmenu .placeholder-svg { width: 45px; height: 45px; object-fit: contain; }

/* --- BOTTOM SHEET MODAL --- */
#itemModalOverlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(4px);
    z-index: 2000; opacity: 0; visibility: hidden;
    transition: all 0.4s var(--ease);
}
#itemModalOverlay.active { opacity: 1; visibility: visible; }

#itemModal.bottom-sheet {
    position: fixed; bottom: 0; left: 0; width: 100%; height: auto;
    max-height: 85vh; background: var(--bg);
    border-top: 1px solid rgba(255,255,255,0.1);
    border-radius: 30px 30px 0 0; z-index: 2001;
    transform: translateY(100%); transition: transform 0.5s var(--ease);
    display: flex; flex-direction: column;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.5);
}
#itemModal.bottom-sheet.active { transform: translateY(0); }

.theme-smartmenu .sheet-handle {
    width: 40px; height: 4px; background: rgba(255,255,255,0.2);
    border-radius: 2px; margin: 12px auto; flex-shrink: 0;
}

.theme-smartmenu .sheet-close {
    position: absolute; top: 20px; right: 20px; width: 32px; height: 32px;
    background: rgba(255,255,255,0.1); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 14px; z-index: 10;
}

.theme-smartmenu .sheet-content { flex: 1; overflow-y: auto; padding-bottom: 40px; }

.theme-smartmenu .sheet-header { width: 100%; padding: 0 20px; text-align: center; }
.theme-smartmenu .modal-main-img {
    width: 100%; max-width: 400px; aspect-ratio: 1/1; object-fit: cover;
    border-radius: 20px; background: #fff; border: 1.5px solid var(--gold);
}

.theme-smartmenu .sheet-body { padding: 25px 25px; }
.theme-smartmenu .modal-title {
    font-family: 'Playfair Display', serif; font-size: 24px;
    color: var(--text); margin-bottom: 12px; font-weight: 700;
}
.theme-smartmenu .modal-description {
    font-size: 14px; color: var(--muted); line-height: 1.6; margin-bottom: 25px;
}

.theme-smartmenu .modal-footer {
    display: flex; justify-content: space-between; align-items: center;
    border-top: 1px solid rgba(255,255,255,0.05); padding-top: 20px;
}
.theme-smartmenu .modal-price {
    font-family: 'Playfair Display', serif; font-size: 22px;
    font-weight: 700; color: var(--gold);
}

/* Hiding default components that aren't needed */
.theme-smartmenu .hidden { display: none !important; }
