/* Universal Header Styles */

/* Base Universal Header Structure */
.universal-header {
    background: linear-gradient(135deg, #2e5827 0%, #3e6837 100%);
    color: white;
    padding: 0;
    box-shadow: 0 4px 12px rgba(46,88,39,0.3);
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* Header Top Bar */
.header-top-bar {
    background: rgba(0,0,0,0.1);
    padding: 8px 0;
    font-size: 0.85em;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.header-top-bar-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.contact-info {
    display: flex;
    gap: 20px;
    align-items: center;
}

.header-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.header-action-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.header-action-btn:hover {
    background: rgba(255,255,255,0.1);
}

/* Header Main Section */
.header-main {
    padding: 15px 0;
}

.header-main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

/* Header Brand/Logo */
.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto; /* Don't grow or shrink */
}

.header-logo-img {
    height: 40px;
    width: auto;
    vertical-align: middle;
}

.header-brand-name {
    font-size: 1.2em;
    font-weight: bold;
    line-height: 1;
}

.header-brand-tagline {
    font-size: 0.8em;
    opacity: 0.9;
    line-height: 1;
}

/* Header Navigation Hub */
.header-nav-hub {
    display: flex;
    gap: 10px; /* Further reduced for tighter spacing */
    align-items: center;
    justify-content: center;
    flex: 0 1 auto; /* Don't grow unnecessarily */
}

/* Back to Product Button */
.back-to-product {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.15);
    color: white;
    padding: 10px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    border: 1px solid rgba(255,255,255,0.2);
}

.back-to-product:hover {
    background: rgba(255,255,255,0.25);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.back-icon {
    font-size: 1.1em;
}

/* Style Search Container */
.style-search-container {
    position: relative;
    flex: 0 1 auto; /* Can shrink if needed */
}

.style-search-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.15);
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.2);
}

.style-search-icon {
    font-size: 1.1em;
}

.style-search-input {
    background: none;
    border: none;
    color: white;
    outline: none;
    font-size: 0.95em;
    width: 160px; /* Slightly reduced width */
}

.style-search-input::placeholder {
    color: rgba(255,255,255,0.7);
}

.style-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

/* Page Context Indicator */
.page-context {
    background: rgba(255,255,255,0.1);
    padding: 6px 10px; /* Reduced padding */
    border-radius: 6px;
    font-size: 0.85em; /* Slightly smaller */
    /* Removed border-left that was causing white gap */
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 0 1 auto; /* Can shrink if needed */
}

.page-context-title {
    font-weight: bold;
}

.page-context-subtitle {
    opacity: 0.8;
    font-size: 0.85em;
}

/* Header Quick Actions */
.header-quick-actions {
    display: flex;
    gap: 8px; /* Reduced gap */
    align-items: center;
    flex: 0 0 auto; /* Don't grow or shrink */
}

.quick-action-btn {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 10px 14px; /* Slightly increased for consistency */
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.quick-action-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.primary-action-btn {
    background: white;
    color: #2e5827;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.95em;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
}

.primary-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Header Breadcrumb */
.header-breadcrumb {
    background: rgba(0,0,0,0.1);
    padding: 8px 0;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.85em;
}

.header-breadcrumb-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.header-breadcrumb-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.breadcrumb-link {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: color 0.2s;
    cursor: pointer;
}

.breadcrumb-link:hover {
    color: white;
}

.breadcrumb-separator {
    color: rgba(255,255,255,0.6);
}

.breadcrumb-current {
    color: white;
    font-weight: 600;
}

/* Mobile responsiveness for universal header */
@media (max-width: 768px) {
    .header-main-content {
        flex-direction: column !important;
        gap: 12px !important;
        text-align: center;
    }
    
    .header-nav-hub {
        flex-direction: column !important;
        gap: 8px !important; /* Reduced from 10px */
    }
    
    .header-quick-actions {
        justify-content: center !important;
        flex-wrap: wrap;
        gap: 8px !important;
    }
    
    .style-search-container input {
        width: 200px !important;
    }
    
    .contact-info {
        flex-direction: column !important;
        gap: 5px !important; /* Reduced from 8px */
        text-align: center;
    }
    
    .header-actions {
        flex-wrap: wrap;
        justify-content: center !important;
        gap: 8px !important;
    }
    
    /* Hide page context on mobile to save space */
    .page-context {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .header-top-bar {
        display: none; /* Hide top bar on very small screens */
    }
    
    .header-brand div:first-child {
        font-size: 1em !important;
    }
    
    .header-brand div:last-child {
        font-size: 0.7em !important;
    }
    
    .back-to-product span:last-child {
        display: none; /* Hide text, keep only arrow */
    }
    
    .page-context {
        display: none; /* Hide on very small screens */
    }
}

/* Improved search results positioning */
#style-search-results {
    box-shadow: 0 8px 24px rgba(0,0,0,0.15) !important;
    border: 1px solid rgba(0,0,0,0.1);
    margin-top: 4px;
}

/* Search result hover effects */
.search-result-item {
    padding: 12px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.search-result-item:hover {
    background-color: #f8f9fa;
}

.search-result-item:last-child {
    border-bottom: none;
}

/* Smooth transitions for interactive elements */
.universal-header button,
.universal-header a {
    transition: all 0.2s ease;
}

/* Ensure consistent icon sizing */
.universal-header button i,
.universal-header a i {
    font-size: 1em;
    line-height: 1;
}

/* Print styles */
@media print {
    .universal-header {
        position: static !important;
        box-shadow: none !important;
        background: white !important;
        color: black !important;
        border-bottom: 2px solid #2e5827;
    }
    
    .header-top-bar, .header-quick-actions {
        display: none !important;
    }
}