/* The Hearth & Vine - Premium Dark Luxury Design System */

:root {
    --bg-canvas: #0D0D0C;
    --bg-surface: #151514;
    --bg-surface-elevated: #1F1F1E;
    
    --text-primary: #F3F3F2;
    --text-muted: #A3A39E;
    --text-subtle: #73736E;
    
    --accent: #C5A880; /* Warm Gold */
    --accent-hover: #D8BD97;
    --accent-glow: rgba(197, 168, 128, 0.15);
    
    --border-subtle: #242422;
    --border-strong: #363633;
    
    --font-display: 'Playfair Display', Georgia, serif;
    --font-ui: 'Inter', system-ui, -apple-system, sans-serif;
    
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-pill: 100px;
    
    --ease-out-cubic: cubic-bezier(0.215, 0.61, 0.355, 1);
    --ease-in-out-sine: cubic-bezier(0.445, 0.05, 0.55, 0.95);
    
    --shadow-nav: 0 -8px 32px rgba(0, 0, 0, 0.5);
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.2);
}

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

html, body {
    width: 100%;
    height: 100%;
    background-color: #050505; /* Deep backdrop for desktop framing */
    color: var(--text-primary);
    font-family: var(--font-ui);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Container Frame - centers and constraints width for a premium mobile-first preview on desktop */
#app {
    width: 100%;
    max-width: 500px;
    min-height: 100vh;
    margin: 0 auto;
    background-color: var(--bg-canvas);
    border-left: 1px solid var(--border-subtle);
    border-right: 1px solid var(--border-subtle);
    position: relative;
    padding-bottom: 96px; /* Space for sticky nav */
    overflow-x: hidden;
}

@media (max-width: 380px) {
    .home-hero h1 { font-size: 2.5rem; }
    .brand-eyebrow { font-size: 0.7rem; }
    .nav-label { font-size: 0.75rem; }
}

/* Views & Dynamic Transitions */
.view {
    display: none;
    opacity: 0;
    padding: 24px 20px;
}

.view.active {
    display: block;
    animation: slideInUp 0.5s var(--ease-out-cubic) forwards;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Typography Rules */
h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 400;
    letter-spacing: -0.01em;
}

/* Home Hero Section */
.home-hero {
    margin-bottom: 28px;
    padding-top: 12px;
}

.brand-eyebrow {
    font-family: var(--font-ui);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--accent);
    margin-bottom: 12px;
    font-weight: 600;
}

.home-hero h1 {
    font-size: 3.5rem;
    line-height: 1.05;
    margin-bottom: 12px;
    color: var(--text-primary);
    text-wrap: balance;
}

.home-hero p {
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.5;
    text-wrap: pretty;
}

/* Swipeable Category Slider Bar */
.category-bar-wrapper {
    position: sticky;
    top: 0;
    background-color: var(--bg-canvas);
    z-index: 50;
    margin-left: -20px;
    margin-right: -20px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-subtle);
}

.category-slider {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* Hide scrollbar for category slider */
.category-slider::-webkit-scrollbar {
    display: none;
}
.category-slider {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

.category-btn {
    flex: 0 0 auto;
    font-family: var(--font-ui);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 10px 18px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-pill);
    background-color: var(--bg-surface);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s var(--ease-out-cubic);
}

.category-btn:hover {
    color: var(--text-primary);
    border-color: var(--border-strong);
}

.category-btn.active {
    background-color: var(--accent);
    color: var(--bg-canvas);
    border-color: var(--accent);
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(197, 168, 128, 0.2);
}

/* Menu Items List */
.menu-list {
    display: flex;
    flex-direction: column;
    margin-top: 16px;
}

/* Elegant Menu Item Card */
.menu-item {
    display: flex;
    gap: 16px;
    padding: 20px 0;
    border-bottom: 1px solid var(--border-subtle);
    opacity: 0;
    transform: translateY(8px);
    animation: itemReveal 0.4s var(--ease-out-cubic) forwards;
}

@keyframes itemReveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Sequential transition delays for smooth list loading */
.menu-item:nth-child(1) { animation-delay: 0.05s; }
.menu-item:nth-child(2) { animation-delay: 0.1s; }
.menu-item:nth-child(3) { animation-delay: 0.15s; }
.menu-item:nth-child(4) { animation-delay: 0.2s; }
.menu-item:nth-child(5) { animation-delay: 0.25s; }

.menu-item:last-child {
    border-bottom: none;
}

.menu-item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.menu-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 6px;
}

.menu-item-title {
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.3;
}

.menu-item-price {
    font-family: var(--font-ui);
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--accent);
}

.menu-item-desc {
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.45;
    text-wrap: pretty;
}

.image-container {
    position: relative;
    width: 84px;
    height: 84px;
    border-radius: var(--radius-sm);
    background-color: var(--bg-surface-elevated);
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid var(--border-subtle);
}

.menu-item-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.4s var(--ease-out-cubic);
}

.menu-item-image.loaded {
    opacity: 1;
}

/* Image Shimmer Skeleton Effect */
.skeleton-shimmer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #151514 25%, #242422 50%, #151514 75%);
    background-size: 200% 100%;
    animation: shimmer 1.6s infinite linear;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Search Header Styling */
.search-header {
    position: sticky;
    top: 0;
    background-color: var(--bg-canvas);
    z-index: 50;
    margin-left: -20px;
    margin-right: -20px;
    padding: 12px 20px 20px;
    border-bottom: 1px solid var(--border-subtle);
}

.search-title-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 16px;
}

.search-title-wrapper h2 {
    font-size: 2.2rem;
    color: var(--text-primary);
}

.search-count {
    font-family: var(--font-ui);
    font-size: 0.85rem;
    color: var(--text-subtle);
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 18px;
    color: var(--text-subtle);
    font-size: 1.15rem;
    pointer-events: none;
    transition: color 0.3s;
}

.search-input-wrapper input {
    width: 100%;
    padding: 16px 48px 16px 50px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-pill);
    background-color: var(--bg-surface);
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: 1rem;
    outline: none;
    transition: all 0.3s var(--ease-out-cubic);
}

.search-input-wrapper input:focus {
    border-color: var(--accent);
    background-color: var(--bg-surface-elevated);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-input-wrapper input:focus + .search-icon {
    color: var(--accent);
}

.search-clear-btn {
    position: absolute;
    right: 18px;
    background: none;
    border: none;
    color: var(--text-subtle);
    cursor: pointer;
    font-size: 1.15rem;
    display: none;
    padding: 4px;
}

.search-clear-btn:hover {
    color: var(--text-primary);
}

/* Quick Tags Container */
.quick-tags-wrapper {
    display: flex;
    gap: 6px;
    margin-top: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.quick-tags-wrapper::-webkit-scrollbar {
    display: none;
}

.quick-tag {
    flex: 0 0 auto;
    font-family: var(--font-ui);
    font-size: 0.78rem;
    padding: 6px 12px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-pill);
    background-color: var(--bg-surface);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-tag:hover {
    color: var(--text-primary);
    border-color: var(--border-strong);
}

.quick-tag.active {
    background-color: var(--accent-glow);
    color: var(--accent);
    border-color: var(--accent);
}

/* Search results spacing */
.search-results-container {
    padding-top: 8px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    color: var(--text-muted);
    text-align: center;
    animation: fadeIn 0.4s var(--ease-out-cubic) forwards;
}

.empty-state i {
    font-size: 3rem;
    color: var(--text-subtle);
    margin-bottom: 16px;
}

.empty-state p {
    font-size: 1.05rem;
    margin-bottom: 8px;
}

.empty-state span {
    font-size: 0.88rem;
    color: var(--text-subtle);
}

/* Editorial Page Styling */
.editorial-header {
    margin-bottom: 24px;
}

.editorial-hero-img {
    width: 100%;
    height: 260px;
    object-fit: cover;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    margin-bottom: 24px;
    background-color: var(--bg-surface);
}

.editorial-body {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.editorial-body p {
    font-size: 1.02rem;
    line-height: 1.6;
    color: var(--text-muted);
    text-wrap: pretty;
}

.editorial-body p:first-of-type {
    font-family: var(--font-display);
    font-size: 1.35rem;
    line-height: 1.45;
    color: var(--text-primary);
    position: relative;
    padding-left: 16px;
    border-left: 2px solid var(--accent);
}

/* Floating Glassmorphism Tab Bar Navigator */
.glass-nav {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    padding: 6px;
    background-color: rgba(21, 21, 20, 0.8);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-nav);
    z-index: 100;
    width: calc(100% - 40px);
    max-width: 420px;
}

.nav-item {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    border-radius: var(--radius-pill);
    padding: 12px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.4s var(--ease-out-cubic);
    overflow: hidden;
}

.nav-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
}

.nav-label {
    max-width: 0;
    opacity: 0;
    font-family: var(--font-ui);
    font-weight: 500;
    font-size: 0.88rem;
    white-space: nowrap;
    transition: all 0.4s var(--ease-out-cubic);
}

/* Active Nav Item expands dynamically */
.nav-item.active {
    background-color: var(--text-primary);
    color: var(--bg-canvas);
    flex: 1.5; /* Grows slightly larger than inactive items */
    padding: 12px 18px 12px 14px;
}

.nav-item.active .nav-label {
    max-width: 80px;
    opacity: 1;
    margin-left: 8px;
}

/* Simple keyframe fade for general use */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Hover effects for non-touch devices */
@media (hover: hover) {
    .nav-item:not(.active):hover {
        background-color: rgba(255, 255, 255, 0.05);
        color: var(--text-primary);
    }
    .category-btn:not(.active):hover {
        background-color: var(--bg-surface-elevated);
    }
}
