/* Global Styles */
:root {
    --primary: #d0040e; /* Color del Logo */
    --secondary: #222;
    --bg-light: #f8f9fa;
    --text-main: #111827;
    --text-muted: #6b7280;
    --shadow: 0 4px 12px rgba(0,0,0,0.08);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body { 
    margin: 0; 
    font-family: 'Inter', system-ui, -apple-system, sans-serif; 
    background-color: var(--bg-light); 
    color: var(--text-main);
    overflow-x: hidden;
}

/* Splash Screen */
#splash {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: #000;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
}
.splash-logo { width: 120px; animation: pulse 2s infinite; }
@keyframes pulse { 
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Layout */
.app-container { max-width: 500px; margin: 0 auto; min-height: 100vh; background: white; box-shadow: 0 0 20px rgba(0,0,0,0.05); padding-bottom: 80px; }

header { padding: 1rem; text-align: center; border-bottom: 1px solid #eee; position: sticky; top: 0; background: white; z-index: 100; }
.logo-sm { height: 32px; }

/* Categories Scroll */
.categories-wrapper { 
    padding: 0.75rem 0; 
    overflow-x: auto; 
    display: flex; 
    gap: 0.5rem; 
    padding-left: 1rem;
    scrollbar-width: none;
}
.categories-wrapper::-webkit-scrollbar { display: none; }
.category-chip {
    padding: 0.5rem 1.25rem;
    border-radius: 20px;
    border: 1px solid #e5e7eb;
    background: white;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
}
.category-chip.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Carousel */
.promo-carousel {
    width: 92%;
    margin: 0.5rem auto 1.5rem;
    height: 160px;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    background: #f3f4f6;
}
.carousel-inner { display: flex; transition: transform 0.3s ease; height: 100%; }
.carousel-inner img { width: 100%; height: 100%; object-fit: cover; flex-shrink: 0; }

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding: 0 1rem;
}
.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border: 1px solid #f3f4f6;
    position: relative;
    transition: transform 0.2s;
}
.product-card:active { transform: scale(0.97); }
.product-card img { width: 100%; height: 120px; object-fit: cover; }
.product-info { padding: 0.75rem; }
.product-title { margin: 0; font-size: 0.9rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.product-bottom { display: flex; justify-content: space-between; align-items: center; margin-top: 0.5rem; }
.product-price { font-weight: 800; color: var(--text-main); font-size: 1.05rem; }
.product-price small { font-size: 0.65rem; color: #666; font-weight: normal; }
.add-btn { background: var(--primary); color: white; border: none; width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; cursor: pointer; }

.promo-badge {
    position: absolute; top: 8px; left: 8px;
    background: var(--primary); color: white;
    font-size: 0.6rem; font-weight: 700; padding: 2px 6px; border-radius: 4px; z-index: 10;
}

/* Search Categories - 3 rows cards */
.search-categories {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    padding: 1rem;
}
.category-card {
    background: #f9fafb;
    border-radius: 12px;
    padding: 1rem 0.5rem;
    text-align: center;
    border: 1px solid #f3f4f6;
    transition: all 0.2s;
}
.category-card:active { background: #fee2e2; border-color: #fca5a5; }
.cat-icon { font-size: 1.5rem; margin-bottom: 0.5rem; }
.category-card span { font-size: 0.75rem; font-weight: 600; color: var(--text-main); display: block; }

/* Navigation */
.tab-bar {
    position: fixed; bottom: 0; left: 0; width: 100%; background: white;
    display: flex; justify-content: space-around; padding: 0.75rem 0.25rem;
    border-top: 1px solid #eee; z-index: 1000;
}
.nav-item { 
    display: flex; flex-direction: column; align-items: center; gap: 0.25rem;
    color: #9ca3af; text-decoration: none; font-size: 0.7rem; border: none; background: none; flex: 1;
}
.nav-item.active { color: var(--primary); }
.nav-item i { font-size: 1.25rem; }

/* Views */
.view { display: none; }
.view.active { display: block; animation: fadeIn 0.3s; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Toast */
.toast {
    position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%);
    background: #333; color: white; padding: 0.5rem 1rem; border-radius: 20px;
    font-size: 0.8rem; z-index: 9999; animation: slideUp 0.3s, fadeOut 0.3s 1.7s;
}
@keyframes slideUp { from { bottom: 70px; } to { bottom: 90px; } }

/* Cart Styles */
.cart-item { display: flex; gap: 1rem; align-items: center; padding: 1rem; border-bottom: 1px solid #f3f4f6; }
.qty-btn { width: 24px; height: 24px; border-radius: 4px; border: 1px solid #d1d5db; background: white; font-size: 1rem; line-height: 1; }
.cart-footer { padding: 1.5rem; position: sticky; bottom: 80px; background: white; border-top: 1px solid #eee; }
.btn-checkout { background: var(--primary); color: white; width: 100%; padding: 1rem; border-radius: 12px; font-weight: 700; border: none; }
