/* ===================================================== 
   KD HMS TOP BAR
===================================================== */

.hms-topbar {
    position: sticky;
    top: 0;
    z-index: 999;
    background: #fff;
    border-bottom: 1px solid var(--hms-border);
    padding: 12px 20px;

    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* =========================
   LEFT (LOGO)
========================= */

.hms-topbar-left {
    display: flex;
    align-items: center;

    flex: 0 1 auto;   /* 🔥 do NOT stretch full width */
    min-width: 0;
}

/* 🔥 FIXED LOGO WRAPPING */
.hms-logo {
    display: flex;
    align-items: center;
    gap: 10px;

    text-decoration: none;
    color: var(--hms-primary);

    font-size: 18px;
    font-weight: 600;

    flex-wrap: wrap;       /* ✅ allow wrapping */
}

.hms-logo-img {
    height: 36px;
    max-height: 36px;
    width: auto;
    display: block;
    flex-shrink: 0;        /* keep logo stable */
}

/* 🔥 CRITICAL TEXT FIX */
.hms-logo-text {
    display: inline;

    min-width: 0;                  /* 🔥 required */
    white-space: normal !important;
    overflow-wrap: break-word;     /* safer than anywhere */
}

/* =========================
   MOBILE TEXT BREAK
========================= */

.hms-mobile-break {
    display: none;
}

@media (max-width: 768px) {
    .hms-mobile-break {
        display: block; /* force new line on mobile */
    }
}

@media (max-width: 768px) {
    .hms-logo-text {
        font-size: 18px !important;
    }
}

/* =========================
   RIGHT (MENU)
========================= */

.hms-topbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: nowrap;
    transition: all 0.3s ease;
}

.hms-topbar-right a {
    text-decoration: none;
    font-size: 14px;
    color: var(--hms-text);
    transition: color 0.2s ease;
}

.hms-topbar-right a:hover {
    color: var(--hms-primary);
}

/* =========================
   MOBILE MENU TOGGLE
========================= */

.hms-menu-toggle {
    display: none;
    font-size: 22px;
    cursor: pointer;
}

/* =========================
   MOBILE VIEW
========================= */

@media (max-width: 768px) {

    .hms-topbar {
        padding: 10px 15px;
    }

    .hms-topbar-left {
        max-width: 70%;
    }

    .hms-logo-img {
        height: 28px;
    }

    .hms-menu-toggle {
        display: block;
    }

    .hms-topbar-right {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: #fff;

        display: none;
        flex-direction: column;
        align-items: flex-start;

        padding: 15px;
        gap: 10px;

        border-top: 1px solid #eee;
        box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    }

    .hms-topbar-right.active {
        display: flex;
    }
}

/* =========================
   SPECIAL BUTTON (BOOK)
========================= */

.hms-topbar-right .hms-btn-primary {
    padding: 8px 14px;
    font-size: 13px;
}

/* =========================
   SMALL UX POLISH
========================= */

.hms-logo:hover {
    opacity: 0.9;
}

/* =========================
   ACTIVE MENU
========================= */
.hms-topbar-right a.hms-active {
    color: var(--hms-primary);
    font-weight: 600;
    position: relative;
}

 /* underline effect */
.hms-topbar-right a.hms-active::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--hms-primary);
    border-radius: 2px;
}

/* Desktop: show full text */
/* Desktop default */
.hms-desktop-text {
    display: inline;
}

.hms-mobile-text {
    display: none;
}

/* Mobile override */
@media (max-width: 768px) {

    .hms-desktop-text {
        display: none !important;   /* 🔥 force hide */
    }

    .hms-mobile-text {
        display: inline !important; /* 🔥 force show */
    }
}
