/* ═══════════════════════════════════════════════════
   FE Maughan - Header CSS
   Fișier: /css/header.css
════════════════════════════════════════════════════ */

:root {
    --fem-navy:       #1e3a5f;
    --fem-navy-dark:  #152d4a;
    --fem-blue:       #4a90c4;
    --fem-blue-light: #d0e8f7;
    --fem-white:      #ffffff;
    --fem-gray-100:   #f3f4f6;
    --fem-gray-200:   #e5e7eb;
    --fem-gray-400:   #9ca3af;
    --fem-gray-600:   #6b7280;
    --fem-gray-800:   #374151;
    --fem-container:  1280px;
    --fem-header-h:   72px;
    --fem-nav-h:      48px;
}

/* --- Hide Divi default header elements only --- */
#main-header,
#et-top-navigation,
#et_mobile_nav_menu,
#top-header {
    display: none !important;
}

/* --- Container --- */
.femaughan-container {
    max-width: var(--fem-container);
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
    box-sizing: border-box;
}

/* ══════════════════════════════════════════
   TOP BAR
══════════════════════════════════════════ */
.femaughan-top-bar {
    background: #fff;
    border-bottom: 1px solid var(--fem-gray-200);
    font-size: 13px;
    color: var(--fem-gray-800);
}

.femaughan-top-bar .femaughan-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 36px;
}

.top-bar-left {
    display: flex;
    gap: 20px;
    align-items: center;
}

.top-bar-phone {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--fem-navy);
    font-weight: 500;
    text-decoration: none;
    transition: color 0.15s;
}

.top-bar-phone img {
    max-height: 14px;
    width: auto;
}

.top-bar-phone:hover {
    color: var(--fem-blue);
}

.top-bar-right {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 13px;
}

.top-bar-right a {
    color: var(--fem-navy);
    font-weight: 500;
    text-decoration: none;
}

.top-bar-right a:hover {
    text-decoration: underline;
}

.top-bar-right .divider {
    color: var(--fem-gray-400);
}

/* ══════════════════════════════════════════
   MAIN HEADER
══════════════════════════════════════════ */
.femaughan-main-header {
    background: #fff;
    border-bottom: 1px solid var(--fem-gray-200);
    position: sticky;
    top: 0;
    z-index: 500;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.femaughan-main-header .femaughan-container {
    display: flex;
    align-items: center;
    gap: 24px;
    min-height: var(--fem-header-h);
}

/* --- Logo --- */
.femaughan-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
}

.femaughan-logo img {
    max-height: 50px;
    width: auto;
}

.femaughan-logo-img {
    max-height: 54px;
    width: auto;
    display: block;
}

.femaughan-logo .custom-logo-link img {
    max-height: 54px;
    width: auto;
    display: block;
}

.femaughan-logo-text {
    font-size: 22px;
    font-weight: 700;
    color: var(--fem-navy);
    letter-spacing: -0.5px;
}

/* --- Search bar (FiboSearch) --- */
.femaughan-search {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    justify-content: flex-end;
}

/* Fallback search form */
.femaughan-search .search-form,
.femaughan-search form[role="search"] {
    display: flex;
    width: 100%;
    border: 1.5px solid var(--fem-gray-200);
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.femaughan-search .search-form:focus-within {
    border-color: var(--fem-blue);
}

.femaughan-search input[type="search"],
.femaughan-search input[type="text"] {
    flex: 1;
    min-width: 0;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    padding: 10px 16px;
    font-size: 14px;
    color: var(--fem-gray-800);
    background: #fff;
}

.femaughan-search button[type="submit"],
.femaughan-search input[type="submit"] {
    background: var(--fem-navy) !important;
    border: none !important;
    color: #fff !important;
    padding: 0 18px !important;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.15s;
    border-radius: 0 !important;
    flex-shrink: 0;
}

.femaughan-search button[type="submit"]:hover {
    background: var(--fem-navy-dark) !important;
}

/* FiboSearch widget styles */
.femaughan-search .dgwt-wcas-search-wrapp,
.femaughan-search .dgwt-wcas-search-form {
    width: 100% !important;
    max-width: 100%;
}

.femaughan-search .dgwt-wcas-sf-wrapp {
    width: 100%;
}

.femaughan-search .dgwt-wcas-sf-wrapp input[type="search"] {
    width: 100%;
    min-width: 0;
    height: 42px !important;
    border: 1.5px solid var(--fem-gray-200) !important;
    border-radius: 8px 0 0 8px !important;
    padding: 0 16px !important;
    font-size: 14px !important;
    box-shadow: none !important;
    outline: none !important;
}

.femaughan-search .dgwt-wcas-sf-wrapp input[type="search"]:focus {
    border-color: var(--fem-blue) !important;
}

.femaughan-search .dgwt-wcas-search-submit {
    background: var(--fem-navy) !important;
    border: none !important;
    border-radius: 0 8px 8px 0 !important;
    height: 42px !important;
    padding: 0 18px !important;
    cursor: pointer;
    transition: background 0.15s;
    flex-shrink: 0;
}

.femaughan-search .dgwt-wcas-search-submit:hover {
    background: var(--fem-navy-dark) !important;
}

.femaughan-search .dgwt-wcas-search-submit svg,
.femaughan-search .dgwt-wcas-search-submit i {
    color: #fff !important;
    fill: #fff !important;
}

.aws-container,
.aws-container .aws-search-form {
    width: 100% !important;
    max-width: 320px;
}

.aws-container .aws-search-form .aws-form-btn {
    background: var(--fem-navy);
}

.aws-container .aws-search-form .aws-search-btn_icon {
    color: #fff;
}

/* --- Header icons --- */
.femaughan-header-icons {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-shrink: 0;
}

.femaughan-icon-btn {
    position: relative;
    color: var(--fem-navy);
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: color 0.15s;
}

.femaughan-icon-btn:hover {
    color: var(--fem-blue);
}

.femaughan-cart-badge {
    background: var(--fem-navy);
    color: #fff;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: -7px;
    right: -8px;
    transition: background 0.15s;
    pointer-events: none;
}

.femaughan-cart-btn:hover .femaughan-cart-badge {
    background: var(--fem-blue);
}

/* Mobile toggle (hidden on desktop) */
.femaughan-mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    flex-shrink: 0;
}

.femaughan-mobile-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--fem-navy);
    border-radius: 2px;
    transition: transform 0.25s, opacity 0.25s;
}

/* ══════════════════════════════════════════
   NAVIGATION BAR
══════════════════════════════════════════ */
.femaughan-nav-bar {
    background: var(--fem-navy);
    position: sticky;
    top: var(--fem-header-h);
    z-index: 499;
}

.femaughan-nav-bar .femaughan-container {
    display: flex;
    align-items: stretch;
    position: relative;
}

.femaughan-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: stretch;
    flex-wrap: wrap;
}

.femaughan-nav-item {
    position: static; /* mega menu full-width față de nav-bar */
    display: flex;
    align-items: stretch;
}

.femaughan-nav-link {
    display: flex;
    align-items: center;
    padding: 0 16px;
    height: var(--fem-nav-h);
    color: #e2e8f0;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
    gap: 5px;
}

.femaughan-nav-link:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
}

.femaughan-nav-item.active > .femaughan-nav-link,
.femaughan-nav-item.current-menu-item > .femaughan-nav-link,
.femaughan-nav-item.current-menu-ancestor > .femaughan-nav-link,
.femaughan-nav-item.mega-open > .femaughan-nav-link {
    background: var(--fem-blue);
    color: #fff;
}

.femaughan-nav-link .arrow {
    font-size: 9px;
    opacity: 0.7;
}

/* ══════════════════════════════════════════
   MEGA MENU
══════════════════════════════════════════ */
.femaughan-mega-menu {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: #fff;
    border-top: 3px solid var(--fem-blue);
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    z-index: 600;
}

.mega-menu-inner {
    max-width: var(--fem-container);
    margin: 0 auto;
    padding: 28px 24px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 6px 40px;
}

.mega-link {
    display: block;
    color: var(--fem-gray-800);
    font-size: 14px;
    text-decoration: none;
    padding: 5px 0;
    border-bottom: 1px solid transparent;
    transition: color 0.12s, border-color 0.12s;
    line-height: 1.4;
}

.mega-link:hover {
    color: var(--fem-navy);
    border-bottom-color: var(--fem-blue);
}

/* Invisible bridge between nav link and mega menu */
.femaughan-nav-item.has-mega::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 8px;
    background: transparent;
    display: none;
}

.femaughan-nav-item.has-mega.mega-open::after {
    display: block;
}

/* --- Overlay --- */
.femaughan-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    z-index: 10000;
}

.femaughan-overlay.active {
    display: block;
}

/* Desktop: overlay disabled for mega menu */
@media (min-width: 769px) {
    .femaughan-overlay,
    .femaughan-overlay.active {
        display: none !important;
        pointer-events: none !important;
    }
}

/* ===========================================
   RESPONSIVE — TABLET
=========================================== */
@media (max-width: 1024px) {
    .femaughan-main-header .femaughan-container {
        gap: 16px;
    }

    .femaughan-nav-link {
        padding: 0 12px;
        font-size: 13px;
    }

    .mega-menu-inner {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===========================================
   RESPONSIVE — MOBILE
=========================================== */
@media (max-width: 768px) {

    .femaughan-container {
        padding: 0 16px;
    }

    .top-bar-left {
        gap: 12px;
    }

    .top-bar-phone span:last-child {
        display: none;
    }

    .femaughan-main-header .femaughan-container {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 10px;
        min-height: var(--fem-header-h);
        padding-top: 10px;
        padding-bottom: 10px;
    }

    .femaughan-logo {
        order: 1;
        flex: 0 1 auto;
        min-width: 0;
    }

    .femaughan-logo img,
    .femaughan-logo-img,
    .femaughan-logo .custom-logo-link img {
        max-height: 42px;
    }

    .femaughan-logo-text,
    .logo-name {
        font-size: 18px;
    }

    .femaughan-header-icons {
        order: 2;
        gap: 12px;
        margin-left: auto;
    }

    .femaughan-mobile-toggle {
        display: flex;
        order: 3;
    }

    .femaughan-search {
        order: 4;
        flex: 0 0 100%;
        width: 100%;
        display: block;
        margin-top: 4px;
    }

    .femaughan-search .search-form,
    .femaughan-search form[role="search"],
    .femaughan-search .dgwt-wcas-search-wrapp,
    .femaughan-search .dgwt-wcas-search-form,
    .femaughan-search .aws-container,
    .femaughan-search .aws-search-form {
        width: 100% !important;
        max-width: 100%;
    }

    .femaughan-search input[type="search"],
    .femaughan-search input[type="text"],
    .femaughan-search .dgwt-wcas-sf-wrapp input[type="search"] {
        width: 100%;
        min-width: 0;
        font-size: 16px !important;
    }

    /* Mobile nav drawer */
    .femaughan-nav-bar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 85%;
        max-width: 340px;
        height: 100vh;
        overflow-y: auto;
        flex-direction: column;
        transition: left 0.3s ease;
        z-index: 10001;
    }

    .femaughan-nav-bar.open {
        left: 0;
    }

    .femaughan-nav-bar .femaughan-container {
        flex-direction: column;
        align-items: stretch;
        padding: 60px 0 24px;
        position: static;
    }

    .femaughan-nav-list {
        flex-direction: column;
        flex-wrap: nowrap;
    }

    .femaughan-nav-item {
        flex-direction: column;
    }

    .femaughan-nav-link {
        height: auto;
        padding: 14px 20px;
        border-bottom: 1px solid rgba(255,255,255,0.08);
    }

    /* Mega menu devine accordion pe mobile */
    .femaughan-mega-menu {
        position: static;
        display: none;
        left: auto;
        right: auto;
        top: auto;
        box-shadow: none;
        border-top: none;
        border-left: 3px solid var(--fem-blue);
        margin-left: 20px;
    }

    .femaughan-mega-menu.open {
        display: block;
    }

    .mega-menu-inner {
        grid-template-columns: 1fr;
        padding: 8px 16px;
        gap: 2px;
    }

    .mega-link {
        padding: 8px 0;
    }

    .femaughan-nav-item.has-mega::after {
        display: none !important;
    }

    /* Toggle animat */
    .femaughan-mobile-toggle.open span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .femaughan-mobile-toggle.open span:nth-child(2) {
        opacity: 0;
    }

    .femaughan-mobile-toggle.open span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }
}