.bg-coral { background-color: #e07a5f; }
.bg-coral-dark { background-color: #cc6c52; }
.bg-coral-light { background-color: #f9ece8; }
.bg-off { background-color: #fdf9f7; }

.text-coral { color: #e07a5f; }
.text-coral-light { color: #f9ece8; }
.text-ink { color: #1a1008; }
.text-ink-mid { color: rgba(26,16,8,.55); }
.text-ink-soft { color: rgba(26,16,8,.32); }
.text-ink-ghost { color: rgba(26,16,8,.08); }

.shadow-soft { box-shadow: 0 15px 35px rgba(26,16,8,.08); }
.shadow-coral-soft { box-shadow: 0 8px 20px rgba(224, 122, 95, 0.25); }
.shadow-coral-hover { box-shadow: 0 12px 24px rgba(224, 122, 95, 0.35); }

.ease-custom { transition-timing-function: cubic-bezier(.16, 1, .3, 1); }

@keyframes float { 0% { transform: translateY(0); } 50% { transform: translateY(-10px); } 100% { transform: translateY(0); } }
@keyframes pulse-green { 0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); } 70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); } 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); } 20%, 40%, 60%, 80% { transform: translateX(5px); } }
@keyframes blobFloat { 0% { transform: translate(0, 0) scale(1) translate(var(--px, 0), var(--py, 0)); } 100% { transform: translate(30px, -50px) scale(1.1) translate(var(--px, 0), var(--py, 0)); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.animate-float { animation: float 4s ease-in-out infinite; }
.animate-pulse-green { animation: pulse-green 2s infinite; }
.animate-shake { animation: shake 0.5s; }

.loading-overlay { position: fixed; inset: 0; background: white; display: flex; align-items: center; justify-content: center; z-index: 9999; transition: opacity 0.5s ease-out; }

#inventoryTable tr { max-width: 100%; }
#inventoryTable td { word-wrap: break-word; overflow-wrap: break-word; }
table { table-layout: fixed; width: 100%; }
@media (min-width: 768px) { table { table-layout: auto; } }

[data-reveal] { opacity: 0; transition: opacity 0.8s cubic-bezier(.16, 1, .3, 1), transform 0.8s cubic-bezier(.16, 1, .3, 1); transition-delay: var(--d, 0s); will-change: opacity, transform; }
[data-reveal="up"] { transform: translateY(40px); }
[data-reveal="left"] { transform: translateX(-40px); }
[data-reveal="right"] { transform: translateX(40px); }
[data-reveal="scale"] { transform: scale(0.9); }
[data-reveal].visible { opacity: 1; transform: none; }

.navbar.scrolled { background-color: rgb(255 255 255 / 0.85); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: 0 4px 30px rgba(26, 16, 8, 0.08); height: 70px; }
.hero-anim { opacity: 0; transform: translateY(30px); transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1); }
.hero-anim.in { opacity: 1; transform: translateY(0); }
.blob { position: absolute; filter: blur(60px); border-radius: 50%; opacity: 0.6; animation: blobFloat 12s infinite alternate cubic-bezier(.16, 1, .3, 1); transition: transform 0.2s ease-out; }
.tab-btn.active { color: white; background-color: #e07a5f; box-shadow: 0 4px 15px rgba(224, 122, 95, 0.3); }
.tab-content { display: none; animation: fadeIn 0.4s cubic-bezier(.16, 1, .3, 1); }
.tab-content.active { display: block; }
.touch-active { opacity: 0.7; transform: scale(0.98); }
.cat-card:hover .cat-icon { transform: scale(1.1) rotate(-3deg); }
.cat-icon { transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1); }
.menu-item-row { opacity: 0; transform: translateY(16px); transition: opacity 0.5s ease, transform 0.5s cubic-bezier(.16,1,.3,1); }
.menu-item-row.visible { opacity: 1; transform: none; }

/* Impedisce lo scroll quando il menu è aperto */
body.overflow-hidden {
    overflow: hidden !important;
    height: 100vh;
}

/* Modern allergen badge styles for expanded product rows */
.allergen-badge.modern-badge {
    border-radius: 9999px;
    padding: 0.375rem 0.875rem;
    margin: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.2s ease;
}

.allergen-badge.modern-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.allergen-badge.modern-badge.unknown-allergen {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(26, 16, 8, 0.1);
}

/* Allergen section styling */
.allergen-section {
    margin-top: 1rem;
}

.allergen-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: rgba(26, 16, 8, 0.7);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
}

.allergen-badges-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

#mobileDrawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    
    /* 1. Fallback per vecchi smartphone */
    height: 100vh; 
    
    /* 2. LA SOLUZIONE: Dynamic Viewport Height */
    height: 100dvh !important; 
    
    background-color: white;
    z-index: 9001;
    overflow-y: auto;
    overscroll-behavior: contain;
}

#progressBar {
  transform-origin: left;
  transform: scaleX(0);
  width: 100%; /* La larghezza reale è sempre 100% */
}