/* =============================
   CONFIGURACIÓN MAESTRA - SOLUCIÓN CORRECTA
   Basado en la versión original que funcionaba bien con zoom
   SOLO cambiamos los márgenes de 5px a 20px
   ============================= */

/* OCULTAR ELEMENTOS DEL THEME */
#main-header, .site-header, .ast-breadcrumbs-wrapper {
    display: none !important;
}

body.logged-in .site {
    padding-top: 0 !important;
}

.site-content, #primary, .entry-content {
    padding: 0 !important;
    margin: 0 !important;
}

/* ESTRUCTURA PRINCIPAL */
.configurador-wrapper {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* BARRA LATERAL DINÁMICA - 5PX */
.dynamic-sidebar {
    width: 5px;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    background: #f0f0f0;
    z-index: 1000;
    transition: width 0.3s ease;
    overflow: hidden;
}

.dynamic-sidebar:hover {
    width: 250px;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    background: #ffffff;
}

.sidebar-toggle {
    width: 5px;
    height: 100vh;
    position: absolute;
    cursor: pointer;
    z-index: 1001;
    background: linear-gradient(to right, #ddd 0%, transparent 100%);
}

.sidebar-content {
    width: 250px;
    padding: 20px 10px;
    margin-left: 5px;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-content::-webkit-scrollbar {
    width: 6px;
}

.sidebar-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.sidebar-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.sidebar-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ⭐ SOLUCIÓN: SOLO cambiar de 5px a 20px los márgenes laterales */
.configurador-main {
    flex: 1;
    margin-left: 20px !important;
    margin-right: 20px !important;
    transition: margin-left 0.3s ease;
}

/* Por si acaso, también forzar padding en el contenedor interno */
#contenedorPrincipalConfigurador {
    width: 100%;
    max-width: 100%;
    padding: 0 !important;
    margin: 0 !important;
}

/* CONTENIDO SIDEBAR */
.sidebar-content h3 {
    font-size: 14px;
    color: #0073aa;
    margin-bottom: 10px;
    margin-top: 20px;
    padding-bottom: 8px;
    border-bottom: 2px solid #0073aa;
}

.sidebar-content h3:first-child {
    margin-top: 0;
}

.sidebar-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-content li {
    margin-bottom: 4px;
}

.sidebar-content a {
    color: #333;
    text-decoration: none;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.sidebar-content a:hover {
    background: #f0f4f8;
    color: #0073aa;
    transform: translateX(5px);
}

.sidebar-content a.activo {
    background: #0073aa;
    color: white !important;
    font-weight: bold;
}

.sidebar-content a.activo:hover {
    background: #005a87;
    transform: none;
}

.sidebar-content h3:not(:first-child) {
    border-top: 1px solid #e0e0e0;
    padding-top: 20px;
}

.sidebar-toggle::after {
    content: '›';
    position: absolute;
    right: 2px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    font-size: 18px;
    font-weight: bold;
}

.dynamic-sidebar:hover .sidebar-toggle::after {
    content: '‹';
}

.sidebar-content a.permisos-link {
    background: linear-gradient(90deg, rgba(102,126,234,0.1) 0%, rgba(118,75,162,0.1) 100%);
    border-left: 3px solid #667eea;
}

.sidebar-content a.permisos-link:hover {
    background: linear-gradient(90deg, rgba(102,126,234,0.2) 0%, rgba(118,75,162,0.2) 100%);
}

/* SISTEMA DE PESTAÑAS */
.barra-pestanas {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    margin: 10px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
}

.pestana-activadora {
    padding: 8px 16px;
    font-size: 14px;
    border: 1px solid #ddd;
    background-color: white;
    border-radius: 5px;
    transition: all 0.2s ease;
    color: #333;
    font-weight: 500;
    cursor: pointer;
}

.pestana-activadora:hover:not(.desactivada) {
    background-color: #e0f4ff;
    border-color: #0073aa;
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0,115,170,0.2);
}

.pestana-activadora.activa {
    background-color: #0073aa;
    color: #fff;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0,115,170,0.3);
}

.pestana-activadora.desactivada {
    opacity: 0.3;
    cursor: default;
    pointer-events: none;
    background-color: #e0e0e0;
}

/* ESTADÍSTICAS SIDEBAR */
#estadisticas-sidebar {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 6px;
    font-size: 12px;
    margin: 10px 0;
}

#estadisticas-sidebar p {
    margin: 5px 0;
    display: flex;
    justify-content: space-between;
}

#estadisticas-sidebar strong {
    color: #0073aa;
    font-weight: bold;
}

/* HERRAMIENTAS DE DESARROLLO */
#herramientas-desarrollo {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
}

#btn-actualizar-css {
    background: #ff6b6b;
    color: white;
    padding: 10px 15px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

#menu-herramientas {
    position: absolute;
    bottom: 50px;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    padding: 10px;
    min-width: 200px;
}

#menu-herramientas button {
    display: block;
    width: 100%;
    padding: 8px;
    margin: 2px 0;
    border: none;
    background: #f8f9fa;
    color: #333;
    cursor: pointer;
    border-radius: 4px;
    text-align: left;
    font-size: 12px;
    transition: all 0.2s ease;
}

#menu-herramientas button:hover {
    background: #e9ecef;
}

/* CONTENEDOR PRINCIPAL */
#contenedorPrincipalConfigurador {
    width: 100%;
    max-width: 100%;
    padding: 0;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .dynamic-sidebar { 
        width: 0; 
    }
    
    .dynamic-sidebar:hover { 
        width: 200px; 
    }
    
    .configurador-main { 
        margin-left: 10px;
        margin-right: 10px;
    }
    
    .dynamic-sidebar:hover ~ .configurador-main {
        margin-left: 210px;
    }
    
    .barra-pestanas {
        flex-wrap: wrap;
        margin: 10px 0;
    }
}