/**
 * Breadcrumbs Component Styles
 * 
 * Styles for breadcrumbs navigation with scroll behavior
 * 
 * @package CheckToBuild
 * @since 2.0.0
 */

/* Base breadcrumbs styles */
.breadcrumbs {
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 90; /* Below header and mega menu */
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, opacity;
}

/* Container */
.breadcrumbs .container {
    margin: 0 auto;
    padding: 0 20px;
}

/* Breadcrumb list */
.breadcrumb-list,
.breadcrumbs ol {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 14px;
}

/* Breadcrumb items */
.breadcrumb-item,
.breadcrumbs li {
    display: flex;
    align-items: center;
    color: #ffffff;
    text-shadow: 0px 1px 3px #00000042;
}

.breadcrumb-item:not(:last-child)::after,
.breadcrumbs li:not(:last-child)::after {
    content: "›";
    margin-left: 8px;
    color: #ffffff;
    font-size: 16px;
    font-weight: 400;
}

/* Links */
.breadcrumb-item a,
.breadcrumbs a {
    color: #ffffff;
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb-item a:hover,
.breadcrumbs a:hover {
color: #ff6c00;
}

/* Current page (active) */
.breadcrumb-item.active,
.breadcrumbs li:last-child {
    color: #ffffff;
    font-weight: 500;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.breadcrumb-item.active span,
.breadcrumbs li:last-child span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Scroll behavior states */
.breadcrumbs--visible {
    transform: translateY(0);
    opacity: 1;
}

.breadcrumbs--hidden {
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
}

/* Hide breadcrumbs when mobile menu is open */
body.mobile-menu-open .breadcrumbs {
    display: none;
}

/* Responsive */
@media (max-width: 768px) {
    .breadcrumbs {
        padding: 10px 0;
        font-size: 13px;
    }
    
    .breadcrumbs .container {
        padding: 0 16px;
    }
    
    .breadcrumb-list,
    .breadcrumbs ol {
        gap: 6px;
        font-size: 13px;
    }
    
    .breadcrumb-item:not(:last-child)::after,
    .breadcrumbs li:not(:last-child)::after {
        margin-left: 6px;
        font-size: 14px;
    }
    
    /* Truncate last item more aggressively on mobile */
    .breadcrumb-item.active,
    .breadcrumbs li:last-child {
        max-width: 200px;
    }
}

/* Print styles */
@media print {
    .breadcrumbs {
        position: static;
        border: none;
        padding: 8px 0;
    }
    
    .breadcrumbs--hidden {
        transform: none;
        opacity: 1;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .breadcrumbs {
        transition: none;
    }
}

/* ==============================================
   BREADCRUMBS FOR LIGHT BACKGROUNDS (Blue Header Pages)
   When body has .custom-header-blue, the page has a light background
   so breadcrumbs need dark text colors
   ============================================== */

.custom-header-blue .breadcrumbs {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.custom-header-blue .breadcrumb-item,
.custom-header-blue .breadcrumbs li {
    color: #4a5568;
    text-shadow: none;
}

.custom-header-blue .breadcrumb-item:not(:last-child)::after,
.custom-header-blue .breadcrumbs li:not(:last-child)::after {
    color: #a0aec0;
}

.custom-header-blue .breadcrumb-item a,
.custom-header-blue .breadcrumbs a {
    color: #2d3748;
}

.custom-header-blue .breadcrumb-item a:hover,
.custom-header-blue .breadcrumbs a:hover {
    color: #1461b2;
}

.custom-header-blue .breadcrumb-item.active,
.custom-header-blue .breadcrumbs li:last-child {
    color: #1a202c;
    font-weight: 600;
}
