/* ==========================================================================
   Horizontal Menu Widget (vars-hm-)
   ========================================================================== */

/* --- Header Bar --- */
.vars-hm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
}

.vars-hm-logo {
    display: inline-flex;
    align-items: center;
    line-height: 0;
}

.vars-hm-logo img {
    display: block;
}

/* --- Desktop Navigation --- */
.vars-hm-desktop-nav {
    display: flex;
    align-items: center;
}

.vars-hm-menu {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
}

.vars-hm-menu > li {
    position: relative;
    list-style: none;
}

.vars-hm-menu > li > a {
    display: block;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s ease;
}

/* --- Desktop Dropdown Sub-menu --- */
.vars-hm-menu .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    list-style: none;
    margin: 0;
    padding: 8px 0;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
    z-index: 100;
}

.vars-hm-menu > li:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.vars-hm-menu .sub-menu li {
    list-style: none;
}

.vars-hm-menu .sub-menu a {
    display: block;
    padding: 8px 20px;
    text-decoration: none;
    font-size: 0.9em;
    color: #333;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.vars-hm-menu .sub-menu a:hover {
    background-color: #f5f5f5;
}

/* --- Mobile Hamburger --- */
.vars-hm-hamburger {
    position: relative;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 28px;
    height: 28px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    gap: 5px;
}

.vars-hm-hamburger-line {
    display: block;
    width: 100%;
    height: 2px;
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Hamburger → X animation */
.vars-hm-hamburger.vars-hm-active .vars-hm-line-1 {
    transform: translateY(7px) rotate(45deg);
}

.vars-hm-hamburger.vars-hm-active .vars-hm-line-2 {
    opacity: 0;
}

.vars-hm-hamburger.vars-hm-active .vars-hm-line-3 {
    transform: translateY(-7px) rotate(-45deg);
}

/* --- Mobile Overlay --- */
.vars-hm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 9998;
}

.vars-hm-overlay.vars-hm-visible {
    opacity: 1;
    visibility: visible;
}

/* --- Mobile Off-Canvas Panel --- */
.vars-hm-panel {
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9999;
    overflow-y: auto;
    box-sizing: border-box;
    padding: 20px;
}

.vars-hm-panel.vars-hm-open {
    transform: translateX(0);
}

/* --- Close Button --- */
.vars-hm-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 5px;
    color: #333;
}

.vars-hm-close:hover {
    opacity: 0.7;
}

/* --- Mobile Menu Items --- */
.vars-hm-mobile-nav {
    padding-top: 50px;
}

.vars-hm-mobile-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.vars-hm-mobile-menu li {
    list-style: none;
}

.vars-hm-mobile-menu > li > a {
    display: block;
    padding: 10px 0;
    text-decoration: none;
    transition: color 0.2s ease;
}

.vars-hm-mobile-menu .sub-menu {
    list-style: none;
    margin: 0;
    padding: 0 0 0 20px;
}

.vars-hm-mobile-menu .sub-menu a {
    display: block;
    padding: 6px 0;
    font-size: 0.9em;
    text-decoration: none;
    transition: color 0.2s ease;
}

/* --- Scroll Lock --- */
body.vars-hm-no-scroll {
    overflow: hidden;
}

/* ==========================================================================
   Breakpoint: 768px
   ========================================================================== */
@media (max-width: 768px) {
    .vars-hm-bp-768 .vars-hm-desktop-nav {
        display: none;
    }
    .vars-hm-bp-768 .vars-hm-hamburger {
        display: flex;
    }
    .vars-hm-bp-768 .vars-hm-panel {
        width: 85vw;
        max-width: 320px;
    }
}

/* ==========================================================================
   Breakpoint: 1024px
   ========================================================================== */
@media (max-width: 1024px) {
    .vars-hm-bp-1024 .vars-hm-desktop-nav {
        display: none;
    }
    .vars-hm-bp-1024 .vars-hm-hamburger {
        display: flex;
    }
    .vars-hm-bp-1024 .vars-hm-panel {
        width: 85vw;
        max-width: 320px;
    }
}

/* ==========================================================================
   Breakpoint: 1200px
   ========================================================================== */
@media (max-width: 1200px) {
    .vars-hm-bp-1200 .vars-hm-desktop-nav {
        display: none;
    }
    .vars-hm-bp-1200 .vars-hm-hamburger {
        display: flex;
    }
    .vars-hm-bp-1200 .vars-hm-panel {
        width: 85vw;
        max-width: 320px;
    }
}
