/* ===================================
   Header + Mega Menu — Fresh Design
   =================================== */

/* --- Main Header --- */
.hdr {
    background: #fff;
    box-shadow: 0 2px 16px rgba(0,0,0,0.06);
    z-index: 1050;
}

/* --- Nav bar --- */
.hdr-nav {
    padding: 0 2rem;
}

.hdr-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    height: 64px;
}

/* --- Logo --- */
.hdr-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    text-decoration: none;
}

.hdr-logo img {
    height: 46px;
}

.hdr-logo-txt {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.hdr-logo-txt span {
    font-weight: 700;
    font-size: 15px;
    color: #1a1a2e;
}

.hdr-logo-txt small {
    font-size: 11px;
    color: #888;
}

/* --- Search --- */
.hdr-search {
    flex: 1;
    max-width: 520px;
    display: flex;
    align-items: center;
    background: #f5f7fa;
    border: 2px solid transparent;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s;
}

.hdr-search:focus-within {
    border-color: #1875e3;
    background: #fff;
    box-shadow: 0 4px 16px rgba(24,117,227,0.1);
}

.hdr-search input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px 16px;
    font-size: 14px;
    color: #333;
    outline: none;
}

.hdr-search input::placeholder {
    color: #aaa;
}

.hdr-search button {
    border: none;
    background: linear-gradient(135deg, #1875e3, #56a4d1);
    color: #fff;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 0 10px 10px 0;
    font-size: 16px;
    transition: opacity 0.2s;
}

.hdr-search button:hover {
    opacity: 0.85;
}

/* --- Mobile search bar --- */
.hdr-search-mobile {
    display: flex;
    align-items: center;
    margin: 0 1rem 10px;
    background: #f5f7fa;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: border-color 0.3s;
}

.hdr-search-mobile:focus-within {
    border-color: #1875e3;
}

.hdr-search-mobile input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 9px 14px;
    font-size: 14px;
    outline: none;
    color: #333;
}

.hdr-search-mobile input::placeholder {
    color: #aaa;
}

.hdr-search-mobile button {
    border: none;
    background: linear-gradient(135deg, #1875e3, #56a4d1);
    color: #fff;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 0 8px 8px 0;
    font-size: 14px;
}

/* --- Actions --- */
.hdr-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    margin-right: auto;
}

/* Points badge */
.hdr-points {
    display: flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #fff8e1, #fff3c4);
    color: #f59e0b;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s;
    white-space: nowrap;
}

.hdr-points:hover {
    background: linear-gradient(135deg, #fff3c4, #fde68a);
    color: #d97706;
    transform: translateY(-1px);
}

.hdr-points i {
    font-size: 14px;
}

/* Icon buttons */
.hdr-icon-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: #f5f7fa;
    border: none;
    color: #555;
    font-size: 17px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    text-decoration: none;
}

.hdr-icon-btn:hover {
    background: #eef5ff;
    color: #1875e3;
}

.hdr-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* --- User Dropdown --- */
.hdr-user-dropdown {
    position: relative;
}

.hdr-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.12);
    min-width: 220px;
    padding: 10px 0;
    z-index: 1100;
    border: 1px solid #f0f0f0;
}

.hdr-user-dropdown:hover .hdr-dropdown,
.hdr-dropdown:hover {
    display: block;
}

.hdr-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    font-size: 14px;
    color: #444;
    transition: all 0.2s;
    text-decoration: none;
}

.hdr-dropdown a:hover {
    background: #f5f7fa;
    color: #1875e3;
}

.hdr-dropdown a i {
    width: 18px;
    text-align: center;
    font-size: 14px;
    color: #1875e3;
}

.hdr-dropdown-divider {
    height: 1px;
    background: #f0f0f0;
    margin: 6px 0;
}

/* --- Hamburger --- */
.hdr-hamburger {
    width: 40px;
    height: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border: none;
    background: #f5f7fa;
    border-radius: 10px;
    cursor: pointer;
    padding: 8px;
}

.hdr-hamburger span {
    display: block;
    width: 20px;
    height: 2px;
    background: #333;
    border-radius: 2px;
    transition: all 0.3s;
}

/* ===================================
   Category Bar
   =================================== */
.hdr-cats,
.menu-wrapper.category-bar {
    border-top: 1px solid #eef1f5;
    background: linear-gradient(180deg, #fff 0%, #fafbfd 100%);
}

.hdr-cats-scroll {
    display: flex;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 0 2rem;
    -webkit-overflow-scrolling: touch;
}

.hdr-cats-scroll::-webkit-scrollbar {
    display: none;
}

.hdr-cat-link {
    padding: 0 16px !important;
    font-size: 13px !important;
    color: #555 !important;
    white-space: nowrap;
    text-decoration: none !important;
    border-bottom: 2.5px solid transparent !important;
    transition: all 0.25s ease !important;
    flex-shrink: 0;
    font-weight: 500 !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px;
    line-height: 38px !important;
    margin: 0 !important;
    position: relative;
    border-radius: 0 !important;
    background: transparent !important;
}

.hdr-cat-link i {
    font-size: 11px;
    opacity: 0.7;
}

.hdr-cat-link:hover,
.hdr-cat-link.active {
    color: #1875e3 !important;
    border-bottom-color: #1875e3 !important;
    background: linear-gradient(180deg, transparent 40%, rgba(24,117,227,0.06) 100%) !important;
    font-weight: 600 !important;
}

/* ===================================
   Mega Menu — Modern Design
   =================================== */
.mega-menu {
    display: none;
    position: fixed;
    top: 102px;
    left: 0;
    right: 0;
    width: 100%;
    height: auto;
    background: linear-gradient(180deg, #fff 0%, #f8fafd 100%);
    box-shadow: 0 20px 60px rgba(0,0,0,0.10), 0 1px 0 rgba(0,0,0,0.04);
    z-index: 1049;
    border-top: none;
    overflow: hidden;
    animation: mmSlideIn 0.25s ease-out;
    padding: 0;
    direction: rtl;
    text-align: right;
}

@keyframes mmSlideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* --- Close button (top-left corner) --- */
.mm-close-btn {
    position: absolute;
    top: 10px;
    left: 12px;
    right: auto;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: rgba(0,0,0,0.05);
    border-radius: 50%;
    color: #999;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 5;
}

.mm-close-btn:hover {
    background: #fee2e2;
    color: #ef4444;
}

/* --- Sidebar wrapper (header + cats + footer) --- */
.mm-sidebar {
    width: 250px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-left: 1px solid #eef1f5;
    border-right: none;
    background: linear-gradient(180deg, #f6f8fc 0%, #eef2f8 100%);
}

.mm-sidebar-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 16px 12px;
    border-bottom: 1px solid #e5eaf1;
}

.mm-cat-icon {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: linear-gradient(135deg, #1875e3, #56a4d1);
    color: #fff;
    font-size: 14px;
    flex-shrink: 0;
}

.mm-cat-name {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a2e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mm-sidebar-foot {
    padding: 12px;
    border-top: 1px solid #e5eaf1;
    background: linear-gradient(180deg, #eef2f8, #e8edf5);
}

.mm-go-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    background: linear-gradient(135deg, #1875e3, #3b9be0);
    color: #fff;
    border-radius: 14px;
    text-decoration: none;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.mm-go-btn::before {
    content: '';
    position: absolute;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(-90deg, transparent, rgba(255,255,255,0.15), transparent);
    transition: right 0.4s ease;
}

.mm-go-btn:hover::before {
    right: 100%;
}

.mm-go-btn:hover {
    background: linear-gradient(135deg, #1260c0, #2d88cc);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(24,117,227,0.4);
}

.mm-go-btn-text {
    flex: 1;
    min-width: 0;
    text-align: right;
}

.mm-go-btn-label {
    font-size: 10px;
    font-weight: 500;
    opacity: 0.8;
    display: block;
    line-height: 1;
    margin-bottom: 3px;
    letter-spacing: 0.3px;
}

.mm-go-btn-name {
    font-size: 14px;
    font-weight: 700;
    display: block;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

.mm-go-btn i {
    font-size: 14px;
    margin-left: auto;
    margin-right: 0;
    opacity: 0.8;
    transition: transform 0.25s ease;
}

.mm-go-btn:hover i {
    transform: translateX(4px);
    opacity: 1;
}

.mm-container {
    display: flex;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0;
    height: calc(100vh - 140px);
    max-height: 620px;
}

/* --- Category list inside sidebar --- */
.mm-cats {
    flex: 1;
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px;
    scrollbar-width: none;
    background: transparent;
    border: none;
}

.mm-cats::-webkit-scrollbar {
    display: none;
}

/* Style the cloned .menu-item inside .mm-cats */
.mm-cats .menu-item {
    display: block !important;
    padding: 0;
    margin: 0;
}

.mm-cats .nav-item {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mm-cats .nav-link {
    display: flex !important;
    align-items: center !important;
    padding: 10px 16px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    color: #444 !important;
    border-radius: 10px !important;
    transition: background 0.1s ease, color 0.1s ease !important;
    text-decoration: none !important;
    cursor: pointer;
    position: relative;
    margin: 0 0 2px 0 !important;
    border: none !important;
    line-height: 1.4 !important;
    background: transparent !important;
}

.mm-cats .nav-link::before {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%) scaleY(0);
    width: 3px;
    height: 20px;
    background: #1875e3;
    border-radius: 3px;
    transition: transform 0.2s ease;
}

.mm-cats .nav-link:hover,
.mm-cats .nav-link.active {
    background: #fff !important;
    color: #1875e3 !important;
    font-weight: 600 !important;
    box-shadow: 0 2px 8px rgba(24,117,227,0.08) !important;
}

.mm-cats .nav-link:hover::before,
.mm-cats .nav-link.active::before {
    transform: translateY(-50%) scaleY(1);
}

/* --- Doctor panels (center + left) --- */
.mm-panel {
    flex: 1;
    padding: 20px 24px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
}

.mm-panel::-webkit-scrollbar {
    display: none;
}

.mm-panel-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eef1f5;
}

.mm-panel-head i {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 12px;
    color: #fff;
    background: linear-gradient(135deg, #1875e3, #56a4d1);
    flex-shrink: 0;
}

.mm-panel-head h6 {
    font-size: 14px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0;
    text-align: right;
}

/* Split panel (third section) */
.mm-panel-split {
    display: flex;
    flex-direction: column;
}

.mm-split-block {
    flex: none;
    padding-bottom: 10px;
}

.mm-split-block + .mm-split-block {
    padding-top: 10px;
    border-top: 1px dashed #e5e9f0;
}

/* --- Doctor row grid --- */
.mega-menu .doctor-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 4px 0;
    align-items: flex-start;
}

.mega-menu .doctor-row .col-2,
.mega-menu .doctor-row .col-3 {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 76px;
    flex: none;
    padding: 6px 4px;
    border-radius: 12px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.mega-menu .doctor-row .col-2:hover,
.mega-menu .doctor-row .col-3:hover {
    background: rgba(24,117,227,0.05);
    transform: translateY(-2px);
}

.mega-menu .doctor-row img {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 6px;
    border: 2.5px solid #e0e5ec;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.mega-menu .doctor-row .col-2:hover img,
.mega-menu .doctor-row .col-3:hover img {
    border-color: #1875e3;
    box-shadow: 0 4px 16px rgba(24,117,227,0.2);
    transform: scale(1.05);
}

.mega-menu .doctor-row p {
    font-size: 11px;
    color: #555;
    margin: 0;
    line-height: 1.3;
    max-width: 72px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: break-word;
}

.mega-menu .doctor-row a {
    text-decoration: none;
    color: inherit;
}

.mega-menu .doctor-row .col-2:hover p,
.mega-menu .doctor-row .col-3:hover p {
    color: #1875e3;
}

/* --- Banner images (override old .mega-menu img circle style) --- */
.mega-menu .mm-banner,
.mega-menu .mega-banner,
.mega-menu .banner-head,
img.mm-banner,
img#banner-left,
img#banner-right {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: none !important;
    border-radius: 10px !important;
    margin-top: 14px !important;
    object-fit: contain !important;
    border: 1px solid #eef1f5 !important;
    transition: transform 0.2s ease;
    display: block;
}

.mega-menu .mm-banner:hover,
img#banner-left:hover,
img#banner-right:hover {
    transform: scale(1.01);
}

/* --- Backmask overlay --- */
.backmask {
    display: none;
    position: fixed;
    top: 102px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.18);
    z-index: 1048;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    animation: mmFadeIn 0.2s ease;
}

@keyframes mmFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ===================================
   Mobile Menu
   =================================== */
.hdr-mobile-menu {
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100vh;
    background: #fff;
    z-index: 1200;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 20px rgba(0,0,0,0.1);
}

.hdr-mobile-menu.open {
    right: 0;
}

.hdr-mobile-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    background: #f8fbff;
}

.hdr-mobile-header img {
    height: 50px;
}

.hdr-mobile-header div {
    flex: 1;
}

.hdr-mobile-header p {
    font-weight: 700;
    font-size: 15px;
    color: #1a1a2e;
    margin: 0;
}

.hdr-mobile-header small {
    font-size: 12px;
    color: #888;
}

.hdr-mobile-header button {
    border: none;
    background: none;
    font-size: 28px;
    color: #888;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.hdr-mobile-links {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
}

.hdr-mobile-links a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    font-size: 15px;
    color: #444;
    transition: all 0.2s;
    text-decoration: none;
}

.hdr-mobile-links a:hover {
    background: #f5f7fa;
    color: #1875e3;
}

.hdr-mobile-links a i {
    width: 22px;
    text-align: center;
    font-size: 16px;
    color: #1875e3;
}

.hdr-mobile-divider {
    height: 1px;
    background: #f0f0f0;
    margin: 8px 20px;
}

/* Mobile overlay */
.hdr-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    z-index: 1199;
}

.hdr-mobile-menu.open ~ .hdr-overlay {
    display: block;
}

/* ===================================
   Responsive
   =================================== */
@media (max-width: 991px) {
    .hdr-nav {
        padding: 0 1rem;
    }

    .hdr-inner {
        height: 56px;
        gap: 12px;
    }

    .hdr-logo img {
        height: 38px;
    }

    .hdr-logo-txt span {
        font-size: 13px;
    }

    .hdr-logo-txt small {
        font-size: 10px;
    }

    .mega-menu,
    .backmask {
        display: none !important;
    }
}

@media (max-width: 576px) {
    .hdr-logo-txt {
        display: none;
    }
}
