/* CSS Variables - Color Palette */
:root {
    --primary-purple: #4a148c;
    --secondary-purple: #7b1fa2;
    --soft-purple: #e1bee7;
    --pale-purple-bg: #f3e5f5;
    
    --accent-yellow: #fff59d;
    --accent-yellow-dark: #fbc02d;
    --accent-green: #c8e6c9;
    --accent-green-dark: #81c784;
    
    --text-primary: #212121;
    --text-secondary: #757575;
    --text-light: #ffffff;
    
    --shadow-soft: 0 4px 6px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Base Styles & Typography */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Roboto', sans-serif;
    background-color: #333;
    display: flex; justify-content: center;
    min-height: 100vh; color: var(--text-primary);
}
h1, h2, h3, h4, h5, h6 { font-family: 'Montserrat', sans-serif; }

/* App Container */
.app-container {
    width: 100%; max-width: 414px;
    background-color: var(--pale-purple-bg); min-height: 100vh;
    position: relative; box-shadow: var(--shadow-medium);
    display: flex; flex-direction: column; overflow-x: hidden;
}

/* --- NEW: SPA Views --- */
.main-content {
    flex: 1; overflow-y: auto; padding-bottom: 80px; position: relative;
}
.app-view {
    display: none; animation: fadeIn 0.3s ease;
}
.app-view.active { display: block; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- OVERLAYS (Side Drawer & Search) --- */
.search-overlay {
    position: absolute; top: -80px; left: 0; width: 100%; height: 70px;
    background-color: white; z-index: 900; display: flex; align-items: center;
    padding: 0 16px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); transition: top 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.search-overlay.open { top: 0; }
.search-input { flex: 1; border: none; outline: none; font-size: 1.1rem; padding: 8px; font-family: 'Roboto', sans-serif; }
.close-search { color: var(--text-secondary); }

.side-drawer {
    position: absolute; top: 0; left: -280px; width: 280px; height: 100%;
    background-color: #fff; box-shadow: 2px 0 15px rgba(0,0,0,0.3); z-index: 1000;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1); display: flex; flex-direction: column;
}
.side-drawer.open { left: 0; }
.drawer-header {
    background-color: var(--primary-purple); color: white; padding: 32px 16px 24px;
    display: flex; flex-direction: column; align-items: flex-start;
}
.user-avatar { font-size: 64px; color: var(--accent-yellow); margin-bottom: 8px; }
.drawer-header h3 { font-size: 1.2rem; }
.drawer-header p { font-size: 0.9rem; color: var(--soft-purple); }
.drawer-menu { padding: 8px 0; }
.drawer-item {
    width: 100%; text-align: left; padding: 16px 24px; background: none; border: none;
    font-size: 1rem; color: var(--text-primary); cursor: pointer;
    display: flex; align-items: center; gap: 16px; font-family: 'Roboto', sans-serif; font-weight: 500;
}
.drawer-item:active { background-color: var(--pale-purple-bg); }
.close-drawer {
    position: absolute; top: 16px; right: 16px; background: none; border: none;
    color: white; cursor: pointer; padding: 8px;
}

/* --- VIEW HEADERS --- */
.view-header {
    padding: 32px 16px 24px; background-color: var(--soft-purple); color: var(--primary-purple); text-align: center;
}
.view-header h2 { font-size: 1.6rem; margin-bottom: 8px; }
.view-header p { font-size: 0.95rem; color: var(--secondary-purple); font-weight: 500;}

/* Top Bar */
.top-bar {
    background-color: var(--secondary-purple); color: var(--text-light);
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px; position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.icon-button {
    background: none; border: none; color: var(--accent-yellow); cursor: pointer;
    display: flex; align-items: center; justify-content: center; padding: 8px;
    border-radius: 50%; transition: background-color 0.2s;
}
.icon-button:active { background-color: rgba(255, 255, 255, 0.2); }
.app-title { font-size: 1.2rem; font-weight: 600; letter-spacing: 0.5px; }

/* Hero Section */
.hero-section { position: relative; height: 250px; width: 100%; }
.hero-image-container { width: 100%; height: 100%; position: absolute; top: 0; left: 0; }
.hero-image { width: 100%; height: 100%; object-fit: cover; }
.hero-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(to bottom, rgba(74, 20, 140, 0.3), rgba(0,0,0,0.6)); }
.hero-text-content { position: relative; z-index: 10; height: 100%; display: flex; align-items: center; justify-content: center; padding: 24px; text-align: center; }
.hero-slogan { color: var(--text-light); font-size: 1.5rem; font-weight: 700; text-shadow: 1px 2px 4px rgba(0,0,0,0.5); line-height: 1.3; }

/* Aprende Section */
.aprende-section { padding: 24px 16px; }
.section-title { color: var(--primary-purple); font-size: 1.3rem; margin-bottom: 16px; font-weight: 700; }
.cards-container { display: flex; flex-direction: column; gap: 16px; }
.info-card {
    background-color: #ffffff; border-radius: 16px; padding: 16px; display: flex; align-items: flex-start; gap: 16px;
    box-shadow: var(--shadow-soft); border-left: 4px solid var(--accent-green-dark); transition: transform 0.2s;
}
.info-card:active { transform: scale(0.98); box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.card-icon-container {
    background-color: var(--primary-purple); width: 48px; height: 48px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.card-icon { color: var(--accent-yellow); font-size: 24px; }
.card-content { flex: 1; }
.card-title { color: var(--primary-purple); font-size: 1.1rem; margin-bottom: 4px; font-weight: 600; }
.card-text { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.4; }
.padding-bottom { padding: 0 16px 32px 16px; }

/* Buttons */
.store-cta-section { display: flex; justify-content: center; }
.btn-primary {
    background-color: var(--accent-yellow-dark); color: var(--primary-purple); border: none;
    border-radius: 24px; padding: 16px 32px; font-family: 'Montserrat', sans-serif; font-size: 1.1rem;
    font-weight: 700; width: 100%; box-shadow: 0 4px 6px rgba(251, 192, 45, 0.3); cursor: pointer; transition: transform 0.2s;
}
.btn-primary:active { background-color: #f5b041; transform: scale(0.98); }
.btn-buy {
    background: var(--accent-yellow-dark); color: var(--primary-purple); border: none;
    padding: 8px 16px; border-radius: 20px; font-weight: bold; cursor: pointer; font-family: 'Montserrat', sans-serif;
}
.btn-buy:active { transform: scale(0.95); }

/* --- RECIPES GRID --- */
.recipes-grid { padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.recipe-card {
    background: white; border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-soft);
    cursor: pointer; transition: transform 0.2s;
}
.recipe-card:active { transform: scale(0.98); }
.recipe-card img { width: 100%; height: 160px; object-fit: cover; }
.recipe-info { padding: 16px; }
.recipe-info h4 { color: var(--primary-purple); margin-bottom: 4px; font-size: 1.1rem; }
.recipe-info p { color: var(--text-secondary); font-size: 0.9rem; }

/* --- STORE CATALOG --- */
.store-catalog { padding: 16px; display: grid; grid-template-columns: 1fr; gap: 16px; }
.product-card {
    background: white; border-radius: 16px; padding: 16px; box-shadow: var(--shadow-soft);
    display: flex; align-items: center; gap: 16px;
}
.product-img-box {
    width: 64px; height: 64px; background-color: var(--pale-purple-bg); border-radius: 12px;
    display: flex; justify-content: center; align-items: center; flex-shrink: 0;
}
.product-placeholder { color: var(--secondary-purple); font-size: 32px; }
.product-details { flex: 1; display: flex; flex-direction: column; align-items: flex-start; }
.product-details h4 { color: var(--text-primary); font-size: 1rem; margin-bottom: 4px; line-height: 1.2; }
.price { color: var(--accent-green-dark); font-weight: 600; font-size: 1.1rem; margin-bottom: 8px; }

/* --- CONTACT SECTION --- */
.map-placeholder {
    margin: 16px; height: 150px; background: #e0e0e0; border-radius: 16px;
    display: flex; flex-direction: column; justify-content: center; align-items: center; cursor: pointer;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05); color: var(--text-secondary);
}
.map-icon { font-size: 48px; color: var(--secondary-purple); margin-bottom: 8px; }
.contact-form { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.contact-form h3 { color: var(--primary-purple); margin-bottom: 8px; }
.contact-form input, .contact-form textarea {
    padding: 14px; border: 1px solid #ddd; border-radius: 12px; font-family: 'Roboto', sans-serif;
    font-size: 1rem; outline: none; transition: border-color 0.2s; background: #fafafa;
}
.contact-form input:focus, .contact-form textarea:focus { border-color: var(--primary-purple); background: white; }

/* --- TOAST SIMULATION --- */
.toast {
    position: absolute; bottom: 80px; left: 50%; transform: translateX(-50%) translateY(100px);
    background: #323232; color: white; padding: 14px 24px; border-radius: 24px; font-size: 0.95rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25); z-index: 2000; opacity: 0; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap; font-weight: 500;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* Bottom Navigation */
.bottom-nav {
    position: absolute; bottom: 0; left: 0; width: 100%;
    background-color: #ffffff; display: flex; justify-content: space-around;
    padding: 12px 0 8px 0; box-shadow: 0 -2px 10px rgba(0,0,0,0.05); border-top: 1px solid #eeeeee; z-index: 100;
}
.nav-item {
    background: none; border: none; display: flex; flex-direction: column; align-items: center; gap: 4px;
    color: var(--text-secondary); cursor: pointer; flex: 1; transition: color 0.2s;
}
.nav-icon { font-size: 24px; }
.nav-label { font-size: 0.75rem; font-weight: 500; }
.nav-item.active { color: var(--primary-purple); }

/* Scrollbar styling for webkit */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); border-radius: 10px; }
