/**
 * NBS Geospatial Portal - Estilos v3.0
 * Diseño basado EXACTAMENTE en Figma - Acordeón Horizontal
 *
 * Colores principales:
 * - Primary Green: #005644
 * - Secondary Green: #006B54
 * - Accent Orange: #995103
 * - Background: #FFFFFF
 * - Text Dark: #333333
 * - Text Light: #666666
 * - Border: #E0E0E0
 */

/* ============================================
   CSS RESET & BASE
   ============================================ */
.nbs-portal *,
.nbs-portal *::before,
.nbs-portal *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.nbs-portal {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #333333;
    background: #FFFFFF;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================
   HEADER
   ============================================ */
.nbs-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 30px;
    background: #FFFFFF;
    border-bottom: 3px solid #005644;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nbs-header__logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nbs-header__logo img {
    height: 45px;
    width: auto;
}

.nbs-header__logo-text {
    font-size: 11px;
    color: #005644;
    line-height: 1.3;
    font-weight: 500;
}

.nbs-header__title {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 36px;
    font-weight: 400;
    color: #005644;
    text-align: center;
    flex: 1;
    letter-spacing: 1px;
}

.nbs-header__menu {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #005644;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.nbs-header__menu:hover {
    background: rgba(0, 86, 68, 0.08);
}

.nbs-header__menu-arrow {
    font-size: 12px;
}

/* ============================================
   FRAME 1 & 2: ACORDEÓN HORIZONTAL
   Layout con tabs verticales a la derecha que se expanden hacia la izquierda
   ============================================ */
.nbs-accordion-view {
    flex: 1;
    display: flex;
    min-height: calc(100vh - 80px);
    background: #f5f5f5;
}

/* Flecha de navegación izquierda */
.nbs-nav-arrow-container {
    width: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #FFFFFF;
    flex-shrink: 0;
}

.nbs-nav-arrow {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 24px;
    color: #005644;
    transition: all 0.2s ease;
}

.nbs-nav-arrow:hover {
    color: #003d30;
    transform: scale(1.1);
}

/* Contenedor principal del acordeón */
.nbs-accordion-container {
    flex: 1;
    display: flex;
    flex-direction: row;
    overflow: hidden;
}

/* Item del acordeón */
.nbs-accordion-item {
    display: flex;
    flex-direction: row;
    transition: flex 0.4s ease;
    border-left: 1px solid #E0E0E0;
}

/* Item inactivo - solo muestra el tab minimizado */
.nbs-accordion-item:not(.active) {
    flex: 0 0 auto;
}

/* Item activo - se expande con transición suave */
.nbs-accordion-item.active {
    flex: 1;
}

/* Transiciones suaves para el acordeón */
.nbs-accordion-item {
    transition: flex 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.nbs-accordion-expanded {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.nbs-accordion-item:not(.active) .nbs-accordion-expanded {
    opacity: 0;
    transform: translateX(-20px);
    pointer-events: none;
}

.nbs-accordion-item.active .nbs-accordion-expanded {
    opacity: 1;
    transform: translateX(0);
    display: flex !important;
}

/* ============================================
   TAB MINIMIZADO (INACTIVO)
   Estilo vertical con número y nombre
   ============================================ */
.nbs-accordion-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 60px;
    min-height: 100%;
    background: #FFFFFF;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    padding: 20px 10px;
}

.nbs-accordion-tab:hover {
    background: #f9f9f9;
}

.nbs-accordion-tab.active {
    background: #FFFFFF;
    cursor: default;
}

/* Flecha del tab (para abrir) */
.nbs-tab-arrow {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: transparent;
    border: none;
    font-size: 18px;
    color: #888;
    cursor: pointer;
    padding: 5px;
    transition: color 0.2s ease;
}

.nbs-accordion-tab:hover .nbs-tab-arrow {
    color: #005644;
}

/* Botón de cerrar (para tab activo) */
.nbs-tab-close {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: transparent;
    border: none;
    font-size: 18px;
    color: #005644;
    cursor: pointer;
    padding: 5px;
    transition: all 0.2s ease;
}

.nbs-tab-close:hover {
    color: #003d30;
    transform: translateX(-50%) scale(1.2);
}

/* Contenido del tab (nombre arriba + número abajo) - según Figma */
.nbs-tab-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end; /* Todo abajo */
    flex: 1;
    padding-top: 40px;
    padding-bottom: 40px;
}

/* Nombre arriba - más grande y marcado */
.nbs-tab-name {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    font-size: 14px;
    font-weight: 600;
    color: #005644;
    letter-spacing: 2px;
    text-transform: uppercase;
    flex: 1;
    display: flex;
    align-items: flex-end; /* Empuja hacia abajo */
    order: 1; /* Nombre primero (arriba visualmente por el rotate) */
}

/* Número abajo - más grande */
.nbs-tab-number {
    font-size: 36px;
    font-weight: 300;
    color: #005644;
    margin-top: 20px;
    line-height: 1;
    order: 2; /* Número segundo (abajo visualmente) */
}

/* Tab inactivo - colores más suaves */
.nbs-accordion-tab:not(.active) .nbs-tab-number {
    color: #888;
}

.nbs-accordion-tab:not(.active) .nbs-tab-name {
    color: #888;
}

.nbs-accordion-tab:not(.active):hover .nbs-tab-number,
.nbs-accordion-tab:not(.active):hover .nbs-tab-name {
    color: #005644;
}

/* ============================================
   PANEL EXPANDIDO (ACTIVO)
   ============================================ */
.nbs-accordion-expanded {
    flex: 1;
    display: flex;
    flex-direction: row;
    overflow: hidden;
    position: relative; /* Para posicionar subcategorías absolutamente */
}

/* Contenido principal con imagen/color de fondo */
.nbs-accordion-content {
    flex: 1;
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 40px;
    overflow: hidden;
    border-radius: 20px;
    margin: 20px;
    /* La imagen ocupa todo el espacio disponible */
    width: 100%;
}

.nbs-accordion-bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

/* Información de la categoría (título + icono) */
.nbs-accordion-category-info {
    position: relative;
    z-index: 1;
    text-align: center;
    color: #FFFFFF;
}

.nbs-accordion-category-title {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 64px;
    font-weight: 400;
    color: #FFFFFF;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
    margin-bottom: 20px;
}

.nbs-accordion-category-icon {
    display: flex;
    justify-content: center;
}

.nbs-accordion-category-icon img {
    max-width: 80px;
    max-height: 80px;
}

/* ============================================
   PANEL DE SUBCATEGORÍAS - SUPERPUESTO SOBRE IMAGEN
   Panel blanco en la parte inferior de la imagen, empujado a la izquierda
   Más ancho que alto, border-radius en esquinas superiores
   ============================================ */
.nbs-accordion-subcategories {
    position: absolute;
    left: 35% !important; /* Separado del borde izquierdo */
    right: 40px !important; /* Separado del borde derecho */
    bottom: 0 !important;
    top: auto !important;
    width: auto !important; /* Se ajusta según left/right */
    max-height: 280px !important; /* Altura fija más baja */
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 20px 30px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 0;
    overflow-y: auto;
    overflow-x: hidden;
    border-radius: 20px 20px 0 0 !important; /* Esquinas superiores redondeadas */
    z-index: 10;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
}

/* Scrollbar personalizado para el panel de subcategorías */
.nbs-accordion-subcategories::-webkit-scrollbar {
    width: 6px;
}

.nbs-accordion-subcategories::-webkit-scrollbar-track {
    background: transparent;
}

.nbs-accordion-subcategories::-webkit-scrollbar-thumb {
    background: rgba(0, 86, 68, 0.3);
    border-radius: 3px;
}

.nbs-accordion-subcategories::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 86, 68, 0.5);
}

.nbs-subcategory-row {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 14px 10px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s ease;
    border-bottom: 1px solid rgba(0, 86, 68, 0.15); /* Línea separadora verde */
}

.nbs-subcategory-row:last-child {
    border-bottom: none;
}

.nbs-subcategory-row:hover {
    background: rgba(0, 86, 68, 0.08);
}

.nbs-subcategory-num {
    font-size: 20px;
    font-weight: 300;
    color: #005644; /* Verde como en Figma */
    min-width: 35px;
}

.nbs-subcategory-name {
    font-size: 14px;
    color: #333;
    font-weight: 600;
}

.nbs-subcategory-row:hover .nbs-subcategory-name {
    color: #005644;
}

/* ============================================
   FRAME 3: CROPS GRID VIEW
   ============================================ */
.nbs-crops-view {
    flex: 1;
    padding: 30px 60px;
    background: #FFFFFF;
}

/* Breadcrumb */
.nbs-breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    margin-bottom: 15px;
    font-size: 14px;
}

.nbs-breadcrumb__item {
    color: #666;
    text-decoration: none;
    transition: color 0.2s ease;
}

.nbs-breadcrumb__item:hover {
    color: #005644;
}

.nbs-breadcrumb__item.active {
    color: #005644;
    font-weight: 500;
    padding: 4px 12px;
    border: 1px solid #005644;
    border-radius: 15px;
}

.nbs-breadcrumb__separator {
    color: #ccc;
}

/* Título de página */
.nbs-page-title {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 42px;
    font-weight: 400;
    color: #005644;
    text-align: center;
    margin-bottom: 30px;
}

/* Barra de filtros */
.nbs-filters-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid #E0E0E0;
}

.nbs-filter-label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.nbs-filter-button {
    padding: 10px 25px;
    border: 1px solid #E0E0E0;
    border-radius: 25px;
    background: #FFFFFF;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nbs-filter-button:hover {
    border-color: #005644;
    color: #005644;
}

.nbs-filter-button.active {
    background: #005644;
    border-color: #005644;
    color: #FFFFFF;
}

.nbs-filter-select {
    padding: 10px 20px;
    border-radius: 25px;
    border: 1px solid #E0E0E0;
    font-size: 14px;
    cursor: pointer;
    background: #FFFFFF;
    color: #666;
}

.nbs-filter-select:focus {
    outline: none;
    border-color: #005644;
}

/* Grid de Crops */
.nbs-crops-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Card de Crop */
.nbs-crop-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 4/3;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.nbs-crop-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.nbs-crop-card--empty {
    background: #f5f5f5;
    cursor: default;
}

.nbs-crop-card--empty:hover {
    transform: none;
    box-shadow: none;
}

.nbs-crop-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nbs-crop-card__overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(to top, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0) 100%);
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

.nbs-crop-card__number {
    font-size: 28px;
    font-weight: 300;
    color: #333;
}

.nbs-crop-card__name {
    font-size: 16px;
    font-weight: 500;
    color: #333;
}

/* ============================================
   FRAME 4: MAP VIEWER
   ============================================ */
.nbs-map-view {
    display: flex;
    height: calc(100vh - 80px);
    position: relative;
    overflow: hidden;
}

/* Sidebar del mapa */
.nbs-map-sidebar {
    width: 300px;
    min-width: 300px;
    background: #FFFFFF;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #E0E0E0;
    transition: all 0.3s ease;
    z-index: 10;
    overflow: hidden;
}

.nbs-map-sidebar.collapsed {
    width: 0;
    min-width: 0;
    border-right: none;
    overflow: hidden;
}

.nbs-map-sidebar.collapsed .nbs-sidebar-content,
.nbs-map-sidebar.collapsed .nbs-sidebar-header,
.nbs-map-sidebar.collapsed .nbs-sidebar-footer {
    opacity: 0;
    visibility: hidden;
}

/* Header del sidebar */
.nbs-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    border-bottom: 1px solid #E0E0E0;
}

.nbs-sidebar-home {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #005644;
    border: none;
    cursor: pointer;
    color: #FFFFFF;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.nbs-sidebar-home:hover {
    background: #004535;
    transform: scale(1.05);
}

.nbs-sidebar-home svg {
    width: 22px;
    height: 22px;
}

.nbs-sidebar-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.nbs-sidebar-toggle:hover {
    background: #e8e8e8;
    border-color: #ccc;
}

.nbs-sidebar-toggle__text {
    font-weight: 600;
}

/* Barra lateral (tab) para mostrar panel cuando está oculto */
.nbs-sidebar-tab {
    width: 0;
    height: 100%;
    background: #005644;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    color: #FFFFFF;
    transition: all 0.3s ease;
    overflow: hidden;
    flex-shrink: 0;
}

.nbs-sidebar-tab:hover {
    background: #004535;
}

.nbs-sidebar-tab.visible {
    width: 40px;
}

.nbs-sidebar-tab__text {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: 0;
    transition: opacity 0.2s ease 0.1s;
}

.nbs-sidebar-tab.visible .nbs-sidebar-tab__text {
    opacity: 1;
}

.nbs-sidebar-tab svg {
    opacity: 0;
    transition: opacity 0.2s ease 0.1s;
}

.nbs-sidebar-tab.visible svg {
    opacity: 1;
}

/* Contenido del sidebar */
.nbs-sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* Sección del sidebar */
.nbs-sidebar-section {
    margin-bottom: 25px;
}

.nbs-sidebar-section__title {
    font-size: 12px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

/* Iconos de root categories */
.nbs-root-icons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.nbs-root-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #E0E0E0;
    border-radius: 8px;
    background: #FFFFFF;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.2s ease;
}

.nbs-root-icon:hover {
    border-color: #005644;
    background: rgba(0, 86, 68, 0.05);
}

.nbs-root-icon.active {
    border-color: #005644;
    background: #005644;
}

/* Barra de búsqueda */
.nbs-search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: #f5f5f5;
    border-radius: 8px;
    margin-bottom: 20px;
}

.nbs-search-bar__icon {
    font-size: 16px;
    color: #888;
}

.nbs-search-bar input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 14px;
    color: #333;
    outline: none;
}

.nbs-search-bar input::placeholder {
    color: #aaa;
}

/* Lista de layers */
.nbs-layer-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nbs-layer-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.nbs-layer-item:hover {
    background: #f5f5f5;
}

.nbs-layer-item.active {
    background: rgba(0, 86, 68, 0.08);
}

.nbs-layer-checkbox {
    width: 18px;
    height: 18px;
    border: 2px solid #ccc;
    border-radius: 3px;
    flex-shrink: 0;
    margin-top: 2px;
    transition: all 0.2s ease;
}

.nbs-layer-checkbox.checked {
    background: #005644;
    border-color: #005644;
}

.nbs-layer-checkbox.checked::after {
    content: '✓';
    color: white;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.nbs-layer-info {
    flex: 1;
}

.nbs-layer-title {
    font-size: 14px;
    color: #333;
    font-weight: 500;
    line-height: 1.3;
}

.nbs-layer-title.active-layer {
    color: #005644;
}

.nbs-layer-subtitle {
    font-size: 12px;
    color: #888;
    margin-top: 2px;
}

/* Footer del sidebar */
.nbs-sidebar-footer {
    padding: 20px;
    border-top: 1px solid #E0E0E0;
}

.nbs-download-button {
    width: 100%;
    padding: 14px 20px;
    background: #005644;
    color: #FFFFFF;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.nbs-download-button:hover {
    background: #004535;
}

/* Contenedor del mapa */
.nbs-map-container {
    flex: 1;
    position: relative;
    background: #f0f0f0;
    min-width: 0;
}

#nbs-map {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

/* Controles del mapa */
.nbs-map-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 5;
}

.nbs-map-control {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #FFFFFF;
    border: 1px solid #E0E0E0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 20px;
    color: #333;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.nbs-map-control:hover {
    background: #f5f5f5;
    border-color: #005644;
}

/* Estado vacío */
.nbs-empty {
    text-align: center;
    padding: 40px 20px;
    color: #888;
}

.nbs-empty__text {
    font-size: 14px;
}

/* Loading spinner */
.nbs-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    gap: 15px;
}

.nbs-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #E0E0E0;
    border-top-color: #005644;
    border-radius: 50%;
    animation: nbs-spin 0.8s linear infinite;
}

@keyframes nbs-spin {
    to {
        transform: rotate(360deg);
    }
}

.nbs-loading-text {
    font-size: 14px;
    color: #888;
}

/* ============================================
   LEGACY: ESTILOS ANTERIORES (mantener compatibilidad)
   ============================================ */
.nbs-main-view {
    flex: 1;
    display: flex;
    min-height: calc(100vh - 80px);
}

.nbs-nav-left {
    width: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #FFFFFF;
}

.nbs-content-wrapper {
    flex: 1;
    display: flex;
    align-items: stretch;
    padding: 30px 0;
}

.nbs-category-image {
    flex: 1;
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    margin: 0 30px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nbs-category-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 20px;
}

.nbs-subcategories-overlay {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.97);
    border-radius: 12px 0 0 12px;
    padding: 30px 40px;
    max-height: 80%;
    overflow-y: auto;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
    min-width: 400px;
}

.nbs-subcategories-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.nbs-vertical-tabs {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 20px 0;
    background: #FFFFFF;
    min-width: 60px;
}

.nbs-vertical-tab {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    padding: 20px 15px;
    font-size: 12px;
    font-weight: 500;
    color: #888888;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    background: transparent;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nbs-vertical-tab:hover {
    color: #005644;
}

.nbs-vertical-tab.active {
    color: #005644;
    font-weight: 600;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1200px) {
    .nbs-crops-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }

    .nbs-accordion-subcategories {
        width: 300px;
        padding: 30px 20px;
    }

    .nbs-accordion-category-title {
        font-size: 48px;
    }
}

@media (max-width: 992px) {
    .nbs-header__title {
        font-size: 28px;
    }

    .nbs-accordion-view {
        flex-direction: column;
    }

    .nbs-nav-arrow-container {
        width: 100%;
        height: 60px;
    }

    .nbs-accordion-container {
        flex-direction: column;
    }

    .nbs-accordion-item {
        flex-direction: column;
        border-left: none;
        border-top: 1px solid #E0E0E0;
    }

    .nbs-accordion-tab {
        width: 100%;
        min-height: 60px;
        flex-direction: row;
        padding: 15px 20px;
    }

    .nbs-tab-content {
        flex-direction: row;
        padding-bottom: 0;
        gap: 15px;
    }

    .nbs-tab-name {
        writing-mode: horizontal-tb;
        transform: none;
    }

    .nbs-tab-number {
        font-size: 20px;
        margin-bottom: 0;
    }

    .nbs-tab-arrow,
    .nbs-tab-close {
        position: static;
        transform: none;
    }

    .nbs-accordion-expanded {
        flex-direction: column;
    }

    .nbs-accordion-content {
        min-height: 300px;
        margin: 10px;
    }

    .nbs-accordion-subcategories {
        width: 100%;
    }

    .nbs-crops-view {
        padding: 20px 30px;
    }

    .nbs-page-title {
        font-size: 32px;
    }

    .nbs-map-sidebar {
        width: 100%;
        height: auto;
        max-height: 50vh;
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        border-right: none;
        border-top: 1px solid #E0E0E0;
        border-radius: 20px 20px 0 0;
    }

    .nbs-map-sidebar.collapsed {
        transform: translateY(calc(100% - 60px));
        width: 100%;
    }
}

@media (max-width: 768px) {
    .nbs-header {
        padding: 10px 15px;
    }

    .nbs-header__logo-text {
        display: none;
    }

    .nbs-header__title {
        font-size: 22px;
    }

    .nbs-crops-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .nbs-filters-bar {
        flex-wrap: wrap;
        gap: 10px;
    }

    .nbs-filter-button {
        padding: 8px 16px;
        font-size: 13px;
    }

    .nbs-subcategory-row {
        padding: 10px 12px;
    }

    .nbs-subcategory-num {
        font-size: 20px;
        min-width: 30px;
    }

    .nbs-subcategory-name {
        font-size: 14px;
    }

    .nbs-accordion-category-title {
        font-size: 36px;
    }
}

@media (max-width: 480px) {
    .nbs-header__menu span:last-child {
        display: none;
    }

    .nbs-page-title {
        font-size: 26px;
    }

    .nbs-breadcrumb {
        font-size: 12px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .nbs-crop-card__number {
        font-size: 22px;
    }

    .nbs-crop-card__name {
        font-size: 14px;
    }

    .nbs-accordion-category-title {
        font-size: 28px;
    }

    .nbs-accordion-content {
        padding: 20px;
    }
}

/* ============================================
   CROPS - ESTILOS ADICIONALES FIGMA v2
   Badge curvo y filtros nuevos
   ============================================ */

/* Barra de filtros - NUEVO DISEÑO según Figma */
.nbs-filters-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 50px;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid #E0E0E0;
}

.nbs-filter-label {
    font-size: 14px;
    color: #333;
    font-weight: 600;
}

.nbs-filter-item {
    font-size: 14px;
    color: #666;
    cursor: pointer;
    padding: 8px 4px;
    transition: all 0.2s ease;
    position: relative;
    background: none;
    border: none;
}

.nbs-filter-item:hover {
    color: #005644;
}

.nbs-filter-item.active {
    color: #005644;
    font-weight: 500;
}

/* Card de Crop - NUEVO DISEÑO con imagen completa y badge curvo */
.nbs-crop-card {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 4/3;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.nbs-crop-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

/* Imagen de fondo - ocupa toda la card */
.nbs-crop-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Badge curvo en esquina inferior derecha - según Figma */
.nbs-crop-card__badge {
    position: absolute;
    bottom: 0;
    right: 0;
    background: #FFFFFF;
    padding: 12px 24px 16px 32px;
    border-radius: 30px 0 0 0;
    display: flex;
    align-items: baseline;
    gap: 10px;
    box-shadow: -4px -4px 15px rgba(0, 0, 0, 0.08);
}

.nbs-crop-card__number {
    font-size: 32px;
    font-weight: 300;
    color: #333;
    line-height: 1;
}

.nbs-crop-card__name {
    font-size: 16px;
    font-weight: 500;
    color: #333;
}

/* Overlay antiguo - ocultar si existe */
.nbs-crop-card__overlay {
    display: none;
}

/* ============================================
   REGIONS SELECTION VIEW
   Grid de regiones similar a crops
   ============================================ */
.nbs-regions-view {
    flex: 1;
    padding: 30px 60px;
    background: #FFFFFF;
}

.nbs-page-subtitle {
    text-align: center;
    color: #888;
    font-size: 14px;
    margin-top: -10px;
    margin-bottom: 30px;
    font-weight: 400;
}

.nbs-regions-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.nbs-region-card {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 4/3;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.nbs-region-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.nbs-region-card--global {
    border: 3px solid #005644;
    box-shadow: 0 4px 20px rgba(0, 86, 68, 0.25);
}

.nbs-region-card--global:hover {
    box-shadow: 0 20px 50px rgba(0, 86, 68, 0.35);
}

.nbs-region-card__icon {
    font-size: 48px;
    line-height: 1;
    margin-bottom: 8px;
    opacity: 0.9;
}

.nbs-region-card__badge {
    position: absolute;
    bottom: 0;
    right: 0;
    background: #FFFFFF;
    padding: 12px 24px 16px 32px;
    border-radius: 30px 0 0 0;
    display: flex;
    align-items: baseline;
    gap: 10px;
    box-shadow: -4px -4px 15px rgba(0, 0, 0, 0.08);
}

.nbs-region-card__number {
    font-size: 32px;
    font-weight: 300;
    color: #333;
    line-height: 1;
}

.nbs-region-card__name {
    font-size: 16px;
    font-weight: 500;
    color: #333;
}

/* Responsive: regions grid */
@media (max-width: 900px) {
    .nbs-regions-view {
        padding: 20px 30px;
    }

    .nbs-regions-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
}

@media (max-width: 600px) {
    .nbs-regions-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .nbs-region-card__number {
        font-size: 22px;
    }

    .nbs-region-card__name {
        font-size: 14px;
    }
}

/* ============================================
   MAP SIDEBAR - NUEVO DISEÑO FIGMA
   Iconos minimalistas y dropdowns
   ============================================ */

/* Root Categories - Iconos con labels */
.nbs-root-categories-section {
    padding-bottom: 15px;
    border-bottom: 1px solid #E0E0E0;
    margin-bottom: 15px;
}

.nbs-root-icons {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.nbs-root-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    flex: 1;
    min-width: 0;
}

.nbs-root-icon:hover {
    background: rgba(0, 86, 68, 0.08);
}

.nbs-root-icon.active {
    background: rgba(0, 86, 68, 0.12);
}

.nbs-root-icon svg {
    width: 24px;
    height: 24px;
    color: #005644;
    flex-shrink: 0;
}

.nbs-root-icon__label {
    font-size: 9px;
    color: #666;
    text-align: center;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.nbs-root-icon:hover .nbs-root-icon__label,
.nbs-root-icon.active .nbs-root-icon__label {
    color: #005644;
}

/* Root Icon Wrapper - para posicionar dropdown */
.nbs-root-icon-wrapper {
    position: relative;
    flex: 1;
    min-width: 0;
}

/* Root Dropdown - aparece debajo del icono */
.nbs-root-dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    min-width: 160px;
    background: #FFFFFF;
    border: 1px solid #005644;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    z-index: 200;
    display: none;
    margin-top: 8px;
}

.nbs-root-dropdown.open {
    display: block;
}

/* Flecha del dropdown */
.nbs-root-dropdown::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #005644;
}

.nbs-root-dropdown::after {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid #FFFFFF;
}

.nbs-root-dropdown__menu {
    padding: 8px 0;
}

.nbs-root-dropdown__item {
    padding: 10px 16px;
    cursor: pointer;
    font-size: 13px;
    color: #333;
    transition: background 0.2s ease;
    white-space: nowrap;
}

.nbs-root-dropdown__item:hover {
    background: rgba(0, 86, 68, 0.08);
    color: #005644;
}

.nbs-root-dropdown__item.active {
    background: rgba(0, 86, 68, 0.12);
    color: #005644;
    font-weight: 500;
}

/* Dropdown Component */
.nbs-dropdown {
    position: relative;
    width: 100%;
}

.nbs-dropdown__trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 16px;
    background: #FFFFFF;
    border: 1px solid #E0E0E0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: all 0.2s ease;
}

.nbs-dropdown__trigger:hover {
    border-color: #005644;
}

.nbs-dropdown.open .nbs-dropdown__trigger {
    border-color: #005644;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.nbs-dropdown__text {
    flex: 1;
    text-align: left;
}

.nbs-dropdown__arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.nbs-dropdown__arrow svg {
    color: #666;
}

.nbs-dropdown.open .nbs-dropdown__arrow {
    transform: rotate(180deg);
}

.nbs-dropdown__menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #FFFFFF;
    border: 1px solid #005644;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.nbs-dropdown.open .nbs-dropdown__menu {
    display: block;
}

.nbs-dropdown__item {
    padding: 12px 16px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: background 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.nbs-dropdown__item:last-child {
    border-bottom: none;
}

.nbs-dropdown__item:hover {
    background: rgba(0, 86, 68, 0.08);
    color: #005644;
}

.nbs-dropdown__item.active {
    background: rgba(0, 86, 68, 0.12);
    color: #005644;
    font-weight: 500;
}

/* Time Series Filter - Global map filter */
.nbs-time-series-section {
    padding: 0 !important;
    margin-bottom: 12px;
}

.nbs-time-series-filter {
    padding: 10px 14px;
    background: #f8f9fa;
    border: 1px solid #E0E0E0;
    border-radius: 8px;
}

.nbs-time-series-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.nbs-time-series-buttons {
    display: flex;
    gap: 4px;
}

.nbs-time-btn {
    flex: 1;
    padding: 6px 8px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    color: #555;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    white-space: nowrap;
}

.nbs-time-btn:hover {
    background: #f0f0f0;
    border-color: #bbb;
}

.nbs-time-btn.active {
    background: #005644;
    color: #fff;
    border-color: #005644;
}

/* Search Bar - Nuevo estilo */
.nbs-search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #f8f8f8;
    border: 1px solid #E0E0E0;
    border-radius: 8px;
    margin-bottom: 15px;
}

.nbs-search-bar input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 13px;
    color: #333;
    outline: none;
}

.nbs-search-bar input::placeholder {
    color: #999;
}

.nbs-search-bar__icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.nbs-search-bar__icon svg {
    color: #888;
}

/* Layer List - Checkboxes mejorados */
.nbs-layer-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nbs-layer-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease;
    border-left: 3px solid transparent;
}

.nbs-layer-item:hover {
    background: #f5f5f5;
}

.nbs-layer-item.active {
    background: rgba(0, 86, 68, 0.06);
    border-left-color: #005644;
}

/* Ocultar el input checkbox real */
.nbs-layer-checkbox-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

/* Checkbox visual personalizado */
.nbs-layer-checkbox {
    width: 18px;
    height: 18px;
    border: 2px solid #ccc;
    border-radius: 3px;
    flex-shrink: 0;
    margin-top: 2px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
}

.nbs-layer-checkbox.checked {
    background: #005644;
    border-color: #005644;
}

.nbs-layer-checkbox.checked::after {
    content: '✓';
    color: white;
    font-size: 11px;
    font-weight: bold;
    line-height: 1;
}

.nbs-layer-info {
    flex: 1;
    min-width: 0;
}

.nbs-layer-title {
    font-size: 13px;
    color: #333;
    font-weight: 500;
    line-height: 1.3;
    word-wrap: break-word;
}

.nbs-layer-title.active-layer {
    color: #005644;
    font-weight: 600;
}

.nbs-layer-subtitle {
    font-size: 11px;
    color: #888;
    margin-top: 2px;
}

/* Layer Groups (All mode) */
.nbs-layer-group {
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 6px;
}

.nbs-layer-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #f8f9fa;
    cursor: pointer;
    transition: background 0.2s ease;
    border-bottom: 1px solid #e8e8e8;
}

.nbs-layer-group-header:hover {
    background: #eef1f3;
}

.nbs-layer-group-header__icon {
    flex-shrink: 0;
    color: #005644;
    display: flex;
    align-items: center;
}

.nbs-layer-group-header__icon svg {
    width: 18px;
    height: 18px;
}

.nbs-layer-group-header__title {
    font-size: 12px;
    font-weight: 600;
    color: #333;
    flex: 1;
}

.nbs-layer-group-header__count {
    font-size: 11px;
    color: #fff;
    background: #005644;
    border-radius: 10px;
    padding: 1px 7px;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.nbs-layer-group-header__arrow {
    color: #888;
    transition: transform 0.2s ease;
    display: flex;
    align-items: center;
}

.nbs-layer-group.collapsed .nbs-layer-group-header__arrow {
    transform: rotate(-90deg);
}

.nbs-layer-group.collapsed .nbs-layer-group-content {
    display: none;
}

.nbs-layer-group.collapsed .nbs-layer-group-header {
    border-bottom: none;
}

.nbs-layer-group-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 4px 0;
}

.nbs-layer-group-content .nbs-layer-item {
    border-radius: 0;
    margin: 0;
}

/* Layer sin acceso (usuario canceló login o sin permisos) */
.nbs-layer-no-access {
    opacity: 0.45;
    pointer-events: none;
    position: relative;
}
.nbs-layer-no-access::after {
    content: '\1F512';
    font-size: 11px;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
}

/* Sidebar Section Title */
.nbs-sidebar-section__title {
    font-size: 11px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

/* Sidebar Footer */
.nbs-sidebar-footer {
    padding: 15px 20px;
    border-top: 1px solid #E0E0E0;
    background: #fafafa;
}

.nbs-download-button {
    width: 100%;
    padding: 12px 16px;
    background: #005644;
    color: #FFFFFF;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.nbs-download-button:hover {
    background: #004535;
}

/* Sidebar Header ajustes */
.nbs-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #E0E0E0;
    background: #fafafa;
}

.nbs-sidebar-home {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid #E0E0E0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
    color: #005644;
    transition: all 0.2s ease;
}

.nbs-sidebar-home:hover {
    background: #005644;
    color: #fff;
    border-color: #005644;
}

.nbs-sidebar-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 13px;
    color: #005644;
    border-radius: 4px;
    transition: background 0.2s ease;
    position: relative;
    z-index: 20;
}

.nbs-sidebar-toggle:hover {
    background: rgba(0, 86, 68, 0.08);
}

.nbs-sidebar-toggle__icon {
    font-size: 10px;
    color: #005644;
}

/* Sidebar Content padding */
.nbs-sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

/* ============================================
   TREND ANALYZER - Panel Sidebar Derecho (Rediseño)
   ============================================ */

/* Botón flotante para abrir Trend Analyzer */
.nbs-trend-toggle {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #005644;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 86, 68, 0.3);
    transition: all 0.2s ease;
    z-index: 100;
}

.nbs-trend-toggle:hover {
    background: #004536;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 86, 68, 0.4);
}

.nbs-trend-toggle svg {
    flex-shrink: 0;
}

.nbs-trend-toggle.hidden {
    display: none;
}

/* Sidebar derecho del Trend Analyzer */
.nbs-trend-sidebar {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 380px;
    background: #fff;
    z-index: 200;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.nbs-trend-sidebar.open {
    transform: translateX(0);
}

/* Header del sidebar */
.nbs-trend-sidebar__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #005644;
    color: #fff;
    flex-shrink: 0;
}

.nbs-trend-sidebar__title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 600;
}

.nbs-trend-sidebar__close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nbs-trend-sidebar__close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Filtro de métricas */
.nbs-trend-sidebar__filter {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: #f8f8f8;
    border-bottom: 1px solid #e5e5e5;
    flex-shrink: 0;
}

.nbs-trend-sidebar__filter label {
    font-size: 12px;
    color: #666;
    white-space: nowrap;
}

.nbs-trend-select {
    flex: 1;
    background: #fff;
    border: 1px solid #ddd;
    color: #333;
    padding: 8px 35px 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M3 5l3 3 3-3'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.nbs-trend-select:hover {
    border-color: #bbb;
}

.nbs-trend-select:focus {
    outline: none;
    border-color: #005644;
    box-shadow: 0 0 0 2px rgba(0, 86, 68, 0.15);
}

/* Ubicación seleccionada */
.nbs-trend-sidebar__location {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #f0f7f5;
    border-bottom: 1px solid #e5e5e5;
    flex-shrink: 0;
}

.nbs-trend-sidebar__location-label {
    font-size: 11px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nbs-trend-sidebar__location-value {
    font-size: 12px;
    color: #005644;
    font-weight: 500;
}

/* Contenido principal */
.nbs-trend-sidebar__content {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    position: relative;
}

/* Gráficos en vertical */
.nbs-trend-charts-vertical {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Card de cada gráfico */
.nbs-trend-chart-card {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.nbs-trend-chart-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.nbs-trend-chart-card.hidden {
    display: none;
}

.nbs-trend-chart-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    background: #f8f8f8;
    border-bottom: 1px solid #e5e5e5;
}

.nbs-trend-chart-card__title {
    font-size: 11px;
    color: #005644;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.nbs-trend-source-badge {
    display: inline-block;
    font-size: 8px;
    font-weight: 700;
    color: #fff;
    background: #7b1fa2;
    padding: 1px 4px;
    border-radius: 3px;
    letter-spacing: 0.3px;
    vertical-align: middle;
    margin-left: 4px;
    text-transform: uppercase;
}

.nbs-trend-chart-card__value {
    font-size: 14px;
    font-weight: 700;
    color: #333;
}

.nbs-trend-chart-card__canvas {
    padding: 10px 15px 15px;
    height: 120px;
}

.nbs-trend-chart-card__canvas canvas {
    width: 100% !important;
    height: 100% !important;
}

/* Estado vacío */
.nbs-trend-sidebar__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 30px;
    color: #888;
}

.nbs-trend-sidebar__empty svg {
    margin-bottom: 15px;
    opacity: 0.4;
}

.nbs-trend-sidebar__empty p {
    font-size: 13px;
    line-height: 1.5;
    margin: 0;
}

.nbs-trend-sidebar__empty.hidden {
    display: none;
}

/* Loading */
.nbs-trend-sidebar__loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.95);
    gap: 15px;
}

.nbs-trend-sidebar__loading.hidden {
    display: none;
}

.nbs-trend-sidebar__loading span {
    font-size: 13px;
    color: #666;
}

/* Cuando el Trend Analyzer está abierto, ocultar el botón toggle */
.nbs-trend-sidebar.open ~ .nbs-map-container .nbs-trend-toggle {
    display: none;
}

/* Legacy: mantener compatibilidad con clases antiguas */
.nbs-trend-analyzer {
    /* Ahora usa .nbs-trend-sidebar */
}

.nbs-trend-analyzer.open {
    /* Ahora usa .nbs-trend-sidebar.open */
}

.nbs-trend-tooltip__date {
    font-size: 16px;
    font-weight: 600;
    color: #005644;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.nbs-trend-tooltip__values {
    font-size: 13px;
    color: #666;
}

.nbs-trend-tooltip__values div {
    margin: 4px 0;
}

/* Loading del Trend Analyzer */
.nbs-trend-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(245, 245, 245, 0.95);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    z-index: 5;
    color: #333;
}

.nbs-trend-loading .nbs-spinner {
    border-color: #333;
    border-top-color: #005644;
}

.nbs-trend-loading span {
    color: #888;
    font-size: 14px;
}

/* Estado vacío del Trend Analyzer */
.nbs-trend-empty {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.nbs-trend-empty p {
    color: #666;
    font-size: 14px;
    max-width: 300px;
}

/* Ajustar la vista del mapa cuando el Trend Analyzer está abierto */
.nbs-map-view {
    position: relative;
}

.nbs-map-view .nbs-map-container {
    transition: height 0.3s ease;
}

/* ============================================
   RESPONSIVE - Trend Analyzer
   ============================================ */
@media (max-width: 1200px) {
    .nbs-trend-charts {
        gap: 15px;
    }

    .nbs-trend-chart {
        padding: 12px;
    }
}

@media (max-width: 992px) {
    .nbs-trend-analyzer {
        max-height: 280px;
    }

    .nbs-trend-tooltip {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .nbs-trend-analyzer {
        max-height: 350px;
    }

    .nbs-trend-header {
        flex-direction: column;
        gap: 12px;
        padding: 10px 15px;
    }

    .nbs-trend-controls {
        width: 100%;
        justify-content: space-between;
    }

    .nbs-trend-charts {
        flex-direction: column;
        gap: 10px;
    }

    .nbs-trend-chart {
        display: none;
        min-height: 150px;
    }

    .nbs-trend-chart:first-child {
        display: flex;
    }

    .nbs-trend-chart.visible {
        display: flex;
    }

    .nbs-trend-content {
        padding: 10px 15px;
    }
}

@media (max-width: 480px) {
    .nbs-trend-analyzer {
        max-height: 300px;
    }

    .nbs-trend-label {
        display: none;
    }

    .nbs-trend-select {
        font-size: 12px;
        padding: 6px 25px 6px 10px;
    }
}

/* ============================================
   SPINNER DE CARGA PARA EL MAPA
   ============================================ */
.nbs-map-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: rgba(255, 255, 255, 0.95);
    padding: 30px 40px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 500;
}

.nbs-map-loading.active {
    display: flex;
}

.nbs-map-loading__spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e0e0e0;
    border-top-color: #005644;
    border-radius: 50%;
    animation: nbs-spin 0.8s linear infinite;
}

@keyframes nbs-spin {
    to {
        transform: rotate(360deg);
    }
}

.nbs-map-loading__text {
    color: #333;
    font-size: 14px;
    font-weight: 500;
}

/* ============================================
   DROPDOWN HORIZONTAL DE ROOT CATEGORIES (FIGMA)
   ============================================ */
.nbs-root-dropdown-horizontal {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #FFFFFF;
    border: 2px solid #005644;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    z-index: 300;
    overflow: hidden;
}

.nbs-root-dropdown-horizontal.open {
    display: block;
    animation: nbs-dropdown-slide 0.2s ease-out;
}

@keyframes nbs-dropdown-slide {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Flecha del dropdown (triángulo) */
.nbs-root-dropdown-horizontal::before {
    content: '';
    position: absolute;
    top: -12px;
    left: 30px;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-bottom: 12px solid #005644;
}

.nbs-root-dropdown-horizontal::after {
    content: '';
    position: absolute;
    top: -8px;
    left: 32px;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid #FFFFFF;
}

/* Header del dropdown */
.nbs-root-dropdown-horizontal__header {
    background: #005644;
    padding: 12px 20px;
    border-bottom: none;
}

.nbs-root-dropdown-horizontal__title {
    color: #FFFFFF;
    font-size: 16px;
    font-weight: 600;
    text-transform: capitalize;
}

/* Contenido del dropdown */
.nbs-root-dropdown-horizontal__content {
    padding: 8px 0;
    max-height: 280px;
    overflow-y: auto;
}

/* Items del dropdown */
.nbs-root-dropdown-horizontal__item {
    display: block;
    padding: 14px 20px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
}

.nbs-root-dropdown-horizontal__item:hover {
    background: rgba(0, 86, 68, 0.08);
    color: #005644;
    border-left-color: #005644;
}

.nbs-root-dropdown-horizontal__item.active {
    background: #005644;
    color: #FFFFFF;
    font-weight: 500;
    border-left-color: #005644;
}

/* Item "All" - estilo especial */
.nbs-root-dropdown-horizontal__item--all {
    font-weight: 600;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 4px;
    padding-bottom: 14px;
}

.nbs-root-dropdown-horizontal__item--all.active {
    background: #005644;
    color: #FFFFFF;
}

/* Hacer que el wrapper de root categories sea relative */
.nbs-root-categories-section {
    position: relative;
}

/* Ajustar iconos de root */
.nbs-root-icons {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
    justify-content: space-between;
    padding-bottom: 8px;
}

.nbs-root-icon-wrapper {
    flex: 1;
    min-width: 0;
}

.nbs-root-icon {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 6px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nbs-root-icon:hover {
    background: rgba(0, 86, 68, 0.08);
}

.nbs-root-icon.active {
    background: rgba(0, 86, 68, 0.12);
}

.nbs-root-icon svg {
    width: 28px;
    height: 28px;
    color: #005644;
}

.nbs-root-icon__label {
    font-size: 10px;
    color: #666;
    text-align: center;
    line-height: 1.2;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nbs-root-icon:hover .nbs-root-icon__label,
.nbs-root-icon.active .nbs-root-icon__label {
    color: #005644;
    font-weight: 500;
}
