/* ====================== ESTILO OSCURO TÉCNICO - AMBOS MENÚS CON CLIC ====================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: #0f172a;
    color: #e2e8f0;
    line-height: 1.7;
    min-height: 100vh;
}

/* ====================== MENÚ SUPERIOR ====================== */
nav {
    background: #1e2937;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 3px solid #f59e0b;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.menu {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    padding: 0;
}

.inicio {
    color: #e0f2fe;
    padding: 20px 26px;
    font-size: 16.5px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.inicio:hover {
    background: #334155;
    color: #f59e0b;
}

.tiene-submenu h3 {
    color: #e0f2fe;
    padding: 20px 26px;
    font-size: 17.5px;
    margin: 0;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.tiene-submenu:hover h3 {
    background: #334155;
    color: #f59e0b;
}

.submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1e2937;
    min-width: 360px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
    border-radius: 0 0 12px 12px;
    border-top: 3px solid #f59e0b;
    z-index: 1100;
    overflow: hidden;
    padding: 10px 0;
}

.submenu.activo {
    display: block;
}

.item-tema {
    padding: 18px 22px;
    border-bottom: 1px solid #334155;
    transition: background 0.3s;
}

.item-tema:hover {
    background: #334155;
}

.titulo-tema {
    color: #60a5fa;
    text-decoration: none;
    font-weight: 600;
    font-size: 15.5px;
    display: block;
    margin-bottom: 8px;
}

.titulo-tema:hover {
    color: #93c5fd;
}

.resumen-desplegable {
    color: #cbd5e1;
    font-size: 14.5px;
    margin-top: 12px;
}

.imagen-resumen img {
    max-width: 90%;
    border-radius: 10px;
    margin-top: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

/* ====================== SIDEBAR DERECHA ====================== */
.sidebar-lateral-derecha {
    position: fixed;
    top: 68px;
    right: 0;
    width: 290px;
    height: calc(100vh - 68px);
    background: #1e2937;
    z-index: 900;
    overflow-y: auto;
    border-left: 3px solid #f59e0b;
}

.lateral-menu {
    list-style: none;
}

.lateral-tiene-submenu h3 {
    color: #e0f2fe;
    padding: 18px 24px;
    font-size: 16.8px;
    cursor: pointer;
    border-bottom: 1px solid #334155;
    transition: all 0.3s ease;
}

.lateral-tiene-submenu:hover h3 {
    background: #334155;
    color: #f59e0b;
}

.lateral-submenu {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #1e2937;
    color: #e2e8f0;
    width: 92%;
    max-width: 520px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 55px rgba(0, 0, 0, 0.7);
    border-radius: 14px;
    border: 2px solid #f59e0b;
    z-index: 1200;
    padding: 20px;
}

/* Clase para mantener abierto el sidebar */
.lateral-submenu.activo {
    display: block;
}

.lateral-titulo-tema {
    color: #60a5fa;
    font-size: 17px;
    font-weight: 600;
}

.lateral-resumen-desplegable {
    color: #cbd5e1;
    font-size: 15px;
    margin-top: 12px;
}

.lateral-imagen-resumen img {
    max-width: 100%;
    border-radius: 10px;
    margin: 15px 0;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5);
}

/* Colores especiales */
.roja li { color: #f87171; }
.azul li  { color: #60a5fa; }

/* ====================== CONTENIDO PRINCIPAL ====================== */
.main-wrapper {
    margin-right: 290px;
    min-height: calc(100vh - 68px);
}

.contenido-con-fondo {
    background-image: url('img/fondo web.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: 100%;
    padding: 60px 40px;
    position: relative;
}

.contenido-con-fondo::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.75);
    z-index: 0;
}

.contenido-con-fondo > * {
    position: relative;
    z-index: 1;
}

.contenido-con-fondo h1 {
    color: #f59e0b;
    text-align: center;
    font-size: 2.9rem;
    margin-bottom: 20px;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.6);
}

.intro {
    font-size: 1.25rem;
    text-align: center;
    max-width: 820px;
    margin: 0 auto 45px;
    color: #cbd5e1;
}

.contenedor-herramientas {
    max-width: 780px;
    margin: 0 auto;
    padding: 50px 40px;
    border-radius: 16px;
    border: 2px solid #f59e0b;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
    text-align: center;
}

.encabezado-calculadora-dr h1 {
    font-size: 2.7rem;
    color: #f59e0b;
    margin-bottom: 15px;
}

.contenedor-herramientas button {
    background: #f59e0b;
    color: #1e2937;
    padding: 16px 40px;
    font-size: 1.2rem;
    font-weight: 700;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
}

.contenedor-herramientas button:hover {
    background: #fbbf24;
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(245, 158, 11, 0.4);
}

/* ====================== RESPONSIVE ====================== */
@media (max-width: 1024px) {
    .main-wrapper { margin-right: 250px; }
    .sidebar-lateral-derecha { width: 250px; }
}

@media (max-width: 768px) {
    .main-wrapper { margin-right: 0; }
    
    .sidebar-lateral-derecha {
        position: relative;
        top: auto;
        right: auto;
        width: 100%;
        height: auto;
        border-left: none;
        border-top: 3px solid #f59e0b;
    }
    
    .submenu {
        position: static;
        transform: none;
        min-width: 100%;
        border-radius: 0;
    }
    
    .lateral-submenu {
        position: static;
        transform: none;
        width: 100%;
        max-width: 100%;
        border-radius: 0;
        box-shadow: none;
    }
}