/* ============================================================================
   PETRHLAVAC CHILD THEME - HEADER STYLES
   Target both classic and builder-based Divi headers
   ============================================================================ */

/* ============================================================================
   0. DIVI BUILDER HEADER (.et-l.et-l--header) - MAIN FIX
   ============================================================================ */

/* Ensure builder header is visible and has proper height */
.et-l.et-l--header {
    display: block !important;
    visibility: visible !important;
    min-height: auto !important;
    padding: 12px 0 !important;
}

/* FIX: Show ALL sections inside header */
header.et-l.et-l--header .et_pb_section {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    min-height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* FIX: Specific rule for section 0 (often hidden in builder headers) */
header.et-l.et-l--header .et_pb_section_0_tb_header {
    display: block !important;
    visibility: visible !important !important;
    opacity: 1 !important;
}

/* FIX: Fix the inner content height */
header.et-l.et-l--header .et_builder_inner_content {
    height: auto !important;
    min-height: auto !important;
    display: block !important;
}

/* Ensure all rows and columns inside header are visible */
.et-l.et-l--header .et_pb_section {
    padding: 0 !important;
    min-height: auto !important;
    margin: 0 !important;
    background-color: #ffffff !important;
    background-image: none !important;
}

.et-l.et-l--header .et_pb_row {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    min-height: auto !important;
    margin: 0 !important;
    padding: 0 20px !important;
    overflow: visible !important;
    width: 100% !important;
    background-color: #ffffff !important;
    background-image: none !important;
}

/* Specific rule for menu row */
.et-l.et-l--header .et_pb_row_1_tb_header {
    width: 100% !important;
    display: flex !important;
    flex-wrap: wrap !important;
}

.et-l.et-l--header .et_pb_column {
    display: flex !important;
    align-items: center !important;
    min-height: auto !important;
    padding: 0 !important;
    overflow: visible !important;
    width: auto !important;
    flex: 1 1 auto !important;
}

/* Logo column - fixed width */
.et-l.et-l--header .et_pb_column:first-child {
    flex: 0 0 auto !important;
}

/* Menu column - takes remaining space */
.et-l.et-l--header .et_pb_column:last-child {
    flex: 1 1 auto !important;
    justify-content: flex-end !important;
}

/* Builder menu module - make it visible and sized */
.et-l.et-l--header .et_pb_menu {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: auto !important;
    min-width: 400px !important;
    height: auto !important;
    min-height: auto !important;
    flex: 0 1 auto !important;
    justify-content: flex-end !important;
}

.et-l.et-l--header .et_pb_menu__wrap {
    display: flex !important;
    visibility: visible !important;
    width: 100% !important;
    height: auto !important;
    flex: 1 1 auto !important;
    justify-content: flex-end !important;
}

.et-l.et-l--header .et_pb_menu__menu {
    display: flex !important;
    flex-direction: row !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: auto !important;
    height: auto !important;
    flex: 0 1 auto !important;
    justify-content: flex-end !important;
}

/* Target the actual UL inside the menu wrapper */
.et-l.et-l--header ul.et-menu,
.et-l.et-l--header .et_pb_menu__menu ul {
    display: flex !important;
    flex-direction: row !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    gap: 0 !important;
    width: auto !important;
    height: auto !important;
    justify-content: flex-end !important;
    align-items: center !important;
}

.et-l.et-l--header ul.et-menu > li,
.et-l.et-l--header .et_pb_menu__menu ul > li {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 14px !important;
    height: auto !important;
    width: auto !important;
    min-height: auto !important;
}

.et-l.et-l--header ul.et-menu > li > a,
.et-l.et-l--header .et_pb_menu__menu ul > li > a {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    color: #333333 !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    padding: 8px 0 !important;
    border-bottom: 2px solid transparent !important;
    transition: color 0.2s ease, border-color 0.2s ease !important;
    white-space: nowrap !important;
}

.et-l.et-l--header ul.et-menu > li > a:hover,
.et-l.et-l--header ul.et-menu > li > a:focus,
.et-l.et-l--header .et_pb_menu__menu ul > li > a:hover,
.et-l.et-l--header .et_pb_menu__menu ul > li > a:focus {
    color: #17A2B8 !important;
    border-bottom-color: #17A2B8 !important;
}

/* Logo in builder header */
.et-l.et-l--header .et_pb_image img {
    max-height: 50px !important;
    width: auto !important;
    height: auto !important;
}

/* ============================================================================
   1. CLASSIC DIVI HEADER (#main-header) - FALLBACK
   ============================================================================ */

@media (min-width: 1024px) {
    #main-header {
        background-color: #ffffff !important;
        border-bottom: 1px solid #e8e8e8 !important;
        padding: 12px 0 !important;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04) !important;
        position: sticky;
        top: 0;
        z-index: 999;
        transition: box-shadow 0.3s ease;
        min-height: auto !important;
    }

    #logo {
        max-height: 50px !important;
        width: auto !important;
        height: auto !important;
    }

    .logo_container {
        height: auto !important;
        padding: 0 !important;
    }

    /* Classic navigation elements */
    #et-top-navigation {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        align-items: center !important;
        justify-content: flex-end !important;
    }

    #top-menu-nav {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        justify-content: flex-end !important;
    }

    #top-menu-nav ul {
        display: flex !important;
        flex-direction: row !important;
        gap: 28px !important;
        align-items: center !important;
        list-style: none !important;
        margin: 0 !important;
        padding: 0 !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    #top-menu-nav li {
        list-style: none !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    #top-menu-nav a {
        display: inline-block !important;
        text-decoration: none !important;
        color: #333333 !important;
        font-size: 14px !important;
        font-weight: 500 !important;
        padding: 8px 0 !important;
        border-bottom: 2px solid transparent !important;
        transition: color 0.2s ease, border-color 0.2s ease !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    #top-menu-nav a:hover,
    #top-menu-nav a:focus {
        color: #17A2B8 !important;
        border-bottom-color: #17A2B8 !important;
    }

    #top-menu-nav a:active {
        color: #0d6b7a !important;
    }
}

/* ============================================================================
   2. TABLET (769px - 1023px)
   ============================================================================ */

@media (min-width: 769px) and (max-width: 1023px) {
    .et-l.et-l--header {
        padding: 10px 0 !important;
    }

    #main-header {
        padding: 10px 0 !important;
        border-bottom: 1px solid #e8e8e8 !important;
    }

    #logo {
        max-height: 45px !important;
    }

    .et-l.et-l--header .et_pb_image img {
        max-height: 45px !important;
    }

    #top-menu-nav ul {
        gap: 18px !important;
    }

    .et-l.et-l--header ul.et-menu > li,
    .et-l.et-l--header .et_pb_menu__menu ul > li {
        padding: 0 9px !important;
    }

    #top-menu-nav a {
        font-size: 13px !important;
    }

    .et-l.et-l--header .et_pb_menu__menu li a {
        font-size: 13px !important;
    }
}

/* ============================================================================
   3. MOBILE (max 768px)
   ============================================================================ */

@media (max-width: 768px) {
    .et-l.et-l--header {
        padding: 8px 0 !important;
    }

    #main-header {
        padding: 8px 0 !important;
        border-bottom: 1px solid #e8e8e8 !important;
    }

    #logo {
        max-height: 40px !important;
    }

    .et-l.et-l--header .et_pb_image img {
        max-height: 40px !important;
    }

    .logo_container {
        height: auto !important;
        padding: 0 !important;
    }

    /* Mobile: hide builder menu, show classic */
    .et-l.et-l--header .et_pb_menu {
        display: none !important;
    }

    #et-top-navigation {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .et_mobile_nav_menu {
        display: flex !important;
    }

    .mobile_menu_bar {
        display: block !important;
    }

    .mobile_nav {
        display: block !important;
    }

    .et_mobile_menu a {
        display: block !important;
        padding: 12px 15px !important;
        color: #333333 !important;
        text-decoration: none !important;
    }

    .et_mobile_menu a:hover {
        color: #17A2B8 !important;
    }
}

/* ============================================================================
   4. SMALL MOBILE (max 480px)
   ============================================================================ */

@media (max-width: 480px) {
    .et-l.et-l--header {
        padding: 6px 0 !important;
    }

    #main-header {
        padding: 6px 0 !important;
    }

    #logo {
        max-height: 35px !important;
    }

    .et-l.et-l--header .et_pb_image img {
        max-height: 35px !important;
    }

    #top-menu-nav ul {
        gap: 10px !important;
    }

    .et-l.et-l--header ul.et-menu > li,
    .et-l.et-l--header .et_pb_menu__menu ul > li {
        padding: 0 5px !important;
    }
}

/* ============================================================================
   5. GLOBAL HEADER STYLES
   ============================================================================ */

#main-header,
.et-l.et-l--header {
    background-color: #ffffff;
    color: #333333;
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    position: sticky;
    top: 0;
    z-index: 999;
    will-change: box-shadow;
}

#main-header a,
.et-l.et-l--header a {
    color: inherit;
}

/* ============================================================================
   6. ACCESSIBILITY
   ============================================================================ */

#main-header a:focus,
.et-l.et-l--header a:focus {
    outline: 2px solid #17A2B8;
    outline-offset: 2px;
}

/* ============================================================================
   7. PRINT STYLES
   ============================================================================ */

@media print {
    #main-header,
    .et-l.et-l--header {
        position: static;
        border-bottom: 2px solid #333;
        box-shadow: none;
    }

    .mobile_menu_bar {
        display: none !important;
    }
}
