/* --- RESET Y CONFIGURACIÓN CORE --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
    font-family: 'Open Sans', sans-serif;
    font-size: 16px;
    /* Ocultar scrollbar en Firefox */
    scrollbar-width: none;
}

/* Ocultar scrollbar en Chrome, Safari y Edge */
html::-webkit-scrollbar,
body::-webkit-scrollbar {
    display: none;
}

body {
    min-height: 100vh;
    line-height: 1.5;
    overflow-x: hidden;
    display: flex; /* Necesario para el layout sidebar + contenido */
    /* Ocultar scrollbar en IE y Edge antiguo */
    -ms-overflow-style: none;
}

/* --- ESTRUCTURA DE LAYOUT --- */
.sidebar {
    flex-shrink: 0; /* No se comprime */
    width: 280px;
    transition: width 0.4s ease;
}

.sidebar.collapsed {
    width: 85px;
}

main {
    min-height: 80dvh;
}

/* El contenedor del body se adapta al espacio disponible SIN comprimir su contenido interno */
.body-container {
    flex: 1;
    min-width: calc(100vw - 280px); 
    display: flex;
    flex-direction: column;
    transition: min-width 0.4s ease;
}

/* Cuando el sidebar colapsa */
.sidebar.collapsed ~ .body-container {
    min-width: calc(100vw - 85px);
}

/* --- CONTENIDO PRINCIPAL --- */
#content {
    width: 100%;
    min-width: calc(100vw - 280px); /* Ancho mínimo cuando sidebar está abierto */
    transition: min-width 0.4s ease;
}

/* Cuando el sidebar está colapsado, el contenido puede usar más espacio */
.sidebar.collapsed ~ .body-container #content {
    min-width: calc(100vw - 85px);
}

/* --- ELEMENTOS DE TEXTO --- */
h1, h2, h3, h4, h5, h6 {
    margin-bottom: 1rem;
    font-weight: 700;
}

a {
    text-decoration: none;
    color: inherit;
}

button, input, textarea, select {
    font-family: inherit;
    font-size: inherit;
    background: none;
    border: none;
    outline: none;
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    body {
        position: relative;
    }
    
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        z-index: 1001;
        transform: translateX(-100%);
        transition: transform 0.4s ease;
    }
    
    .sidebar:not(.collapsed) {
        transform: translateX(0);
    }
    
    .body-container {
        width: 100%;
    }
    
    #content {
        min-width: 100vw;
        width: 100%;
    }
    
    .sidebar.collapsed ~ .body-container #content {
        min-width: 100vw;
    }
}