/* ==========================================================================
   MB BEAUTY STUDIO - PREMIUM NAVBAR STYLESHEET
   Mobile-First Approach | Elegant Beauty Brand UI
   ========================================================================== */

/* ============================
   CSS CUSTOM PROPERTIES
   ============================ */
:root {
    --navbar-bg: #ffffff;
    --navbar-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    --navbar-shadow-scrolled: 0 4px 30px rgba(0, 0, 0, 0.12);
    --primary-pink: #e8a2c0;
    --primary-pink-dark: #d489ad;
    --primary-gradient: linear-gradient(135deg, #e8a2c0 0%, #d489ad 100%);
    --text-dark: #2c2c2c;
    --text-muted: #666;
    --text-light: #888;
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.3s ease;
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 20px;
    --border-radius-pill: 50px;
    --touch-target: 44px;
    --navbar-height: 70px;
    --navbar-height-scrolled: 60px;
}

/* ============================
   MAIN NAVBAR CONTAINER
   ============================ */
.navbar-premium {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--navbar-bg);
    box-shadow: var(--navbar-shadow);
    transition: all var(--transition-smooth);
    padding: 0;
}

/* Mobile Sticky Fix */
@media (max-width: 991px) {
    .navbar-premium {
        position: fixed;
        /* Force fixed on mobile for better support if sticky fails */
        width: 100%;
        top: 0;
    }

    /* Add padding to body to prevent content from jumping behind fixed navbar */
    body {
        padding-top: var(--navbar-height);
    }
}

.navbar-premium.scrolled {
    box-shadow: var(--navbar-shadow-scrolled);
}

.navbar-premium.scrolled .navbar-inner {
    height: var(--navbar-height-scrolled);
}

.navbar-premium.scrolled .logo-img {
    height: 32px;
}

.navbar-premium.scrolled .logo-text {
    font-size: 1.1rem;
}

.navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--navbar-height);
    padding: 0 15px;
    max-width: 1400px;
    margin: 0 auto;
    transition: height var(--transition-smooth);
}

/* ============================
   LOGO SECTION
   ============================ */
.navbar-brand-premium {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
    z-index: 1002;
}

.logo-img {
    height: 40px;
    width: auto;
    transition: height var(--transition-smooth);
}

.logo-text {
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    transition: font-size var(--transition-smooth);
    white-space: nowrap;
}

/* ============================
   DESKTOP NAVIGATION MENU
   ============================ */
.nav-menu-desktop {
    display: none;
    align-items: center;
    gap: 5px;
    margin: 0;
    padding: 0;
    list-style: none;
    transition: all var(--transition-smooth);
    transform-origin: center;
}

/* When search is active - shrink/hide nav menu */
.nav-menu-desktop.search-active {
    opacity: 0;
    transform: scale(0.9);
    pointer-events: none;
}

.nav-menu-desktop .nav-item {
    position: relative;
}

.nav-menu-desktop .nav-link {
    display: block;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    transition: all var(--transition-smooth);
    position: relative;
    border-radius: var(--border-radius-sm);
}

.nav-menu-desktop .nav-link::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 16px;
    right: 16px;
    height: 2px;
    background: var(--primary-gradient);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform var(--transition-smooth);
    border-radius: 2px;
}

.nav-menu-desktop .nav-link:hover,
.nav-menu-desktop .nav-link.active {
    color: var(--primary-pink);
}

.nav-menu-desktop .nav-link:hover::after,
.nav-menu-desktop .nav-link.active::after {
    transform: scaleX(1);
}

/* ============================
   RIGHT ICONS SECTION
   ============================ */
.navbar-icons {
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 1002;
}

.icon-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--touch-target);
    height: var(--touch-target);
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 18px;
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition-smooth);
    text-decoration: none;
}

.icon-btn:hover {
    color: var(--primary-pink);
    background: rgba(232, 162, 192, 0.1);
    transform: translateY(-2px);
}

.icon-btn:active {
    transform: translateY(0) scale(0.95);
}

/* Cart Badge */
.cart-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--primary-gradient);
    color: white;
    font-size: 10px;
    font-weight: 600;
    border-radius: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(232, 162, 192, 0.4);
    animation: badge-pulse 2s infinite;
}

@keyframes badge-pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

/* Search Icon & Expanding Search */
.search-toggle {
    display: flex;
}

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-expand {
    position: relative;
    width: 0;
    opacity: 0;
    transition: all var(--transition-slow);
}

.search-expand.active {
    width: 280px;
    opacity: 1;
}

.search-expand form {
    position: relative;
}

.search-expand input {
    width: 100%;
    padding: 12px 45px 12px 18px;
    border: 2px solid var(--primary-pink);
    border-radius: var(--border-radius-pill);
    font-size: 14px;
    outline: none;
    background: white;
}

.search-expand input:focus {
    box-shadow: 0 0 0 4px rgba(232, 162, 192, 0.15);
}

/* Desktop Search Results Dropdown */
.search-expand .search-results-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    min-width: 320px;
}

/* ============================
   ACCOUNT DROPDOWN
   ============================ */
.account-dropdown {
    position: relative;
}

.account-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--touch-target);
    height: var(--touch-target);
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 20px;
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition-smooth);
}

.account-btn:hover {
    color: var(--primary-pink);
    background: rgba(232, 162, 192, 0.1);
}

/* User Avatar (Logged In) */
.user-avatar-premium {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 15px;
    box-shadow: 0 2px 10px rgba(232, 162, 192, 0.3);
    transition: all var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.user-avatar-premium::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.account-btn:hover .user-avatar-premium::after {
    left: 100%;
}

.account-btn:hover .user-avatar-premium {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(232, 162, 192, 0.5);
}

/* Dropdown Menu */
.dropdown-menu-premium {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 220px;
    background: white;
    border-radius: var(--border-radius-md);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    transform-origin: top right;
    transition: all var(--transition-smooth);
    z-index: 1100;
}

.dropdown-menu-premium.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.dropdown-header-premium {
    padding: 12px 15px;
    background: linear-gradient(135deg, rgba(232, 162, 192, 0.1) 0%, rgba(212, 137, 173, 0.05) 100%);
    border-radius: var(--border-radius-sm);
    margin-bottom: 8px;
}

.dropdown-header-premium small {
    color: var(--text-light);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dropdown-header-premium .user-name {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 14px;
    margin-top: 2px;
}

.dropdown-divider-premium {
    height: 1px;
    background: #f0f0f0;
    margin: 8px 0;
}

.dropdown-item-premium {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    color: var(--text-dark);
    text-decoration: none;
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    transition: all var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.dropdown-item-premium::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: var(--primary-gradient);
    transform: scaleY(0);
    transition: transform var(--transition-smooth);
}

.dropdown-item-premium:hover {
    background: linear-gradient(135deg, rgba(232, 162, 192, 0.1) 0%, rgba(212, 137, 173, 0.05) 100%);
    color: var(--primary-pink);
    padding-left: 20px;
}

.dropdown-item-premium:hover::before {
    transform: scaleY(1);
}

.dropdown-item-premium i {
    width: 18px;
    text-align: center;
    transition: transform var(--transition-smooth);
}

.dropdown-item-premium:hover i {
    transform: translateX(2px);
}

.dropdown-item-premium.logout {
    color: #ef4444;
}

.dropdown-item-premium.logout:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

/* ============================
   HAMBURGER MENU BUTTON
   ============================ */
.hamburger-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: var(--touch-target);
    height: var(--touch-target);
    padding: 10px;
    border: none;
    background: transparent;
    cursor: pointer;
    z-index: 1002;
    gap: 5px;
}

.hamburger-line {
    width: 22px;
    height: 2px;
    background: var(--text-dark);
    border-radius: 2px;
    transition: all var(--transition-smooth);
    transform-origin: center;
}

.hamburger-btn.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-btn.active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.hamburger-btn.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ============================
   MOBILE MENU OVERLAY
   ============================ */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-smooth);
    z-index: 999;
    backdrop-filter: blur(3px);
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ============================
   MOBILE SLIDE MENU
   ============================ */
.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 85%;
    max-width: 320px;
    height: 100vh;
    background: white;
    transform: translateX(-100%);
    transition: transform var(--transition-slow);
    z-index: 1001;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.mobile-menu.active {
    transform: translateX(0);
}

.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.mobile-menu-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mobile-menu-logo img {
    height: 35px;
}

.mobile-menu-logo span {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
}

.mobile-close-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: #f5f5f5;
    border-radius: 50%;
    font-size: 18px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-smooth);
}

.mobile-close-btn:hover {
    background: rgba(232, 162, 192, 0.1);
    color: var(--primary-pink);
}

/* Mobile Nav Items */
.mobile-nav {
    list-style: none;
    margin: 0;
    padding: 20px;
    flex: 1;
}

.mobile-nav-item {
    opacity: 0;
    transform: translateX(-20px);
    transition: all var(--transition-smooth);
}

.mobile-menu.active .mobile-nav-item {
    opacity: 1;
    transform: translateX(0);
}

/* Staggered animation */
.mobile-menu.active .mobile-nav-item:nth-child(1) {
    transition-delay: 0.1s;
}

.mobile-menu.active .mobile-nav-item:nth-child(2) {
    transition-delay: 0.15s;
}

.mobile-menu.active .mobile-nav-item:nth-child(3) {
    transition-delay: 0.2s;
}

.mobile-menu.active .mobile-nav-item:nth-child(4) {
    transition-delay: 0.25s;
}

.mobile-menu.active .mobile-nav-item:nth-child(5) {
    transition-delay: 0.3s;
}

.mobile-menu.active .mobile-nav-item:nth-child(6) {
    transition-delay: 0.35s;
}

.mobile-menu.active .mobile-nav-item:nth-child(7) {
    transition-delay: 0.4s;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 0;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-dark);
    text-decoration: none;
    border-bottom: 1px solid #f5f5f5;
    transition: all var(--transition-smooth);
}

.mobile-nav-link i {
    width: 24px;
    text-align: center;
    color: var(--primary-pink);
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
    color: var(--primary-pink);
    padding-left: 10px;
}

/* Mobile Menu Footer */
.mobile-menu-footer {
    padding: 20px;
    border-top: 1px solid #f0f0f0;
    background: #fafafa;
}

.mobile-menu-footer p {
    margin: 0;
    font-size: 12px;
    color: var(--text-light);
    text-align: center;
}

/* ============================
   MOBILE SEARCH BAR (Inside Menu)
   ============================ */
.mobile-search {
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.mobile-search-form {
    position: relative;
}

.mobile-search-input {
    width: 100%;
    padding: 12px 45px 12px 15px;
    border: 1px solid #e0e0e0;
    border-radius: var(--border-radius-pill);
    font-size: 15px;
    transition: all var(--transition-smooth);
}

.mobile-search-input:focus {
    outline: none;
    border-color: var(--primary-pink);
    box-shadow: 0 0 0 3px rgba(232, 162, 192, 0.15);
}

.mobile-search-btn {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: none;
    background: var(--primary-gradient);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition-smooth);
}

.mobile-search-btn:hover {
    transform: translateY(-50%) scale(1.05);
}

/* Mobile Search Results (inside mobile menu) */
.mobile-search .mobile-search-results {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    z-index: 100;
    max-height: 250px;
    border-radius: var(--border-radius-md);
}

.mobile-search {
    position: relative;
}

/* ============================
   DESKTOP STYLES (992px+)
   ============================ */
@media (min-width: 992px) {
    .hamburger-btn {
        display: none;
    }

    .mobile-menu,
    .mobile-menu-overlay {
        display: none !important;
    }

    .nav-menu-desktop {
        display: flex;
    }

    .navbar-inner {
        padding: 0 30px;
    }

    .search-toggle {
        display: none;
    }

    .search-wrapper .search-expand {
        position: relative;
        width: 200px;
        opacity: 1;
        transform: none;
    }

    .search-wrapper .search-expand.active {
        width: 280px;
    }

    .logo-text {
        font-size: 1.1rem;
    }

    .nav-menu-desktop .nav-link {
        padding: 10px 10px;
        font-size: 13px;
    }
}

/* ============================
   TABLET STYLES (768px - 991px)
   ============================ */
@media (min-width: 768px) and (max-width: 991px) {
    .navbar-inner {
        padding: 0 20px;
    }

    .mobile-menu {
        width: 50%;
        max-width: 400px;
    }

    .logo-text {
        font-size: 1.2rem;
    }
}

/* ============================
   MOBILE STYLES (< 768px)
   ============================ */
@media (max-width: 767px) {
    :root {
        --navbar-height: 60px;
        --navbar-height-scrolled: 55px;
    }

    .logo-text {
        font-size: 1rem;
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .logo-img {
        height: 32px;
    }

    .navbar-icons {
        gap: 4px;
    }

    .icon-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .search-toggle {
        display: flex;
    }

    /* Hide desktop search on mobile */
    .search-wrapper .search-expand {
        display: none;
    }
}

/* ============================
   SMALL MOBILE (< 480px)
   ============================ */
@media (max-width: 479px) {
    .logo-text {
        display: none;
        /* Hide text to prevent overflow */
    }

    .logo-img {
        height: 28px;
    }

    .navbar-inner {
        padding: 0 10px;
    }

    .navbar-brand-premium {
        gap: 6px;
    }
}

/* ============================
   SEARCH RESULTS DROPDOWN (Animated)
   ============================ */
.search-results-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: white;
    border-radius: var(--border-radius-md);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.18);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-smooth);
}

.search-results-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Search Result Items with Animation */
.search-result-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    text-decoration: none;
    color: var(--text-dark);
    border-bottom: 1px solid #f5f5f5;
    transition: all var(--transition-smooth);
    position: relative;
    opacity: 0;
    transform: translateX(-15px);
    animation: searchItemSlideIn 0.3s ease forwards;
}

/* Staggered animation for each result */
.search-result-item:nth-child(1) {
    animation-delay: 0.05s;
}

.search-result-item:nth-child(2) {
    animation-delay: 0.1s;
}

.search-result-item:nth-child(3) {
    animation-delay: 0.15s;
}

.search-result-item:nth-child(4) {
    animation-delay: 0.2s;
}

.search-result-item:nth-child(5) {
    animation-delay: 0.25s;
}

.search-result-item:nth-child(6) {
    animation-delay: 0.3s;
}

.search-result-item:nth-child(7) {
    animation-delay: 0.35s;
}

.search-result-item:nth-child(8) {
    animation-delay: 0.4s;
}

.search-result-item:nth-child(9) {
    animation-delay: 0.45s;
}

.search-result-item:nth-child(10) {
    animation-delay: 0.5s;
}

@keyframes searchItemSlideIn {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.search-result-item:hover {
    background: linear-gradient(135deg, rgba(232, 162, 192, 0.08) 0%, rgba(212, 137, 173, 0.04) 100%);
    padding-left: 20px;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item img {
    width: 50px;
    height: 50px;
    border-radius: var(--border-radius-sm);
    object-fit: cover;
    margin-right: 12px;
    transition: transform var(--transition-smooth);
}

.search-result-item:hover img {
    transform: scale(1.05);
}

.search-result-info {
    flex: 1;
}

.search-result-info h6 {
    margin: 0 0 4px 0;
    font-size: 14px;
    font-weight: 500;
    transition: color var(--transition-smooth);
}

.search-result-item:hover .search-result-info h6 {
    color: var(--primary-pink);
}

.search-result-info .price {
    color: var(--primary-pink);
    font-weight: 600;
    font-size: 13px;
}

/* Loading State when clicking a product */
.search-result-item.loading {
    pointer-events: none;
}

.search-result-item.loading::after {
    content: '';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(232, 162, 192, 0.3);
    border-top-color: var(--primary-pink);
    border-radius: 50%;
    animation: searchLoadingSpin 0.6s linear infinite;
}

@keyframes searchLoadingSpin {
    to {
        transform: translateY(-50%) rotate(360deg);
    }
}

.search-result-item.loading img {
    opacity: 0.5;
}

.search-result-item.loading .search-result-info {
    opacity: 0.6;
}

/* No Results Message */
.no-results-msg {
    padding: 30px 20px;
    text-align: center;
    color: var(--text-light);
    animation: fadeIn 0.3s ease;
}

.no-results-msg i {
    display: block;
    font-size: 32px;
    margin-bottom: 10px;
    color: #ddd;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Search Loading Indicator (while fetching) */
.search-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 25px;
    gap: 8px;
    color: var(--text-light);
}

.search-loading .spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(232, 162, 192, 0.3);
    border-top-color: var(--primary-pink);
    border-radius: 50%;
    animation: searchLoadingSpin 0.6s linear infinite;
}

/* ============================
   UTILITY CLASSES
   ============================ */
.body-menu-open {
    overflow: hidden;
}