/**
 * Webup Header - Layout 5 (Skousen-style)
 *
 * @package Webup_Header
 */

/* ==========================================================================
   Layout 5: Override base header structure
   ========================================================================== */

.webup-header--layout-5 {
    padding: 0;
}

/* Remove default inner padding/flex from layout-5 — rows handle their own layout */
.webup-header--layout-5 .webup-header__inner--layout-5 {
    display: block;
    padding: 0;
    max-width: none;
    min-height: 0;
}

/* ==========================================================================
   Row 1: Top bar (Logo + Search + Icons)
   ========================================================================== */

.webup-l5__top {
    background-color: var(--webup-header-bg);
}

.webup-l5__top-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    max-width: var(--webup-header-max-width);
    margin: 0 auto;
    min-height: var(--webup-header-height, 80px);
    padding: var(--webup-header-padding-y, 14px) var(--webup-header-padding-x, 30px);
    box-sizing: border-box;
}

/* Logo */
.webup-l5__logo {
    flex-shrink: 0;
}

/* Search bar — fills remaining space */
.webup-l5__search {
    flex: 1;
    min-width: 0;
}

.webup-l5__search-form {
    width: 100%;
}

.webup-l5__search-container {
    position: relative;
    display: flex;
    align-items: center;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: visible;
}

.webup-l5__search-icon {
    display: none;
}

.webup-l5__search-input,
.webup-l5__search-container input[type="text"],
.webup-l5__search-container input[type="search"] {
    flex: 1;
    border: none !important;
    border-radius: 0 !important;
    background: transparent;
    padding: 10px 14px;
    font-size: 14px;
    color: #333;
    outline: none;
    width: auto;
    min-width: 0;
    transition: none;
    box-shadow: none;
}

.webup-l5__search-input::placeholder {
    color: #aaa;
}

.webup-l5__search-btn {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 100%;
    padding: 0;
    background: transparent;
    color: #666;
    border: none;
    border-left: 1px solid #ddd;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    transition: color 0.2s;
}

.webup-l5__search-btn:hover {
    color: var(--webup-header-link-hover, #0073aa);
}

/* Webup Search results dropdown */
.webup-l5__search-container .webup-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 9999;
    background: #fff;
    border: 1px solid #ddd;
    border-top: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    border-radius: 0 0 4px 4px;
}

/* Right section: phone + icons */
.webup-l5__right {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.webup-l5__phone {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--webup-phone-color, #333);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    transition: opacity 0.2s;
}

.webup-l5__phone:hover {
    opacity: 0.75;
}

.webup-l5__phone svg {
    color: var(--webup-phone-icon-color, #333);
}

/* ==========================================================================
   Row 2: Navigation bar
   ========================================================================== */

.webup-l5__nav-bar {
    background-color: var(--webup-l5-nav-bg, #1a1a1a);
}

.webup-l5__nav-inner {
    display: flex;
    align-items: center;
    max-width: var(--webup-header-max-width);
    margin: 0 auto;
    padding: 0 var(--webup-header-padding-x, 30px);
    box-sizing: border-box;
}

/* Menu items in nav bar */
.webup-l5__nav .webup-header__menu {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0;
}

.webup-l5__nav .webup-header__menu > li > a {
    display: block;
    padding: 14px 16px;
    color: var(--webup-l5-nav-color, #ffffff);
    text-decoration: none;
    font-size: var(--webup-menu-font-size, 15px);
    font-weight: var(--webup-menu-font-weight, 500);
    font-family: var(--webup-menu-font-family, inherit);
    transition: background-color 0.2s, color 0.2s;
    white-space: nowrap;
}

.webup-l5__nav .webup-header__menu > li > a:hover,
.webup-l5__nav .webup-header__menu > li.current-menu-item > a,
.webup-l5__nav .webup-header__menu > li.current-menu-ancestor > a {
    background-color: rgba(255,255,255,0.12);
    color: var(--webup-l5-nav-color, #ffffff);
}

/* Dropdown arrow */
.webup-l5__nav .webup-header__menu > li.menu-item-has-children > a::after {
    content: '';
    display: inline-block;
    margin-left: 5px;
    border: 4px solid transparent;
    border-top-color: currentColor;
    vertical-align: middle;
    position: relative;
    top: 1px;
}

/* CTA button (Tilbud) on right of nav bar */
.webup-l5__nav-cta {
    margin-left: auto;
    display: inline-block;
    padding: 8px 18px;
    background: var(--webup-cta-bg-color, #f5c500);
    color: var(--webup-cta-text-color, #111);
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    border-radius: 2px;
    white-space: nowrap;
    transition: opacity 0.2s;
    flex-shrink: 0;
}

.webup-l5__nav-cta:hover {
    opacity: 0.88;
}

/* Mega menu / dropdowns inherit standard styles but position off nav bar */
.webup-l5__nav .webup-header__menu > li {
    position: relative;
}

/* ==========================================================================
   Message Bar (global — all layouts)
   ========================================================================== */

.webup-header-msgbar {
    background-color: var(--webup-msgbar-bg, #f5f0e8);
    color: var(--webup-msgbar-color, #333333);
    text-align: center;
    font-size: 14px;
    padding: 8px 30px;
    line-height: 1.4;
}

.webup-header-msgbar a {
    color: inherit;
    text-decoration: underline;
}

.webup-header-msgbar a:hover {
    opacity: 0.75;
}

/* ==========================================================================
   Mobile: hide nav bar, show hamburger as in other layouts
   ========================================================================== */

.webup-header--layout-5.mobile-mode .webup-l5__nav-bar {
    display: none;
}

.webup-header--layout-5.mobile-mode .webup-header__hamburger {
    display: flex;
}

.webup-header--layout-5:not(.mobile-mode) .webup-header__hamburger {
    display: none;
}

/* Mobile: stack search below logo+icons */
@media (max-width: 768px) {
    .webup-l5__top-inner {
        flex-wrap: wrap;
        gap: 10px;
    }

    .webup-l5__logo {
        order: 1;
    }

    .webup-l5__right {
        order: 2;
        margin-left: auto;
    }

    .webup-l5__search {
        order: 3;
        width: 100%;
        flex-basis: 100%;
    }

    .webup-l5__phone {
        display: none;
    }
}
