/**
 * Wamia Header - Infinite Categories Scroller CSS
 * 
 * BEM naming convention with design system compliance
 * Responsive design with CSS custom properties
 * Accessibility and performance optimized
 * 
 * Lines-limit-guard: 500
 */

:root {
    /* Design system colors */
    --wamia-brand-primary: #ED6F26;
    --wamia-brand-primary-hover: #F88D46;
    --wamia-brand-primary-active: #D65E1D;
    --wamia-neutral-100: #FFFFFF;
    --wamia-neutral-300: #EEEEEE;
    --wamia-neutral-400: #D6D6D6;
    --wamia-neutral-600: #7A7A7A;
    --wamia-neutral-700: #4D4D4D;
    
    /* Scroller configuration */
    --featured-cats-gap: 28px;
    --featured-cats-peek: 14px;
    --featured-cats-underline-width: 100%;
    --featured-cats-underline-height: 3px;
    
    /* Responsive breakpoints */
    --mobile-small: 320px;
    --mobile-medium: 420px;
    --tablet: 768px;
}

/* Container with top border matching existing design */
.featured-cats {
    border-top: 1px solid var(--wamia-neutral-400);
    background: var(--wamia-neutral-100);
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Arrow indicators for scroll direction */
.featured-cats-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 48px;
    color: var(--wamia-neutral-600);
    background: linear-gradient(90deg, 
        var(--wamia-neutral-100) 0%, 
        rgba(255, 255, 255, 0.9) 50%, 
        rgba(255, 255, 255, 0.7) 100%);
    position: relative;
    z-index: 2;
    pointer-events: none;
    flex-shrink: 0;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.featured-cats-arrow--left {
    background: linear-gradient(90deg, 
        var(--wamia-neutral-100) 0%, 
        rgba(255, 255, 255, 0.9) 70%, 
        rgba(255, 255, 255, 0.3) 100%);
    margin-right: -8px;
}

.featured-cats-arrow--right {
    background: linear-gradient(270deg, 
        var(--wamia-neutral-100) 0%, 
        rgba(255, 255, 255, 0.9) 70%, 
        rgba(255, 255, 255, 0.3) 100%);
    margin-left: -8px;
}

.featured-cats-arrow svg {
    width: 16px;
    height: 16px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

/* Viewport - only this scrolls, no padding for edge peek effect */
.featured-cats-viewport {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE 10+ */
    flex: 1;
    
    /* Performance optimizations */
    will-change: scroll-position;
    backface-visibility: hidden;
    transform: translateZ(0);
    
    /* Accessibility - scroll-behavior removed for manual control */
}

/* Hide scrollbars completely */
.featured-cats-viewport::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

/* Respect reduced motion preference - scroll-behavior removed entirely */
@media (prefers-reduced-motion: reduce) {
    .featured-cats-viewport {
        /* No scroll-behavior modification needed */
    }
}

/* Track - single continuous flex row with configurable gap */
.featured-cats-track {
    display: flex;
    gap: var(--featured-cats-gap);
    white-space: nowrap;
    align-items: center;
    
    /* Prevent layout shift during initialization */
    min-height: 48px;
}

/* Category items - BEM naming for clarity */
.featured-cats-track > a {
    /* Layout */
    flex: 0 0 auto;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    
    /* Spacing - meeting UX requirements */

    min-height: 44px; /* iOS touch target requirement */
    min-width: 44px; /* Minimum clickable area */
    
    /* Typography */
    font-family: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    color: var(--wamia-neutral-700);
    
    /* Interactions */
    cursor: pointer;
    transition: color 0.3s ease, transform 0.2s ease;
    
    /* Accessibility */
    outline: none;
}

/* Hover state */
.featured-cats-track > a:hover {
    transform: translateY(-1px);
}



/* Active press state */
.featured-cats-track > a:active {
    transform: translateY(0);
    color: var(--wamia-brand-primary-active);
}

/* Active/selected state with orange underline */
.featured-cats-track > a.is-active,
.featured-cats-track > a[data-active="true"] {
    color: var(--wamia-brand-primary);
    font-weight: 600;
}

/* Active state underline - centered orange bar */
.featured-cats-track > a.is-active::after,
.featured-cats-track > a[data-active="true"]::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 100%;
    height: var(--featured-cats-underline-height);
    background: var(--wamia-brand-primary);
    border-radius: 2px;
}

/* Responsive adjustments */
@media (max-width: 420px) {
    :root {
        --featured-cats-gap: 20px;
    }
    
    .featured-cats-track > a {
        font-size: 14px;
        min-width: 40px;
    }
    
    .featured-cats-arrow {
        width: 24px;
        height: 40px;
    }
    
    .featured-cats-arrow svg {
        width: 12px;
        height: 12px;
    }
}

@media (max-width: 320px) {
    :root {
        --featured-cats-gap: 16px;

    }
    
    .featured-cats-track > a {
        font-size: 13px;

    }
}

/* Tablet and desktop optimizations */
@media (min-width: 768px) {
    :root {
        --featured-cats-gap: 32px;
 
    }
    
    .featured-cats-track > a {
        font-size: 18px;
       
        min-height: 48px;
        min-width: 48px;
    }
    
    /* Enhanced hover effects for desktop */
    .featured-cats-track > a:hover {
        transform: translateY(-2px);
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .featured-cats-track > a {
        border: 1px solid transparent;
    }
    
    .featured-cats-track > a:focus {
        border-color: currentColor;
        outline: none;
    }
    
    .featured-cats-track > a.is-active::after,
    .featured-cats-track > a[data-active="true"]::after {
        border: 1px solid var(--wamia-brand-primary);
    }
}

/* RTL support */
[dir="rtl"] .featured-cats-viewport {
    direction: rtl;
}

[dir="rtl"] .featured-cats-track {
    direction: rtl;
}

/* Loading state (optional enhancement) */
.featured-cats--loading .featured-cats-track > a {
    opacity: 0.6;
    pointer-events: none;
}

/* Animation for smooth category additions */
@keyframes fadeInCategory {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.featured-cats-track > a[data-new] {
    animation: fadeInCategory 0.3s ease forwards;
}

/* Print styles */
@media print {
    .featured-cats {
        display: none;
    }
}

/* Wamia products container spacing adjustment for mobile */
@media (max-width: 767px) {
    .wamia-products-container {
        margin-top: 50px;
    }
}



/* Remove cart-summary margin-top only on checkout cart page */
body.checkout-cart-index .cart-summary {
    margin-top: 0 !important;
}

/* ===== 3-PART HEADER STRUCTURE ===== */

/* Header Part 1: Navigation & Logo - Static positioning (original) */
.wamia-header-part-1 {
    position: static !important;
    display: block;
    width: 100%;
    background: #FFFFFF;
    border-bottom: 1px solid #EEEEEE;
    z-index: auto;
}

/* Sticky Header on Scroll - MOBILE ONLY */
@media (max-width: 1088px) {
    .wamia-sticky-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        background: #FFFFFF;
        border-bottom: 1px solid #EEEEEE;
        z-index: 1000;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
        transform: translateY(-100%);
        transition: transform 0.3s ease-in-out;
        opacity: 0;
        visibility: hidden;
    }

    .wamia-sticky-header.show {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
}

/* Hide sticky header on desktop */
@media (min-width: 1089px) {
    .wamia-sticky-header {
        display: none !important;
    }
}

/* Ensure proper badge positioning in sticky header - MOBILE ONLY */
@media (max-width: 1088px) {
    .wamia-sticky-header .mobile-action-icon-container {
        position: relative;
    }

    .wamia-sticky-header .badge-count {
        position: absolute;
        top: -8px;
        right: -8px;
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 18px;
        min-height: 18px;
        width: 18px;
        height: 18px;
        padding: 0;
        background-color: #ED6F26;
        color: #FFFFFF;
        font-size: 11px;
        font-weight: 700;
        line-height: 1;
        border-radius: 50%;
        border: 2px solid #FFFFFF;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
        z-index: 10;
    }
}

/* Header Part 2: Search - Static positioning */
.wamia-header-part-2 {
    position: static !important;
    display: block;
    width: 100%;
    background: #FFFFFF;
    border-bottom: 1px solid #EEEEEE;
    z-index: auto;
}

/* Header Part 3: Categories - Static positioning */
.wamia-header-part-3 {
    position: static !important;
    display: block;
    width: 100%;
    background: #FFFFFF;
    border-bottom: 1px solid #EEEEEE;
    z-index: auto;
}

/* ===== MINIMAL HEADER MODE - MOBILE ONLY ===== */

/* Override conflicting CSS from two-tier-header.css for minimal header pages */
@media (min-width: 768px) and (max-width: 1088px) {
    /* Override fixed positioning from two-tier-header.css on minimal header pages */
    .wamia-header-part-1.minimal-header-mode {
     
        top: auto !important;
        left: auto !important;
        right: auto !important;
        width: auto !important;
        z-index: auto !important;
    }
    
    /* Remove body padding when header is not fixed */
    body:has(.wamia-header-part-1.minimal-header-mode),
    body.minimal-header-body {
        padding-top: 0 !important;
    }
    
    /* Override any mobile header fixed positioning on minimal pages */
    .minimal-header-body .wamia-mobile-header,
    .wamia-mobile-header:has(.minimal-header-mode) {
   
        top: auto !important;
        left: auto !important;
        right: auto !important;
        width: auto !important;
        z-index: auto !important;
    }
}

/* Additional overrides for smaller screens */
@media (max-width: 767px) {
    /* Override any mobile header fixed positioning on minimal pages */
    .minimal-header-body .wamia-mobile-header,
    .wamia-mobile-header:has(.minimal-header-mode) {
   
        top: auto !important;
        left: auto !important;
        right: auto !important;
        width: auto !important;
        z-index: auto !important;
    }
    
    /* Remove body padding on smaller screens too */
    body:has(.wamia-header-part-1.minimal-header-mode),
    body.minimal-header-body {
        padding-top: 0 !important;
    }
}

/* Minimal header styling for customer account pages */
@media (max-width: 1088px) {
    .wamia-header-part-1.minimal-header-mode {
        
        background: var(--wamia-neutral-100);
        border-bottom: 1px solid var(--wamia-neutral-300);
        z-index: 1000;
        /* Keep header static, prevent any sticky behavior */
    }
    
    /* Ensure minimal header is never sticky */
    .wamia-header-part-1.minimal-header-mode .wamia-sticky-header {
        display: none !important;
    }
    
    /* Enhanced visual separator for minimal header */
    .wamia-header-part-1.minimal-header-mode {
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    }
    
    /* Ensure proper spacing and alignment in minimal mode */
    .wamia-header-part-1.minimal-header-mode .mobile-header-top {
        height: 64px;
        padding: 0 16px;
    }
    
    /* Search icon styling in minimal header - removed orange colors */
    .wamia-header-part-1.minimal-header-mode .mobile-search-link {
        background: transparent;
        border-radius: 8px;
        padding: 8px;
        transition: background-color 0.2s ease;
    }
    
    .wamia-header-part-1.minimal-header-mode .mobile-search-link:hover,
    .wamia-header-part-1.minimal-header-mode .mobile-search-link:focus {
        background: rgba(0, 0, 0, 0.05);
    }
    
    .wamia-header-part-1.minimal-header-mode .mobile-search-link .icon-search {
        color: var(--wamia-neutral-700);
    }
}

/* Hide social login blocks on customer login page */
.minimal-header-body .social-login-authentication-channel,
.minimal-header-body .account-social-login,
.minimal-header-body .block.social-login-authentication-channel,
.minimal-header-body .block.account-social-login {
    display: none !important;
}

/* Ensure minimal header has proper mobile styling */
@media (max-width: 1088px) {
    .wamia-header-part-1.minimal-header-mode .header-part-1-container {
        padding: 0 16px;
        max-width: 100%;
    }
    
    .wamia-header-part-1.minimal-header-mode .mobile-header-top {
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: 64px;
        gap: 8px;
    }
    
    .wamia-header-part-1.minimal-header-mode .mobile-user-actions {
        display: flex;
        align-items: center;
        gap: 8px;
    }
    
    .wamia-header-part-1.minimal-header-mode .mobile-action-link {
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 48px;
        min-height: 48px;
        padding: 12px;
        border-radius: 8px;
        transition: background-color 0.2s ease;
    }
}

/* Hide sticky header behavior completely on minimal header pages - MOBILE ONLY */
@media (max-width: 1088px) {
    [data-minimal-header="true"] ~ .wamia-sticky-header {
        display: none !important;
    }
    
    /* Ensure no scroll-triggered sticky behavior */
    body[data-page-type*="customer"] .wamia-sticky-header,
    body[data-page-type*="account"] .wamia-sticky-header,
    body[data-page-type*="wamia_"] .wamia-sticky-header {
        display: none !important;
    }
    
    /* Disable all CSS transitions and transforms on minimal header */
    .wamia-header-part-1.minimal-header-mode,
    .wamia-header-part-1.minimal-header-mode * {
        transform: none !important;
        transition: none !important;
  
    }
    
    /* Ensure minimal header never gets scroll-based classes */
    .wamia-header-part-1.minimal-header-mode.scrolled {
        position: static !important;
        background: var(--wamia-neutral-100) !important;
    }
}

/* Disable all desktop sticky behavior on minimal header pages */
@media (min-width: 1089px) {
    [data-minimal-header="true"] ~ .wamia-header-top {
        position: static !important;
        transform: none !important;
        transition: none !important;
    }
    
    [data-minimal-header="true"] ~ .wamia-header-bottom {
        position: static !important;
        padding-top: 0 !important;
    }
}

/* Remove any fixed/sticky positioning from mobile header elements */
.mobile-header-top {
    position: static !important;
}

/* Ensure body/main content flows naturally after the header parts */
body {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

.page-wrapper,
.main-container,
.columns {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Override Codazon theme's page-wrapper min-height */
.page-wrapper {
    min-height: auto !important;
    /* Keep flexbox but remove the 100vh constraint */
}