/* ==========================================================================
   TOP NAV (PRIORITY STYLES)
   ========================================================================== */

.nav-container {
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    min-height: 2.5rem;
    box-sizing: border-box;
}

/* Breadcrumb section (left side) */
.breadcrumb-section {
    flex: 1;
    min-width: 0;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: nowrap;
    height: 1.75rem;
    overflow-x: auto;
    padding: 0;
}

.breadcrumb-item {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    flex-shrink: 0;
    white-space: nowrap;
    height: 1.75rem;
    line-height: 1.75rem;
    box-sizing: border-box;
}

.breadcrumb-item a {
    background-color: #f3f4f6;
    text-decoration: none;
    padding: 0.375rem 0.5rem;
    border-radius: 0.375rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    white-space: nowrap;
    height: 1.75rem;
    line-height: normal;
    box-sizing: border-box;
    font-weight: 500;
}

.breadcrumb-item a:hover {
    background-color: #eff6ff;
}

.breadcrumb-item.active {
    color: #374151;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    white-space: nowrap;
    height: 1.75rem;
    line-height: normal;
    box-sizing: border-box;
    padding: 0.375rem 0.5rem;
    border-radius: 0.375rem;
    background: #eff6ff;
}

/* Icons consistent sizing */
.breadcrumb-item svg,
.breadcrumb-item .icon {
    flex-shrink: 0;
    width: 16px !important;
    height: 16px !important;
    display: inline-block;
    vertical-align: middle;
}

.breadcrumb > svg {
    flex-shrink: 0;
    width: 14px !important;
    height: 14px !important;
    color: #9ca3af;
}

.search-section {
  background: var(--gray-50);
  padding: var(--space-6);
  border-radius: var(--radius);
  margin-bottom: var(--space-6);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.search-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
}

.search-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 var(--space-2) 0;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.search-description {
  margin: 0 0 var(--space-4) 0;
  opacity: 0.9;
  font-size: 0.875rem;
  line-height: 1.4;
}

.search-controls,
.search-filters-bar {
  display: flex;
  gap: var(--space-3);
  align-items: flex-end;
  margin-bottom: var(--space-8);
}

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1.5rem 0.875rem;
    min-width: 280px;
    height: 2.25rem;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.search-wrapper:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-wrapper .search-icon {
    color: #6b7280;
    margin-right: 0.5rem;
    flex-shrink: 0;
}

/* TOP NAV SEARCH INPUT - PRIORITY STYLES */
.search-input {
    padding: 20px 0;
    border: none !important;
    background: transparent !important;
    margin: 0 !important;
    flex: 1;
    font-size: 0.875rem;
    outline: none !important;
    box-shadow: none !important;
    color: #374151;
    height: 100%;
}

.search-input::placeholder {
    color: #9ca3af;
}

.search-clear {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 0.25rem;
    margin-left: 0.375rem;
    border-radius: 0.25rem;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
}

.search-wrapper:focus-within .search-clear {
    display: flex;
}

.search-clear:hover {
    background: #f3f4f6;
    color: #374151;
}

.results-badge {
    font-size: 0.875rem;
    color: #6b7280;
    white-space: nowrap;
    font-weight: 500;
    padding: 0rem 0rem;
    background: #f9fafb;
}

.filter-search-wrapper {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: nowrap;
}

.filter-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    min-width: 250px;
}

.filter-icon {
    position: absolute;
    left: 0.75rem;
    pointer-events: none;
    color: #6b7280;
    z-index: 1;
}

.filter-wrapper .form-input {
    padding-right: 2rem;
    width: 100%;
}

.search-wrapper {
    flex: 1 1 300px;
    position: relative;
}

@media (max-width: 768px) {
    .filter-search-wrapper {
        flex-direction: column;
        width: 100%;
        flex-wrap: wrap;
    }
    
    .filter-wrapper,
    .search-wrapper {
        width: 100%;
        flex: 1 1 100%;
    }
}

/* ==========================================================================
   SEARCH & FILTER COMPONENTS (SECONDARY STYLES)
   ========================================================================== */

/* Legacy search controls (for existing pages) */
.search-controls,
.search-filters-bar {
    display: flex;
    gap: var(--space-3);
    align-items: flex-end;
    margin-bottom: var(--space-8);
}

/* New card header filters (single row layout) */
.card-header-filters {
    display: flex;
    gap: var(--space-3);
    align-items: center;
}

/* Alternative search input styles (when not in top nav) */
.search-input:not(.search-wrapper .search-input) {
    position: relative;
    flex: 1;
    max-width: 300px;
    min-width: 200px;
}

.search-input:not(.search-wrapper .search-input) input {
    padding-left: 2.5rem;
}

/* Alternative search icon positioning (when not in top nav) */
.search-icon:not(.search-wrapper .search-icon) {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}

/* Filter Components */
.filters {
    display: flex;
    gap: 0.75rem;
}

.filters select {
    min-width: 150px;
}

/* Card header filters - direct children layout */
.card-header-filters > select {
    min-width: 140px;
}

.card-header-filters > .btn {
    flex-shrink: 0;
    white-space: nowrap;
}

.filters-grid {
    display: flex;
    gap: var(--space-6);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.filter-label {
    font-weight: 600;
    color: var(--text);
    font-size: 0.875rem;
}

/* ==========================================================================
   CATEGORY AND PACK STYLING
   ========================================================================== */

.category-card {
    cursor: pointer;
    transition: all 0.2s ease;
}

.category-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.category-icon {
    color: white;
}

.category-list-item {
    cursor: pointer;
    transition: all 0.2s ease;
}

.category-list-item:hover {
    background-color: #f8f9fa;
    border-color: #dee2e6;
}

.component-groups {
    max-height: 400px;
    overflow-y: auto;
}

.component-group {
    margin-bottom: 0.5rem;
}

.group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.group-header:hover {
    background: #e9ecef;
}

.group-name {
    font-weight: 500;
    flex: 1;
}

.group-arrow {
    transition: transform 0.2s;
    font-size: 0.8rem;
}

.group-content {
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 0.25rem 0.25rem;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.group-content.collapsed {
    max-height: 0;
    border: none;
}

.component-item {
    padding: 0.375rem 0.75rem;
    border-bottom: 1px solid #f1f3f4;
    font-size: 0.85rem;
}

.component-item:last-child {
    border-bottom: none;
}

.component-name {
    color: #495057;
}

/* ==========================================================================
   RESPONSIVE BEHAVIOR
   ========================================================================== */

/* Mobile Responsive */
@media (max-width: 768px) {
    /* Top nav responsive (priority) */
    .nav-container {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
        padding: 0.75rem;
    }
    
    .search-section {
        justify-content: space-between;
        gap: 0.75rem;
    }
    
    .search-wrapper {
        min-width: 200px;
        flex: 1;
    }
    
    .results-badge {
        flex-shrink: 0;
    }
    
    /* Secondary search components responsive */
    .search-controls,
    .search-filters-bar { 
        flex-direction: column; 
    }
    
    .card-header-filters {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-2);
    }
    
    .search-input:not(.search-wrapper .search-input) {
        max-width: none;
        min-width: auto;
    }
    
    .card-header-filters > select {
        min-width: auto;
    }
    
    .filters {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .search-wrapper {
        min-width: 150px;
    }
    
    .nav-container {
        margin: 0.5rem 0;
    }
}