/**
 * HDM Premium Header v4.0 - Modern Hybrid Design
 * 
 * Ultra-clean, professional e-commerce header
 * 
 * @package     HDM_Market
 * @version     4.0.0
 * 
 * Structure:
 * 1. CSS Variables
 * 2. Base & Resets
 * 3. Announcement Bar
 * 4. Main Header
 * 5. Logo
 * 6. Search
 * 7. Actions (Account, Wishlist, Cart)
 * 8. Navigation
 * 9. Mega Menu
 * 10. Mobile Menu
 * 11. Animations
 * 12. Responsive
 */

/* ==========================================================================
   1. CSS VARIABLES
   ========================================================================== */

:root {
    /* Brand Colors */
    --hdm-primary: #6A4532;
    --hdm-primary-dark: #4a2f22;
    --hdm-primary-light: #8B5A3C;
    --hdm-accent: #C89737;
    --hdm-accent-dark: #a87e2c;
    --hdm-accent-light: #D4A84A;
    --hdm-cream: #FDF9F6;
    --hdm-cream-dark: #F5EFE7;
    
    /* Neutrals */
    --hdm-white: #FFFFFF;
    --hdm-black: #1a1a1a;
    --hdm-gray-50: #f9fafb;
    --hdm-gray-100: #f3f4f6;
    --hdm-gray-200: #e5e7eb;
    --hdm-gray-300: #d1d5db;
    --hdm-gray-400: #9ca3af;
    --hdm-gray-500: #6b7280;
    --hdm-gray-600: #4b5563;
    --hdm-gray-700: #374151;
    --hdm-gray-800: #1f2937;
    
    /* Semantic */
    --hdm-success: #10b981;
    --hdm-error: #ef4444;
    --hdm-warning: #f59e0b;
    
    /* Typography */
    --hdm-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --hdm-font-display: 'Playfair Display', Georgia, serif;
    
    /* Spacing */
    --hdm-header-height: 70px;
    --hdm-nav-height: 46px;
    --hdm-announce-height: 40px;
    --hdm-container: 1400px;
    --hdm-gutter: 20px;
    
    /* Effects */
    --hdm-shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --hdm-shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --hdm-shadow-lg: 0 10px 40px rgba(0,0,0,0.15);
    --hdm-radius: 8px;
    --hdm-transition: 200ms ease;
}

/* ==========================================================================
   2. BASE & RESETS
   ========================================================================== */

.hdm-header-wrapper {
    font-family: var(--hdm-font);
    line-height: 1.5;
    color: var(--hdm-gray-800);
    -webkit-font-smoothing: antialiased;
    position: relative;
    z-index: 1000;
}

.hdm-header-wrapper *,
.hdm-header-wrapper *::before,
.hdm-header-wrapper *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.hdm-header-wrapper a {
    color: inherit;
    text-decoration: none;
}

.hdm-header-wrapper button {
    font-family: inherit;
    border: none;
    background: none;
    cursor: pointer;
}

.hdm-header-wrapper ul {
    list-style: none;
}

.hdm-header-wrapper img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Hide Flatsome header */
body.hdm-premium-header-active .header-wrapper,
body.hdm-premium-header-active #masthead,
body.hdm-premium-header-active .header-main,
body.hdm-premium-header-active .header-top,
body.hdm-premium-header-active .header-bottom,
body.hdm-premium-header-active .top-divider {
    display: none !important;
}

/* ==========================================================================
   3. ANNOUNCEMENT BAR
   ========================================================================== */

.hdm-announce {
    background: linear-gradient(135deg, var(--hdm-primary) 0%, var(--hdm-primary-dark) 100%);
    height: var(--hdm-announce-height);
    position: relative;
    overflow: hidden;
}

.hdm-announce.dismissed {
    display: none;
}

.hdm-announce-inner {
    max-width: var(--hdm-container);
    margin: 0 auto;
    padding: 0 var(--hdm-gutter);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.hdm-announce-slider {
    flex: 1;
    text-align: center;
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hdm-announce-slide {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--hdm-white);
    font-size: 0.9rem;
    font-weight: 500;
    animation: hdm-fadeIn 0.5s ease;
}

.hdm-announce-slide.active {
    display: flex;
}

.hdm-announce-icon {
    font-size: 1.1rem;
}

.hdm-announce-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hdm-announce-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--hdm-white);
    transition: opacity var(--hdm-transition);
}

.hdm-announce-link:hover {
    opacity: 0.9;
}

.hdm-announce-cta {
    background: rgba(255,255,255,0.2);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    margin-left: 8px;
    transition: background var(--hdm-transition);
}

.hdm-announce-link:hover .hdm-announce-cta {
    background: rgba(255,255,255,0.3);
}

.hdm-announce-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    position: absolute;
    right: 60px;
}

.hdm-announce-nav {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.7);
    border-radius: 50%;
    transition: all var(--hdm-transition);
}

.hdm-announce-nav:hover {
    color: var(--hdm-white);
    background: rgba(255,255,255,0.1);
}

.hdm-announce-dots {
    display: flex;
    gap: 6px;
}

.hdm-announce-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    transition: all var(--hdm-transition);
}

.hdm-announce-dot.active {
    background: var(--hdm-white);
    transform: scale(1.2);
}

.hdm-announce-close {
    position: absolute;
    right: var(--hdm-gutter);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.7);
    border-radius: 6px;
    transition: all var(--hdm-transition);
}

.hdm-announce-close:hover {
    color: var(--hdm-white);
    background: rgba(255,255,255,0.1);
}

/* ==========================================================================
   4. MAIN HEADER
   ========================================================================== */

.hdm-header {
    background: var(--hdm-white);
    box-shadow: var(--hdm-shadow-sm);
    position: relative;
    z-index: 100;
}

.hdm-header-inner {
    max-width: var(--hdm-container);
    margin: 0 auto;
    padding: 0 var(--hdm-gutter);
}

.hdm-header-main {
    display: flex;
    align-items: center;
    gap: 24px;
    height: var(--hdm-header-height);
}

/* Mobile Toggle */
.hdm-mobile-toggle {
    display: none;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    border-radius: var(--hdm-radius);
    transition: background var(--hdm-transition);
    flex-shrink: 0;
}

.hdm-mobile-toggle:hover {
    background: var(--hdm-gray-100);
}

.hdm-hamburger {
    width: 20px;
    height: 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hdm-hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--hdm-primary);
    border-radius: 1px;
    transition: all 0.3s ease;
}

.hdm-mobile-toggle[aria-expanded="true"] .hdm-hamburger span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.hdm-mobile-toggle[aria-expanded="true"] .hdm-hamburger span:nth-child(2) {
    opacity: 0;
}

.hdm-mobile-toggle[aria-expanded="true"] .hdm-hamburger span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* ==========================================================================
   5. LOGO
   ========================================================================== */

.hdm-logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.hdm-logo-img {
    height: 44px;
    width: auto;
    max-width: 160px;
    object-fit: contain;
}

/* ==========================================================================
   6. SEARCH
   ========================================================================== */

.hdm-search {
    flex: 1;
    max-width: 680px;
    position: relative;
}

.hdm-search-form {
    position: relative;
}

.hdm-search-box {
    display: flex;
    align-items: stretch;
    background: var(--hdm-gray-100);
    border: 2px solid var(--hdm-gray-200);
    border-radius: 50px;
    overflow: hidden;
    transition: all var(--hdm-transition);
}

.hdm-search-box:focus-within {
    background: var(--hdm-white);
    border-color: var(--hdm-accent);
    box-shadow: 0 0 0 4px rgba(200, 151, 55, 0.1);
}

/* Category Button */
.hdm-search-cat-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 16px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--hdm-gray-600);
    border-right: 1px solid var(--hdm-gray-300);
    white-space: nowrap;
    transition: color var(--hdm-transition);
}

.hdm-search-cat-btn:hover {
    color: var(--hdm-primary);
}

.hdm-search-cat-arrow {
    transition: transform var(--hdm-transition);
}

.hdm-search-cat-btn[aria-expanded="true"] .hdm-search-cat-arrow {
    transform: rotate(180deg);
}

/* Category Dropdown */
.hdm-search-cat-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: var(--hdm-white);
    border: 1px solid var(--hdm-gray-200);
    border-radius: var(--hdm-radius);
    box-shadow: var(--hdm-shadow-lg);
    min-width: 200px;
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--hdm-transition);
    z-index: 100;
}

.hdm-search-cat-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.hdm-search-cat-option {
    display: block;
    width: 100%;
    padding: 10px 16px;
    text-align: left;
    font-size: 0.9rem;
    color: var(--hdm-gray-700);
    transition: all var(--hdm-transition);
}

.hdm-search-cat-option:hover {
    background: var(--hdm-cream);
    color: var(--hdm-primary);
}

.hdm-search-cat-option.active {
    background: var(--hdm-cream);
    color: var(--hdm-accent);
    font-weight: 600;
}

/* Search Input */
.hdm-search-input {
    flex: 1;
    min-width: 0;
    height: 48px;
    padding: 0 16px;
    border: none;
    background: transparent;
    font-size: 0.95rem;
    color: var(--hdm-gray-800);
    outline: none;
}

.hdm-search-input::placeholder {
    color: var(--hdm-gray-400);
}

/* Search Button */
.hdm-search-btn {
    width: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--hdm-accent);
    color: var(--hdm-white);
    transition: background var(--hdm-transition);
}

.hdm-search-btn:hover {
    background: var(--hdm-accent-dark);
}

/* Search Results Dropdown */
.hdm-search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--hdm-white);
    border: 1px solid var(--hdm-gray-200);
    border-radius: var(--hdm-radius);
    box-shadow: var(--hdm-shadow-lg);
    max-height: 400px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--hdm-transition);
    z-index: 100;
}

.hdm-search-results.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* ==========================================================================
   7. ACTIONS (Account, Wishlist, Cart)
   ========================================================================== */

.hdm-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.hdm-action {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: var(--hdm-radius);
    color: var(--hdm-gray-700);
    font-size: 0.875rem;
    transition: all var(--hdm-transition);
}

.hdm-action:hover {
    background: var(--hdm-cream);
    color: var(--hdm-primary);
}

.hdm-action svg {
    flex-shrink: 0;
}

.hdm-action-label {
    font-weight: 500;
}

.hdm-action-help {
    display: flex;
}

/* Account */
.hdm-action-account {
    position: relative;
    padding: 0;
}

.hdm-account-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    border-radius: var(--hdm-radius);
    transition: background var(--hdm-transition);
}

.hdm-account-btn:hover {
    background: var(--hdm-cream);
}

.hdm-account-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--hdm-gray-200);
}

.hdm-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hdm-account-guest svg {
    width: 28px;
    height: 28px;
    color: var(--hdm-gray-500);
}

.hdm-account-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
}

.hdm-account-greeting {
    font-size: 0.7rem;
    color: var(--hdm-gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hdm-account-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--hdm-gray-800);
}

.hdm-account-arrow {
    color: var(--hdm-gray-400);
    transition: transform var(--hdm-transition);
}

.hdm-account-btn[aria-expanded="true"] .hdm-account-arrow {
    transform: rotate(180deg);
}

/* Account Dropdown */
.hdm-account-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 280px;
    background: var(--hdm-white);
    border: 1px solid var(--hdm-gray-200);
    border-radius: 12px;
    box-shadow: var(--hdm-shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--hdm-transition);
    z-index: 200;
    overflow: hidden;
}

.hdm-account-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.hdm-account-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: linear-gradient(135deg, var(--hdm-cream) 0%, var(--hdm-cream-dark) 100%);
    border-bottom: 1px solid var(--hdm-gray-200);
}

.hdm-dropdown-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--hdm-white);
    box-shadow: var(--hdm-shadow-sm);
}

.hdm-account-details {
    flex: 1;
    min-width: 0;
}

.hdm-account-details strong {
    display: block;
    font-size: 0.95rem;
    color: var(--hdm-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hdm-account-details span {
    display: block;
    font-size: 0.8rem;
    color: var(--hdm-gray-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hdm-account-nav {
    padding: 8px 0;
}

.hdm-account-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    font-size: 0.9rem;
    color: var(--hdm-gray-700);
    transition: all var(--hdm-transition);
}

.hdm-account-nav a:hover {
    background: var(--hdm-cream);
    color: var(--hdm-primary);
}

.hdm-account-nav a svg {
    color: var(--hdm-gray-400);
    transition: color var(--hdm-transition);
}

.hdm-account-nav a:hover svg {
    color: var(--hdm-accent);
}

.hdm-vendor-link {
    background: var(--hdm-cream) !important;
    border-top: 1px solid var(--hdm-gray-200);
    border-bottom: 1px solid var(--hdm-gray-200);
    margin: 4px 0;
}

.hdm-badge {
    background: var(--hdm-error);
    color: var(--hdm-white);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    margin-left: auto;
}

.hdm-account-footer {
    padding: 8px 16px 12px;
    border-top: 1px solid var(--hdm-gray-200);
}

.hdm-logout {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: var(--hdm-gray-500);
    transition: color var(--hdm-transition);
}

.hdm-logout:hover {
    color: var(--hdm-error);
}

/* Wishlist */
.hdm-action-wishlist {
    position: relative;
}

/* Cart */
.hdm-action-cart {
    background: var(--hdm-cream);
    padding: 8px 16px;
    border-radius: 50px;
}

.hdm-action-cart:hover {
    background: var(--hdm-cream-dark);
}

.hdm-cart-icon {
    position: relative;
}

.hdm-cart-badge {
    position: absolute;
    top: -6px;
    right: -8px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--hdm-accent);
    color: var(--hdm-white);
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hdm-cart-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
}

.hdm-cart-label {
    font-size: 0.7rem;
    color: var(--hdm-gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hdm-cart-total {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--hdm-primary);
}

/* ==========================================================================
   8. NAVIGATION
   ========================================================================== */

.hdm-nav {
    background: var(--hdm-primary);
    height: var(--hdm-nav-height);
}

.hdm-nav-inner {
    max-width: var(--hdm-container);
    margin: 0 auto;
    padding: 0 var(--hdm-gutter);
    height: 100%;
    display: flex;
    align-items: center;
    gap: 0;
}

/* Shop All Button */
.hdm-nav-all {
    position: relative;
    height: 100%;
}

.hdm-nav-all-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 100%;
    padding: 0 20px;
    background: rgba(255,255,255,0.1);
    color: var(--hdm-white);
    font-size: 0.9rem;
    font-weight: 600;
    transition: background var(--hdm-transition);
}

.hdm-nav-all-btn:hover {
    background: rgba(255,255,255,0.15);
}

.hdm-nav-all-arrow {
    transition: transform var(--hdm-transition);
}

.hdm-nav-all-btn[aria-expanded="true"] .hdm-nav-all-arrow {
    transform: rotate(180deg);
}

/* Nav List */
.hdm-nav-list {
    display: flex;
    align-items: center;
    height: 100%;
    flex: 1;
}

.hdm-nav-item {
    position: relative;
    height: 100%;
}

.hdm-nav-item > a {
    display: flex;
    align-items: center;
    gap: 5px;
    height: 100%;
    padding: 0 18px;
    color: var(--hdm-white);
    font-size: 0.9rem;
    font-weight: 500;
    transition: background var(--hdm-transition);
}

.hdm-nav-item > a:hover {
    background: rgba(255,255,255,0.1);
}

.hdm-nav-item > a svg {
    opacity: 0.7;
    transition: transform var(--hdm-transition);
}

.hdm-nav-item:hover > a svg {
    transform: rotate(180deg);
}

/* Nav Dropdown */
.hdm-nav-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: var(--hdm-white);
    border: 1px solid var(--hdm-gray-200);
    border-radius: 0 0 var(--hdm-radius) var(--hdm-radius);
    box-shadow: var(--hdm-shadow-lg);
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all var(--hdm-transition);
    z-index: 100;
}

.hdm-nav-item:hover .hdm-nav-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.hdm-nav-dropdown a {
    display: block;
    padding: 10px 20px;
    color: var(--hdm-gray-700);
    font-size: 0.9rem;
    transition: all var(--hdm-transition);
}

.hdm-nav-dropdown a:hover {
    background: var(--hdm-cream);
    color: var(--hdm-primary);
    padding-left: 24px;
}

/* Special Nav Links */
.hdm-nav-special {
    display: flex;
    align-items: center;
    margin-left: auto;
    height: 100%;
}

.hdm-nav-directory,
.hdm-nav-custom,
.hdm-nav-vendor {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 100%;
    padding: 0 16px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background var(--hdm-transition);
}

.hdm-nav-directory {
    color: var(--hdm-accent-light);
}

.hdm-nav-directory:hover {
    background: rgba(255,255,255,0.1);
}

.hdm-nav-custom {
    background: var(--hdm-accent);
    color: var(--hdm-white);
    margin: 6px 4px;
    padding: 0 18px;
    height: calc(100% - 12px);
    border-radius: 6px;
}

.hdm-nav-custom:hover {
    background: var(--hdm-accent-dark);
}

.hdm-nav-vendor {
    color: rgba(255,255,255,0.9);
}

.hdm-nav-vendor:hover {
    background: rgba(255,255,255,0.1);
}

.hdm-nav-badge {
    background: var(--hdm-error);
    color: var(--hdm-white);
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 8px;
    animation: hdm-pulse 2s infinite;
}

/* ==========================================================================
   9. MEGA MENU
   ========================================================================== */

.hdm-mega-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100vw;
    max-width: 900px;
    background: var(--hdm-white);
    border: 1px solid var(--hdm-gray-200);
    border-top: 3px solid var(--hdm-accent);
    border-radius: 0 0 12px 12px;
    box-shadow: var(--hdm-shadow-lg);
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all var(--hdm-transition);
    z-index: 100;
}

.hdm-nav-all:hover .hdm-mega-menu,
.hdm-nav-all-btn[aria-expanded="true"] + .hdm-mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.hdm-mega-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr) 1.2fr;
    gap: 24px;
}

.hdm-mega-col h4 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--hdm-primary);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--hdm-accent);
}

.hdm-mega-col a {
    display: block;
    padding: 8px 0;
    font-size: 0.875rem;
    color: var(--hdm-gray-600);
    transition: all var(--hdm-transition);
}

.hdm-mega-col a:hover {
    color: var(--hdm-accent);
    padding-left: 8px;
}

.hdm-mega-promo {
    display: flex;
    align-items: stretch;
}

.hdm-mega-promo-card {
    flex: 1;
    background: linear-gradient(135deg, var(--hdm-cream) 0%, var(--hdm-cream-dark) 100%);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.hdm-mega-promo-badge {
    display: inline-block;
    background: var(--hdm-accent);
    color: var(--hdm-white);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    margin-bottom: 12px;
    align-self: flex-start;
}

.hdm-mega-promo-card h5 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--hdm-primary);
    margin-bottom: 8px;
}

.hdm-mega-promo-card p {
    font-size: 0.85rem;
    color: var(--hdm-gray-600);
    margin-bottom: 16px;
    flex: 1;
}

.hdm-mega-promo-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--hdm-accent);
    transition: gap var(--hdm-transition);
}

.hdm-mega-promo-btn:hover {
    gap: 10px;
}

/* ==========================================================================
   10. MOBILE MENU
   ========================================================================== */

.hdm-mobile-menu {
    position: fixed;
    inset: 0;
    z-index: 9999;
    visibility: hidden;
    pointer-events: none;
}

.hdm-mobile-menu[aria-hidden="false"] {
    visibility: visible;
    pointer-events: auto;
}

.hdm-mobile-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hdm-mobile-menu[aria-hidden="false"] .hdm-mobile-overlay {
    opacity: 1;
}

.hdm-mobile-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 320px;
    max-width: 85vw;
    height: 100%;
    background: var(--hdm-white);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.hdm-mobile-menu[aria-hidden="false"] .hdm-mobile-panel {
    transform: translateX(0);
}

.hdm-mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--hdm-primary);
}

.hdm-mobile-logo img {
    height: 32px;
    width: auto;
}

.hdm-mobile-close {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--hdm-white);
    border-radius: var(--hdm-radius);
    transition: background var(--hdm-transition);
}

.hdm-mobile-close:hover {
    background: rgba(255,255,255,0.1);
}

.hdm-mobile-search {
    padding: 12px 16px;
    background: var(--hdm-gray-100);
}

.hdm-mobile-search form {
    display: flex;
    background: var(--hdm-white);
    border: 1px solid var(--hdm-gray-200);
    border-radius: 50px;
    overflow: hidden;
}

.hdm-mobile-search input {
    flex: 1;
    padding: 12px 16px;
    border: none;
    font-size: 0.95rem;
    outline: none;
}

.hdm-mobile-search button {
    width: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--hdm-accent);
    color: var(--hdm-white);
}

.hdm-mobile-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--hdm-cream);
    border-bottom: 1px solid var(--hdm-gray-200);
}

.hdm-mobile-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
}

.hdm-mobile-user-info {
    flex: 1;
}

.hdm-mobile-user-name {
    display: block;
    font-weight: 600;
    color: var(--hdm-primary);
}

.hdm-mobile-user-info a {
    font-size: 0.85rem;
    color: var(--hdm-accent);
}

.hdm-mobile-auth {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    background: var(--hdm-cream);
    border-bottom: 1px solid var(--hdm-gray-200);
    font-size: 0.9rem;
}

.hdm-mobile-signin {
    font-weight: 600;
    color: var(--hdm-primary);
}

.hdm-mobile-auth span {
    color: var(--hdm-gray-400);
}

.hdm-mobile-nav {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.hdm-mobile-nav-section {
    padding: 12px 16px 8px;
}

.hdm-mobile-nav-section span {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--hdm-gray-400);
}

.hdm-mobile-nav-item > a,
.hdm-mobile-nav-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 16px;
    font-size: 0.95rem;
    color: var(--hdm-gray-700);
    border-bottom: 1px solid var(--hdm-gray-100);
    transition: all var(--hdm-transition);
    text-align: left;
}

.hdm-mobile-nav-item > a:hover,
.hdm-mobile-nav-toggle:hover {
    background: var(--hdm-cream);
    color: var(--hdm-primary);
}

.hdm-mobile-nav-toggle {
    justify-content: space-between;
}

.hdm-mobile-nav-toggle svg {
    color: var(--hdm-gray-400);
    transition: transform var(--hdm-transition);
}

.hdm-mobile-nav-toggle[aria-expanded="true"] svg {
    transform: rotate(180deg);
}

.hdm-mobile-subnav {
    display: none;
    background: var(--hdm-gray-50);
    padding: 4px 0;
}

.hdm-mobile-nav-item.has-children.open .hdm-mobile-subnav {
    display: block;
}

.hdm-mobile-subnav a {
    display: block;
    padding: 12px 16px 12px 44px;
    font-size: 0.9rem;
    color: var(--hdm-gray-600);
    border-bottom: 1px solid var(--hdm-gray-100);
}

.hdm-mobile-subnav a:hover {
    color: var(--hdm-accent);
    background: var(--hdm-cream);
}

.hdm-mobile-highlight > a {
    background: var(--hdm-accent) !important;
    color: var(--hdm-white) !important;
    border-radius: var(--hdm-radius);
    margin: 8px 16px;
    border: none !important;
}

.hdm-mobile-vendor > a {
    background: var(--hdm-cream);
}

.hdm-mobile-badge {
    background: var(--hdm-error);
    color: var(--hdm-white);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: auto;
}

.hdm-mobile-footer {
    padding: 16px;
    border-top: 1px solid var(--hdm-gray-200);
    background: var(--hdm-gray-50);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.hdm-mobile-logout {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--hdm-gray-500);
}

.hdm-mobile-logout:hover {
    color: var(--hdm-error);
}

.hdm-mobile-currency {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--hdm-gray-500);
}

/* ==========================================================================
   11. ANIMATIONS
   ========================================================================== */

@keyframes hdm-fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes hdm-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

@keyframes hdm-slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   12. RESPONSIVE
   ========================================================================== */

/* Tablet & Below */
@media (max-width: 1200px) {
    .hdm-nav-item > a {
        padding: 0 14px;
        font-size: 0.85rem;
    }
    
    .hdm-nav-special {
        gap: 0;
    }
    
    .hdm-action-label {
        display: none;
    }
    
    .hdm-action-help {
        display: none;
    }
}

@media (max-width: 1024px) {
    /* Hide desktop nav, show mobile toggle */
    .hdm-nav {
        display: none;
    }
    
    .hdm-mobile-toggle {
        display: flex;
    }
    
    /* Adjust header */
    .hdm-header-main {
        gap: 12px;
    }
    
    /* Expand search */
    .hdm-search {
        max-width: none;
    }
    
    .hdm-search-cat-btn {
        display: none;
    }
    
    /* Simplify cart */
    .hdm-cart-info {
        display: none;
    }
    
    .hdm-action-cart {
        padding: 8px 12px;
    }
    
    /* Hide wishlist */
    .hdm-action-wishlist {
        display: none;
    }
    
    /* Simplify account */
    .hdm-account-info {
        display: none;
    }
    
    .hdm-account-arrow {
        display: none;
    }
}

@media (max-width: 768px) {
    :root {
        --hdm-header-height: 60px;
        --hdm-announce-height: 36px;
    }
    
    .hdm-header-main {
        gap: 10px;
    }
    
    .hdm-logo-img {
        height: 36px;
        max-width: 120px;
    }
    
    .hdm-search-input {
        height: 42px;
        font-size: 0.9rem;
    }
    
    .hdm-search-btn {
        width: 44px;
    }
    
    .hdm-action-cart {
        padding: 6px 10px;
        border-radius: var(--hdm-radius);
    }
    
    .hdm-announce-controls {
        display: none;
    }
    
    .hdm-announce-slide {
        font-size: 0.8rem;
    }
    
    .hdm-announce-cta {
        display: none;
    }
}

@media (max-width: 480px) {
    :root {
        --hdm-header-height: 56px;
        --hdm-gutter: 12px;
    }
    
    .hdm-logo-img {
        height: 30px;
        max-width: 100px;
    }
    
    .hdm-search {
        min-width: 0;
    }
    
    .hdm-search-input {
        height: 38px;
        padding: 0 12px;
        font-size: 0.85rem;
    }
    
    .hdm-search-input::placeholder {
        font-size: 0.8rem;
    }
    
    .hdm-search-btn {
        width: 40px;
    }
    
    .hdm-mobile-toggle {
        width: 40px;
        height: 40px;
    }
    
    .hdm-action-account {
        display: none;
    }
    
    .hdm-cart-badge {
        min-width: 16px;
        height: 16px;
        font-size: 0.65rem;
    }
    
    .hdm-announce-slide {
        font-size: 0.75rem;
    }
}

/* ==========================================================================
   STICKY HEADER (Optional)
   ========================================================================== */

.hdm-header.sticky {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    animation: hdm-slideDown 0.3s ease;
}

.hdm-header.sticky + .hdm-nav {
    margin-top: var(--hdm-header-height);
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */

@media print {
    .hdm-header-wrapper {
        display: none;
    }
}

/* ==========================================================================
   CRITICAL OVERRIDES - Force constraints over theme conflicts
   ========================================================================== */

/* LOGO - Force size constraints with !important */
.hdm-header-wrapper .hdm-logo {
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    max-width: 180px !important;
    height: var(--hdm-header-height) !important;
    padding: 10px 0 !important;
}

.hdm-header-wrapper .hdm-logo-img,
.hdm-logo-img,
.hdm-logo img {
    height: 44px !important;
    max-height: 44px !important;
    width: auto !important;
    max-width: 160px !important;
    object-fit: contain !important;
    display: block !important;
}

/* HEADER STRUCTURE - Ensure proper layout */
.hdm-header-wrapper {
    position: relative !important;
    z-index: 9999 !important;
    font-family: var(--hdm-font) !important;
}

.hdm-header {
    background: var(--hdm-white) !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05) !important;
    position: relative !important;
    z-index: 100 !important;
}

.hdm-header-main {
    display: flex !important;
    align-items: center !important;
    gap: 24px !important;
    height: var(--hdm-header-height) !important;
    max-height: 70px !important;
}

/* SEARCH - Ensure visibility and proper sizing */
.hdm-header-wrapper .hdm-search {
    flex: 1 1 auto !important;
    min-width: 200px !important;
    max-width: 680px !important;
    display: flex !important;
    position: relative !important;
}

.hdm-header-wrapper .hdm-search-box {
    display: flex !important;
    align-items: stretch !important;
    width: 100% !important;
    background: var(--hdm-gray-100) !important;
    border: 2px solid var(--hdm-gray-200) !important;
    border-radius: 50px !important;
    overflow: hidden !important;
    height: 48px !important;
}

.hdm-header-wrapper .hdm-search-input {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    padding: 12px 16px !important;
    border: none !important;
    background: transparent !important;
    font-size: 0.9375rem !important;
    outline: none !important;
    height: 100% !important;
}

.hdm-header-wrapper .hdm-search-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 52px !important;
    flex-shrink: 0 !important;
    background: var(--hdm-accent) !important;
    color: var(--hdm-white) !important;
    border: none !important;
    cursor: pointer !important;
}

/* HIDE FLATSOME HEADER - Multiple selectors for thoroughness */
body.hdm-premium-header-active .header-wrapper,
body.hdm-premium-header-active #masthead,
body.hdm-premium-header-active .header-main,
body.hdm-premium-header-active .header-top,
body.hdm-premium-header-active .header-bottom,
body.hdm-premium-header-active .top-divider,
body.hdm-premium-header-active .flatsome-header,
body.hdm-header-v4 .header-wrapper,
body.hdm-header-v4 #masthead,
body.hdm-header-v4 .header-main,
body.hdm-header-v4 .header-top,
body.hdm-header-v4 .header-bottom,
body.hdm-header-v4 .top-divider,
body.hdm-header-v4 .flatsome-header {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
    position: absolute !important;
    left: -9999px !important;
}

/* RESPONSIVE LOGO SIZES */
@media (max-width: 1024px) {
    .hdm-header-wrapper .hdm-logo-img,
    .hdm-logo-img,
    .hdm-logo img {
        height: 38px !important;
        max-height: 38px !important;
        max-width: 140px !important;
    }
    
    .hdm-header-main {
        gap: 16px !important;
    }
    
    .hdm-header-wrapper .hdm-search {
        max-width: 450px !important;
    }
}

@media (max-width: 768px) {
    .hdm-header-wrapper .hdm-logo-img,
    .hdm-logo-img,
    .hdm-logo img {
        height: 32px !important;
        max-height: 32px !important;
        max-width: 120px !important;
    }
    
    .hdm-header-main {
        height: 60px !important;
        gap: 12px !important;
    }
    
    .hdm-header-wrapper .hdm-search {
        display: none !important;
    }
    
    .hdm-mobile-toggle {
        display: flex !important;
    }
}
