:root {
    --primary: #2a6900;
    --primary-dim: #235b00;
    --secondary: #884d00;
    --secondary-dim: #774300;
}

/* --- BASICS --- */
body {
    -webkit-tap-highlight-color: transparent;
    overflow-x: hidden;
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* --- UI COMPONENTS --- */

/* 3D Relief Buttons */
.btn-relief {
    box-shadow: 0 4px 0 var(--primary-dim);
    transition: all 0.1s ease-out;
}
.btn-relief:active {
    box-shadow: none;
    transform: translateY(4px);
}

/* Premium Card Shadows */
.recipe-card-shadow {
    box-shadow: 0 10px 40px -10px rgba(42, 105, 0, 0.12);
}

/* Glassmorphism */
.glass-panel {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* Toast */
.toast {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: #2e2f2f;
    color: white;
    padding: 12px 24px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 14px;
    z-index: 1000;
    transition: bottom 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast.show {
    bottom: 120px;
}

/* --- ANIMATIONS --- */
@keyframes fadeInSlide {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.tab-view {
    padding-bottom: calc(140px + env(safe-area-inset-bottom));
}

.tab-view.active {
    display: block;
    animation: fadeInSlide 0.4s ease-out forwards;
}

.abuela-img,
#header-mascot,
#mascot-img-happy,
#mascot-img-angry,
#abuela-advice-img {
    background-color: white;
    filter: none;
}

#mascot-container img {
    background-color: white;
    border-radius: 1rem;
}
#mascot-container {
    position: fixed;
    bottom: calc(150px + env(safe-area-inset-bottom));
    left: 16px;
    right: auto;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.mascot-hidden {
    opacity: 0;
    transform: scale(0.5) translateY(50px);
    pointer-events: none;
}

.mascot-bubble {
    background: white;
    padding: 14px 20px;
    border-radius: 1.5rem 1.5rem 1.5rem 0.2rem; /* punta hacia la izquierda-abajo */
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    font-size: 14px;
    font-weight: 700;
    margin-bottom: -15px;
    margin-left: 10px;
    max-width: 220px;
    position: relative;
    z-index: 110;
    border: 3px solid var(--primary);
    color: var(--primary-dim);
    line-height: 1.4;
}

#mascot-avatar img {
    mix-blend-mode: multiply;
}

.animate-float {
    animation: float 3s infinite ease-in-out;
}

.animate-shake {
    animation: shake 0.5s infinite ease-in-out;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes shake {
    0%, 100% { transform: translate(0, 0) rotate(0); }
    25% { transform: translate(-2px, -2px) rotate(-1deg); }
    75% { transform: translate(2px, 2px) rotate(1deg); }
}

/* BRANDING: ABUELA EN EL HEADER */
#header-mascot {
    animation: headerAppear 1s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards, float 4s infinite ease-in-out 1.2s;
    transform-origin: bottom center;
}

.filter-multiply {
    /* Deprecated: usamos SVG filter #remove-white */
}

@keyframes headerAppear {
    from { opacity: 0; transform: scale(0.5); }
    to { opacity: 1; transform: scale(1); }
}

#abuela-advice-card {
    transition: transform 0.3s ease;
}

#abuela-advice-card:hover {
    transform: translateY(-5px);
}

/* Stats Chart Animations */
.chart-bar {
    transition: height 1s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Add Item Drawer Fixes */
#add-item-drawer {
    z-index: 100 !important; /* Por encima de la navegación */
}

#add-item-drawer .bg-white {
    padding-bottom: calc(2rem + env(safe-area-inset-bottom)) !important;
}

/* Navigation Bar Safe Area Support */
nav {
    padding-bottom: calc(2.5rem + env(safe-area-inset-bottom)) !important;
}
