/* Botón hamburguesa */
.hamburger-menu {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    width: 25px;
    height: 20px;
    justify-content: space-between;
    z-index: 10000;
}

.hamburger-menu span {
    width: 100%;
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hamburger-menu.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-menu.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Overlay */
.side-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0,0,0,0.6);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.side-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Contenedor principal del menú */
.side-menu {
    position: fixed;
    top: 0;
    left: -300px; /* Solo el ancho de la sidebar inicialmente */
    width: 300px; /* Ancho inicial solo de la sidebar */
    height: 100vh;
    background: #fff;
    z-index: 9999;
    transition: left 0.3s ease, width 0.3s ease;
    overflow: hidden;
    box-shadow: 2px 0 15px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
}

/* Ajuste para admin bar de WordPress */
body.admin-bar .side-menu {
    top: 32px;
    height: calc(100vh - 32px);
}

@media screen and (max-width: 782px) {
    body.admin-bar .side-menu {
        top: 46px;
        height: calc(100vh - 46px);
    }
}

.side-menu.active {
    left: 0;
}

/* Expandir menú cuando se muestra el panel de subcategorías */
.side-menu.expanded {
    width: 800px !important;
}

/* Header del menú */
.menu-header {
    background: linear-gradient(135deg, #a90025 0%, #bf072f 100%);
    color: white;
    padding: 4px;
    font-size: 14px;
    line-height: 2px;
    font-weight: 400;
    position: relative;
    flex-shrink: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
    width: 100%;
}

.close-menu {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    cursor: pointer;
    color: white;
    line-height: 1;
    transition: transform 0.2s ease;
}

.close-menu:hover {
    transform: scale(1.1);
}

/* Contenido del menú */
.menu-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
}

/* MENSAJE DE BIENVENIDA */
.welcome-message {
    background: linear-gradient(135deg, #92C53F 0%, #7bb434 100%);
    color: white;
    padding: 20px;
    text-align: center;
    border-bottom: 3px solid #7bb434;
    margin-bottom: 10px;
}

.welcome-message h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
}

.welcome-message p {
    margin: 0;
    font-size: 14px;
    opacity: 0.9;
}

/* Sidebar izquierdo con categorías principales */
.categories-sidebar {
    width: 300px;
    background: #f8f8f8;
    border-right: 1px solid #e0e0e0;
    overflow-y: auto;
    flex-shrink: 0;
}

.main-category {
    border-bottom: 1px solid #e0e0e0;
    position: relative;
}

.main-category-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    color: #333;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.main-category:hover .main-category-link,
.main-category.active .main-category-link {
    background: #fff;
    color: #d4777a;
    border-left-color: #d4777a;
    transform: translateX(3px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.arrow {
    font-size: 16px;
    color: #999;
    transition: all 0.3s ease;
}

.main-category:hover .arrow,
.main-category.active .arrow {
    color: #d4777a;
    transform: translateX(3px);
}

/* Panel de subcategorías - PANEL LATERAL */
.subcategories-panel {
    position: absolute;
    top: 0;
    left: 300px; /* Posicionado justo al lado de la sidebar */
    width: 500px;
    height: 100%;
    background: white;
    display: none;
    flex-direction: column;
    overflow-y: auto;
    box-shadow: 2px 0 15px rgba(0,0,0,0.1);
    border-left: 1px solid #e0e0e0;
    z-index: 1;
}

.subcategories-panel.show {
    display: flex;
}

/* Header del panel */
.panel-header {
    background: linear-gradient(135deg, #e1796b 0%, #cb7266 100%);
    color: white;
    padding: 10px 25px;
    font-size: 20px;
    font-weight: 500;
    border-radius: 25px;
    margin: 16px;
    text-align: center;
    box-shadow: 0 4px 12px #cb72664d;
}

/* Contenido del panel - LAYOUT EN COLUMNAS */
.panel-content {
    display: flex;
    gap: 30px;
    padding: 25px;
    flex: 1;
    overflow-y: auto;
}

/* Columnas del panel */
.menu-column {
        flex: 1;
    min-width: 200px;
    /* background: #fafafa; */
    border-radius: 8px;
    /* padding: 20px 15px; */
    /* border: 1px solid #f0f0f0; */
    /* transition: transform 0.2s 
    ease, box-shadow 0.2s ease; */
}

/* .menu-column:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
} */

/* Grupo de categorías dentro de cada columna */
.category-group {
    margin-bottom: 25px;
    border-bottom: 1px solid #e8e8e8;
    padding-bottom: 15px;
}

.category-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* Título principal de cada grupo de categorías */
.category-group-title {
    color: #333;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
    padding: 0;
    border: none;
}

.category-group-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.2s ease;
    display: block;
    padding: 8px 0;
    border-radius: 4px;
}

.category-group-title a:hover {
    color: #d4777a;
    background: rgba(212, 119, 122, 0.1);
    padding-left: 8px;
}

/* Items de subcategorías */
.subcategory-item {
    margin-bottom: 8px;
}

.subcategory-item a {
    color: #666;
    text-decoration: none;
    font-size: 14px;
    line-height: 1.4;
    transition: all 0.2s ease;
    padding: 6px 0;
    display: block;
    border-radius: 4px;
}

.subcategory-item a:hover {
    color: #d4777a;
    background: rgba(212, 119, 122, 0.05);
    padding-left: 12px;
    font-weight: 500;
}

/* Estado de carga */
.menu-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 300px;
    color: #666;
    font-size: 18px;
}

/* Scrollbar personalizado para el panel */
.panel-content::-webkit-scrollbar {
    width: 6px;
}

.panel-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

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

.panel-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Responsive */
@media (max-width: 1024px) {
    .side-menu {
        width: 90%;
        left: -90%;
    }
    
    .side-menu.expanded {
        width: 95% !important;
    }
    
    .subcategories-panel {
        width: calc(100% - 300px);
    }
    
    .panel-content {
        gap: 20px;
        padding: 20px;
    }
    
    .menu-column {
        min-width: 150px;
        padding: 15px 12px;
    }
}

@media (max-width: 768px) {
    .side-menu {
        width: 100%;
        left: -100%;
    }
    
    .side-menu.expanded {
        width: 100% !important;
    }
    
    .categories-sidebar {
        width: 250px;
    }
    
    .subcategories-panel {
        left: 250px;
        width: calc(100% - 250px);
    }
    
    .panel-content {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }
    
    .menu-column {
        min-width: auto;
        width: 100%;
    }
    
    .menu-header {
        padding: 15px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .categories-sidebar {
        width: 200px;
    }
    
    .subcategories-panel {
        left: 200px;
        width: calc(100% - 200px);
    }
}
