/**
 * NDN Header Components Styles
 */

.ndn-header-components {
    display: flex;
    align-items: center;
    gap: 20px;
}

.ndn-header-components.vertical {
    flex-direction: column;
    align-items: flex-start;
}

.ndn-header-component {
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ndn-header-component:hover {
    transform: translateY(-2px);
}

.ndn-header-component-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #333;
    transition: color 0.3s ease;
}

.ndn-header-component-icon svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
}

/* Component Badge */
.ndn-component-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #c53030;
    color: white;
    border-radius: 50%;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    font-family: 'azo-sans-web', Arial, sans-serif;
    line-height: 1;
    padding: 2px;
}

/* Search Component */
.ndn-search-component {
    position: relative;
}

.ndn-search-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.ndn-search-toggle:hover {
    background: rgba(197, 48, 48, 0.1);
}

.ndn-search-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    padding: 1rem;
    min-width: 300px;
    z-index: 1000;
    margin-top: 8px;
}

.ndn-search-dropdown .search-form {
    margin: 0;
}

.ndn-search-dropdown .search-form .search-field {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: 'azo-sans-web', Georgia, serif;
}

.ndn-search-dropdown .search-form .search-submit {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: #c53030;
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    color: white;
    cursor: pointer;
}

/* Wishlist Component */
.ndn-wishlist-component a {
    display: flex;
    align-items: center;
    text-decoration: none;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.ndn-wishlist-component a:hover {
    background: rgba(197, 48, 48, 0.1);
}

/* Cart Component */
.ndn-cart-component {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ndn-cart-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
    position: relative;
}

.ndn-cart-link:hover {
    background: rgba(197, 48, 48, 0.1);
}

.ndn-cart-total {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.ndn-cart-total-amount {
    font-family: 'azo-sans-web', Arial, sans-serif;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

/* Currency Component */
.ndn-currency-component {
    position: relative;
    z-index: 100;
}

.ndn-currency-switcher {
    position: relative;
    display: inline-block;
}

.ndn-currency-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    background: black;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    font-family: 'azo-sans-web', Arial, sans-serif;
    font-weight: 600;
    transition: border-color 0.2s ease;
    width: auto;
    min-width: 70px;
}

.ndn-currency-toggle:hover,
.ndn-currency-toggle:focus {
    border-color: #c53030;
    outline: none;
    box-shadow: 0 0 0 1px rgba(197, 48, 48, 0.2);
}

.ndn-current-currency {
    font-size: 14px;
    color: #333;
    white-space: nowrap;
}

.ndn-currency-dropdown {
    position: absolute;
    top: calc(100% + 2px);
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    z-index: 1001;
    min-width: 220px;
    max-height: 300px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-5px);
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
}

.ndn-currency-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.ndn-currency-options {
    padding: 8px 0;
}

.ndn-currency-option {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 12px 16px;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
    font-family: 'azo-sans-web', Georgia, serif;
    position: relative;
    /* Base color controlled by Elementor dropdown_text_color setting */
}

.ndn-currency-option:hover,
.ndn-currency-option:focus {
    background: #f8f9fa;
    outline: none;
}

.ndn-currency-option.active {
    background: rgba(197, 48, 48, 0.1);
    color: #c53030 !important;
}

.ndn-currency-option.active::after {
    content: '✓';
    position: absolute;
    right: 16px;
    color: #c53030;
    font-weight: bold;
}

.ndn-currency-option .currency-symbol {
    font-weight: 600;
    font-family: 'azo-sans-web', Arial, sans-serif;
    min-width: 20px;
}

.ndn-currency-option .currency-code {
    font-weight: 600;
    font-family: 'azo-sans-web', Arial, sans-serif;
    min-width: 35px;
}

.ndn-currency-option .currency-name {
    font-size: 13px;
    /* Color now controlled by Elementor dropdown_text_muted_color setting */
}

/* Ensure dropdown colors override any parent/inherited styles */
.ndn-currency-dropdown .ndn-currency-option {
    color: inherit !important; /* Will use Elementor dropdown_text_color */
}

.ndn-currency-dropdown .ndn-currency-option .currency-symbol,
.ndn-currency-dropdown .ndn-currency-option .currency-code {
    color: inherit; /* Inherit from parent option */
}

.ndn-currency-dropdown .ndn-currency-option .currency-name {
    /* Color controlled by Elementor dropdown_text_muted_color */
    opacity: 0.8; /* Slight transparency for muted effect */
}

/* Active state with better contrast for light background */
.ndn-currency-dropdown .ndn-currency-option.active {
    background: rgba(197, 48, 48, 0.1);
    color: #c53030 !important;
}

.ndn-currency-dropdown .ndn-currency-option.active .currency-symbol,
.ndn-currency-dropdown .ndn-currency-option.active .currency-code {
    color: #c53030 !important;
}

.ndn-currency-dropdown .ndn-currency-option.active .currency-name {
    color: rgba(197, 48, 48, 0.7) !important;
    opacity: 1;
}

.ndn-currency-dropdown .ndn-currency-option.active::after {
    color: #c53030 !important;
}

/* Menu Styles */
.ndn-desktop-menu {
    display: block;
}

.ndn-desktop-menu a {
    text-transform: uppercase;
}

.ndn-mobile-menu-toggle {
    display: none;
}

.ndn-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
}

.ndn-menu li {
    position: relative;
    margin: 0;
}

.ndn-menu a {
    display: block;
    padding: 12px 16px;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    font-family: 'azo-sans-web', Arial, sans-serif;
    transition: all 0.3s ease;
    border-radius: 4px;
}

.ndn-menu a:hover,
.ndn-menu .current-menu-item > a,
.ndn-menu .current-menu-ancestor > a {
    color: #c53030;
}

/* Mobile Menu Button */
.ndn-mobile-menu-button {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.ndn-hamburger-icon {
    display: flex;
    flex-direction: column;
    width: 24px;
    height: 18px;
    justify-content: space-between;
}

.ndn-hamburger-icon span {
    display: block;
    height: 2px;
    width: 100%;
    background: #333;
    transition: all 0.3s ease;
}

.ndn-mobile-menu-button[aria-expanded="true"] .ndn-hamburger-icon span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.ndn-mobile-menu-button[aria-expanded="true"] .ndn-hamburger-icon span:nth-child(2) {
    opacity: 0;
}

.ndn-mobile-menu-button[aria-expanded="true"] .ndn-hamburger-icon span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Hide search on mobile */
.ndn-hide-mobile {
    display: block;
}

@media (max-width: 768px) {
    .ndn-hide-mobile {
        display: none !important;
    }
}

/* Product Search Form Styling */
.ndn-product-search-form {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.ndn-product-search-form .search-field {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s ease;
}

.ndn-product-search-form .search-field:focus {
    border-color: #c53030;
    box-shadow: 0 0 0 2px rgba(197, 48, 48, 0.2);
}

.ndn-product-search-form .search-submit {
    background: #c53030;
    border: none;
    border-radius: 6px;
    padding: 12px;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ndn-product-search-form .search-submit:hover {
    background: #a02626;
}

.ndn-product-search-form .search-submit svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}

.ndn-product-search-form .screen-reader-text {
    position: absolute;
    left: -9999px;
    top: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Responsive Menu */
@media (max-width: 768px) {
    .ndn-desktop-menu {
        display: none;
    }
    
    .ndn-mobile-menu-toggle {
        display: block;
    }
    
    .ndn-header-components.horizontal {
        flex-wrap: wrap;
    }
}

/* Submenu Support */
.ndn-menu .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    min-width: 200px;
    z-index: 1000;
    padding: 8px 0;
}

.ndn-menu li:hover .sub-menu {
    display: block;
}

.ndn-menu .sub-menu li {
    width: 100%;
}

.ndn-menu .sub-menu a {
    padding: 8px 16px;
    border-radius: 0;
    font-size: 14px;
}

.ndn-menu .sub-menu a:hover {
    background-color: #f5f5f5;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .ndn-header-components {
        gap: 15px;
    }
    
    .ndn-header-components.horizontal {
        flex-wrap: wrap;
    }
    
    .ndn-search-dropdown,
    .ndn-currency-dropdown {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 90vw;
        max-width: 400px;
    }
    
    .ndn-cart-total {
        display: none;
    }
    
    .ndn-currency-toggle {
        padding: 6px 10px;
    }
    
    .ndn-header-component-icon {
        font-size: 20px;
    }
    
    .ndn-header-component-icon svg {
        width: 20px;
        height: 20px;
    }
}

/* Animation for dropdowns */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ndn-search-dropdown,
.ndn-currency-dropdown {
    animation: fadeInDown 0.3s ease;
}

/* Focus states for accessibility */
.ndn-search-toggle:focus,
.ndn-currency-toggle:focus,
.ndn-cart-link:focus,
.ndn-wishlist-component a:focus {
    outline: 2px solid #c53030;
    outline-offset: 2px;
}

.ndn-currency-option:focus {
    background: rgba(197, 48, 48, 0.1);
    outline: none;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .ndn-header-component-icon {
        color: #000;
    }
    
    .ndn-component-badge {
        background: #000;
        color: #fff;
    }
    
    .ndn-currency-toggle {
        border-color: #000;
    }
}
