/* ARCHIVO: /ecosistema/app_core/style.css */

:root {
    --primary: #1a2a3a;
    --accent: #3498db;       
    --domotizar-red: #e64a41;
    --domotizar-red-dark: #b33932;
    --white: #ffffff;
    --text-dark: #2d3436;
    --text-light: #636e72;
    --sidebar-width: 285px;
}

/* 1. RESET Y ESTRUCTURA */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { 
    margin: 0; padding: 0; width: 100%; min-height: 100vh; 
    background: #2c3e50; font-family: 'Inter', sans-serif; 
    font-size: 18px; overflow-x: hidden; 
}

body { display: block; }

.app-wrapper {
    width: 100%; max-width: 500px; margin: 0 auto; 
    min-height: 100vh; background: #f4f7f9; 
    position: relative; box-shadow: 0 0 50px rgba(0,0,0,0.4);
    display: flex; flex-direction: column;
}

/* 2. MENU LATERAL (SIDEBAR) - VOLVEMOS AL DISEÑO ANTERIOR */
.sidebar {
    position: fixed; top: 0; left: -290px; 
    width: var(--sidebar-width); height: 100%;
    background: var(--white); z-index: 10000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 10px 0 30px rgba(0,0,0,0.2);
}
.sidebar.active { left: 0; }

.sidebar-header {
    background: linear-gradient(135deg, var(--domotizar-red), var(--domotizar-red-dark));
    padding: 30px 25px; /* Reducido para que no sea tan alto */
    color: white;
}
.sidebar-header h2 { margin: 10px 0 5px; font-size: 1.3rem; font-weight: 800; }

.side-link {
    display: flex; align-items: center; gap: 15px;
    padding: 18px 25px; color: var(--text-dark);
    text-decoration: none; font-size: 1.1rem;
    border-bottom: 1px solid #f1f2f6;
}
.side-link i { width: 24px; color: var(--text-light); }
.side-link.active { background: #f8f9fa; color: var(--domotizar-red); font-weight: 800; }

/* 3. CABECERA PRINCIPAL MUCHO MÁS COMPACTA */
.header-main {
    background: var(--primary); 
    color: white;
    padding: 15px 20px 25px; /* Reducido drásticamente de 30/45 a 15/25 */
    text-align: center;
    border-radius: 0 0 30px 30px;
}

.welcome h1 { font-size: 1.4rem; font-weight: 800; margin: 0; }
.welcome p { font-size: 0.9rem; opacity: 0.8; margin: 2px 0 0; }

/* 4. ELEMENTOS DE INTERFAZ */
.menu-toggle {
    position: absolute; top: 12px; left: 15px;
    width: 44px; height: 44px; display: flex; 
    align-items: center; justify-content: center; 
    color: white; cursor: pointer; z-index: 1001;
    background: rgba(255,255,255,0.1); border-radius: 10px;
}

/* Cabecera con volver + hamburguesa sin solapamiento (espacios, servicio) */
.app-header-actions {
    position: absolute; top: 0; left: 0; right: 0;
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px; z-index: 10; pointer-events: none;
}
.app-header-actions > * { pointer-events: auto; }
.app-header-actions .menu-toggle { position: static; flex-shrink: 0; }
.app-header-actions .btn-volver {
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: 50%;
    color: white; background: rgba(0,0,0,0.35); text-decoration: none;
    backdrop-filter: blur(6px); box-shadow: 0 1px 3px rgba(0,0,0,0.12);
    flex-shrink: 0;
}
.app-header-actions .btn-volver:hover { background: rgba(0,0,0,0.5); color: white; }
.app-header-actions .btn-volver i { width: 20px; height: 20px; }

.top-bar-ayto {
    background: #1a2a3a; color: rgba(255,255,255,0.8);
    padding: 10px 20px; font-size: 0.75rem;
    text-transform: uppercase; letter-spacing: 1.2px;
    font-weight: 700; text-align: center; width: 100%;
}

.wallet-card-compact {
    margin: 15px auto 0; /* Margen superior reducido */
    background: white; color: var(--primary);
    padding: 8px 18px; border-radius: 12px;
    display: flex; justify-content: space-between; align-items: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
    width: fit-content; min-width: 150px;
}

.app-body { padding: 0 20px; flex: 1; }
.title-section { font-size: 1.1rem; font-weight: 800; margin: 25px 0 15px 5px; color: #2d3436; text-align: left; }

/* ... Resto de estilos de tarjetas con imagen ... */
.service-card-img {
    position: relative; background-size: cover; background-position: center;
    height: 105px; border-radius: 20px; margin-bottom: 12px;
    display: flex; align-items: flex-end; overflow: hidden;
    border: 1px solid rgba(0,0,0,0.08); cursor: pointer;
}
.service-card-img::after {
    content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(0deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 70%);
}
.service-info-overlay {
    position: relative; z-index: 2; padding: 12px 20px; 
    color: white; width: 100%; display: flex;
    justify-content: space-between; align-items: center;
}

.sidebar-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); display: none; z-index: 9999;
}
.sidebar-overlay.active { display: block; }

.app-footer, .sidebar-footer { padding: 25px; text-align: center; }

@media (min-width: 1000px) {
    .sidebar { left: 0; box-shadow: none; border-right: 1px solid #eee; }
    .menu-toggle { display: none; }
    .app-wrapper { margin-left: var(--sidebar-width); margin-right: auto; }
}