/* ========================================
   TABLET MENU STYLES (769px - 1299px)
   Custom menu structure for tablet view
   ======================================== */

/* New Main Menu Bar for Tablet */
.koc-tablet-main-menu {
    display: none;
    background-color: #000;
    margin: 15px 20px;
    padding: 0 20px;
    border-radius: 16px;
    height: 85px;
    transition: all 0.3s ease;
}

/* Sticky state */
.koc-tablet-main-menu.is-sticky {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    margin-top: 0;
    z-index: 9998;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Placeholder to prevent content jump when menu becomes sticky */
.koc-tablet-menu-placeholder {
    display: none;
    height: 115px; /* 85px menu height + 30px margin */
}

.koc-tablet-menu-placeholder.active {
    display: block;
}

/* IMPORTANT: In tablet view, menu items are simple text links (not buttons)
   Only "Időpontfoglalás" remains as a button */

.koc-tablet-main-menu-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    height: 100%;
}

/* Navigation links (not buttons) */
.koc-tablet-menu-nav {
    display: flex;
    gap: 30px;
    align-items: center;
    margin-left: auto;
    margin-right: 20px;
}

.tablet-menu-link {
    color: #fff;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color 0.3s ease;
    padding: 5px 0;
    border-bottom: 2px solid transparent;
    position: relative;
}

.tablet-menu-link::after {
    content: '';
    display: block;
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 2px;
    background: #208cb1;
    transform: scale(0, 1);
    transform-origin: right;
    transition: transform 0.3s cubic-bezier(0.9, 0.05, 0.1, 1);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.tablet-menu-link:hover,
.tablet-menu-link:focus {
    color: #208cb1;
}

.tablet-menu-link:hover::after,
.tablet-menu-link:focus::after,
.tablet-menu-link.active::after {
    transform: scale(1, 1);
    transform-origin: left;
}

/* Active state for current page */
.tablet-menu-link.active {
    color: #208cb1;
}

/* Actions section (button + icons) */
.koc-tablet-menu-actions {
    display: flex;
    gap: 15px;
    height: 32px;
    align-items: flex-start;
    margin-top: -7px;
}

/* Keep Időpontfoglalás as a button */
.koc-tablet-menu-actions .cz_btn {
    padding: 6px 24px;
    font-size: 16px;
    white-space: nowrap;
    color: #fff;
    background-color: #208cb1;
    border: 2px solid #208cb1;
    transition: all 0.3s ease;
}

.koc-tablet-menu-actions .cz_btn:hover {
    color: #208cb1;
    background-color: #000;
    border-color: #208cb1;
}

.koc-tablet-menu-actions .cz_btn:hover span {
    opacity: 1;
}

.koc-tablet-menu-actions .cz_btn:hover span {
    opacity: 1;
}

/* Search Icon Button */
.koc-tablet-search-icon {
    background: transparent;
    border: none;
    font-size: 20px;
    color: #208cb1;
    cursor: pointer;
    padding: 8px;
    transition: color 0.3s ease;
    pointer-events: auto;
    z-index: 10;
}

.koc-tablet-search-icon:hover {
    color: #1a6d8f;
}

.koc-tablet-search-icon i {
    pointer-events: none;
}

/* Tablet Hamburger Button */
.koc-tablet-hamburger {
    display: flex;
    background: transparent;
    border: none;
    width: 35px;
    height: 35px;
    padding: 6px 8px;
    cursor: pointer;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
    pointer-events: auto;
    z-index: 10;
}

.koc-tablet-hamburger .hamburger-line {
    width: 100%;
    height: 3px;
    background-color: #208cb1;
    transition: all 0.3s ease;
    border-radius: 2px;
    pointer-events: none;
}

.koc-tablet-hamburger.active .hamburger-line:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.koc-tablet-hamburger.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.koc-tablet-hamburger.active .hamburger-line:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* Prevent body scroll when mobile menu is open */
body.tablet-menu-open {
    overflow: hidden;
}

/* ========================================
   MEDIA QUERIES
   ======================================== */

/* Desktop (1300px and above) - Show all buttons including Meliora Longevity */
@media (min-width: 1300px) {
    .koc-tablet-main-menu {
        display: none !important;
    }
    
    /* Normal desktop header structure */
    .page_header .header_1,
    .page_header .header_2,
    .page_header .header_3 {
        display: block !important;
    }
}

/* Tablet (769px - 1299px) - Custom menu structure */
@media (min-width: 769px) and (max-width: 1299px) {
    .elms_row > .clr {
        display: flex !important;
    }

    .page_header .header_1_right {
        width: 0;
        height: 0;
        display: inline-flex;
    }

    /* Show new tablet main menu bar */
    .koc-tablet-main-menu {
        display: block !important;
    }
    
    /* Hide header_3 (white bar menu) */
    .page_header .header_3,
    .header_3.cz_row_shape_none.header_is_sticky {
        display: none !important;
    }
    
    /* Hide original top buttons from header_1 */
    .page_header .header_1_right .cz_btn,
    .page_header .header_1_center .cz_btn,
    .page_header [class*="button_header_1_right_"] {
        display: none !important;
    }
    
    /* Hide the white bar navigation (header_2) - it's now in hamburger menu */
    .page_header .header_2,
    .page_header .header_2_center,
    .page_header .header_2_center nav {
        display: none !important;
    }
    
    /* Keep top bar (header_1) visible but only with social icons and phone */
    .page_header .header_1 {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        padding: 10px 20px;
        box-sizing: border-box;
    }
    
    /* Logo on the left, phone and social on the right */
    .page_header .header_1_left {
        flex: 1;
        display: flex !important;
        gap: 15px;
    }
    
    /* Phone icon - push to the right, but keep before social */
    .page_header .header_1_left .icon_header_1_left_2 {
        margin-left: auto !important;
        margin-right: 0;
        order: 10;
    }
    
    /* Social icons - after phone icon */
    .page_header .header_1_left .social_header_1_left_3 {
        order: 11;
    }
    
    .page_header .header_1_left .cz_social {
        display: flex !important;
        flex-direction: row;
        gap: 8px;
    }
    
    .page_header .header_1_left .cz_social a {
        display: inline-flex !important;
        justify-content: center;
    }
    
    /* Hide header_1_center and header_1_right */
    .page_header .header_1_center {
        display: none !important;
    }
    
    /* Hide desktop search ICON from header_1, but keep the dropdown container */
    .page_header .header_1 .xtra-search-icon,
    .page_header .header_1 .search_with_icon > i.xtra-search-icon {
        display: none !important;
    }
    
    /* Keep the search dropdown container in DOM but invisible by default */
    .page_header .header_1 .search_with_icon {
        position: relative;
        width: 0;
        height: 0;
        overflow: visible;
    }
    
    /* Make the search dropdown visible when opened */
    .page_header .header_1 .search_with_icon .outer_search {
        position: fixed !important;
        top: 100px !important;
        right: 20px !important;
        z-index: 9999 !important;
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    }
}

@media (min-width: 992px) and (max-width: 1299px) {
    .koc-tablet-menu-actions {
        gap: 30px;
    }

    .koc-tablet-menu-nav {
        gap: 40px;
    }
}

@media (min-width: 769px) and (max-width: 991px) {
    .koc-tablet-menu-actions .cz_btn {
        font-size: 14px;;
    }

    .koc-tablet-main-menu {
        width: calc((100% - 60px) / 100 * 90) !important;
        padding: 0 10px;
    }

    .koc-tablet-menu-actions {
        gap: 15px;
    }

    .koc-tablet-menu-nav {
        gap: 20px;
    }

    .tablet-menu-link {
        font-size: 14px;
    }
}

@media (max-width: 1280px) {
    .koc-tablet-main-menu {
        width: calc((100% - 80px) / 100 * 90);
        margin-left: auto;
        margin-right: auto;
    }
}

/* Mobile (768px and below) - Use WordPress mobile menu */
@media (max-width: 768px) {
    .koc-tablet-main-menu {
        display: none !important;
    }
    
    /* Let the theme's mobile menu handle this breakpoint */
}

/* ========================================
   MELIORA LONGEVITY BUTTON STYLES
   ======================================== */

/* Style for the new Meliora Longevity button */
.meliora-longevity-btn {
    background-color: transparent;
    border: 2px solid #208cb1;
    color: #208cb1;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
}

.meliora-longevity-btn:hover {
    background-color: #208cb1;
    color: #fff;
}

/* Ensure Meliora title styling is preserved */
.meliora_title {
    display: flex;
    align-items: center;
    gap: 15px;
}

.social_meliora {
    display: flex;
    gap: 10px;
}

/* ========================================
   ACCESSIBILITY IMPROVEMENTS
   ======================================== */

/* Focus styles for keyboard navigation */
.koc-tablet-hamburger:focus,
.koc-tablet-menu-close:focus,
.koc-tablet-nav a:focus {
    outline: 2px solid #208cb1;
    outline-offset: 2px;
}

/* Skip to content link for accessibility */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: #208cb1;
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 10000;
}

.skip-to-content:focus {
    top: 0;
}