/* =========================================================
   CouponsArena – Premium Navbar (navbar.css)
   ========================================================= */
:root {
    --brand-primary: #7e22ce;
    --brand-primary-dark: #4c1d95;
    --brand-primary-light: #a855f7;
    --brand-accent: #ec4899;
    --gradient-brand: linear-gradient(135deg, #9333ea 0%, #ec4899 100%);
    --shadow-brand: 0 4px 14px 0 rgba(126, 34, 206, 0.3);

    --nav-h: 92px;
    --nav-h-scrolled: 76px;
    --logo-size: 70px;
    --nav-border: rgba(255, 255, 255, 0.08);
    --nav-text: #d1d5db;
    --nav-hover: #ffffff;
}

body { padding-top: var(--nav-h); }

/* ---------- Header shell ---------- */
.header-container {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: var(--nav-h);
    padding: 0 40px;
    z-index: 1050;
    background:
        radial-gradient(40% 120% at 85% 0%, rgba(236, 72, 153, .14) 0%, transparent 70%),
        linear-gradient(to right, #050505 0%, #12081f 50%, #050505 100%);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--nav-border);
    box-shadow: 0 6px 30px rgba(0, 0, 0, .55);
    transition: transform .4s cubic-bezier(.77, 0, .175, 1), height .3s ease;
}
/* gradient hairline under the header */
.header-container::after {
    content: '';
    position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
    background: linear-gradient(90deg, transparent 0%, var(--brand-primary) 25%, var(--brand-accent) 50%, var(--brand-primary) 75%, transparent 100%);
    opacity: .85;
}
.header-container.nav-hidden { transform: translateY(-100%); }
.header-container.scrolled { height: var(--nav-h-scrolled); }

.navbar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 24px;
    width: 100%; height: 100%;
    max-width: 1440px; margin: 0 auto; padding: 0;
}

/* ---------- Logo ---------- */
.navbar-brand { margin: 0; padding: 0; display: flex; align-items: center; }
.brand-link {
    display: flex; align-items: center; gap: 14px;
    text-decoration: none;
}
.brand-ring {
    display: grid; place-items: center;
    padding: 3px;
    border-radius: 50%;
    background: var(--gradient-brand);
    box-shadow: 0 0 0 4px rgba(126, 34, 206, .18), 0 0 28px rgba(236, 72, 153, .35);
    transition: transform .3s ease, box-shadow .3s ease;
}
.brand-link:hover .brand-ring {
    transform: scale(1.06) rotate(-4deg);
    box-shadow: 0 0 0 5px rgba(126, 34, 206, .28), 0 0 36px rgba(236, 72, 153, .55);
}
.brand-logo {
    display: block;
    height: var(--logo-size); width: var(--logo-size);
    object-fit: contain;
    background: #fff;
    border-radius: 50%;
    padding: 4px;
    transition: height .3s ease, width .3s ease;
}
.header-container.scrolled .brand-logo { height: 58px; width: 58px; }

.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong {
    font-size: 1.35rem; font-weight: 800; letter-spacing: -.01em;
    background: linear-gradient(135deg, #fff 0%, #e9d5ff 100%);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.brand-text small { font-size: .68rem; letter-spacing: .22em; text-transform: uppercase; color: var(--brand-primary-light); font-weight: 600; }

/* ---------- Desktop menu ---------- */
.navbar-menu {
    display: flex; align-items: center; gap: 4px;
    list-style: none; margin: 0; padding: 0;
    position: static;
    height: 100%;
}
/* li fills the header height so hover never "falls through" to the mega menu */
.navbar-menu > li { display: flex; align-items: center; height: 100%; }
.navbar-menu > li > a {
    position: relative;
    color: var(--nav-text);
    text-decoration: none;
    font-size: 15px; font-weight: 600;
    padding: 10px 18px;
    border-radius: 999px;
    transition: color .25s ease, background .25s ease;
}
.navbar-menu > li > a::after {
    content: '';
    position: absolute; left: 50%; bottom: 2px;
    width: 0; height: 2px; border-radius: 2px;
    background: var(--gradient-brand);
    transform: translateX(-50%);
    transition: width .3s ease;
}
.navbar-menu > li:hover > a { color: var(--nav-hover); background: rgba(126, 34, 206, .14); }
.navbar-menu > li:hover > a::after { width: 36%; }
.navbar-menu .dropdown-toggle::after { display: none; } /* hide bootstrap caret, we use our own icon */
.navbar-menu .dropdown-toggle i { transition: transform .25s ease; }
.mega-dropdown:hover .dropdown-toggle i { transform: rotate(180deg); }

/* ---------- Right side ---------- */
.nav-actions { align-items: center; gap: 20px; }

.search-container form {
    display: flex; align-items: center;
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 999px;
    padding: 4px 4px 4px 18px;
    transition: all .3s ease;
}
.search-container form:focus-within {
    background: rgba(255, 255, 255, .09);
    border-color: var(--brand-primary-light);
    box-shadow: 0 0 0 4px rgba(168, 85, 247, .2);
}
.search-container input {
    background: transparent; border: 0; outline: 0;
    color: #fff; font-size: 14px;
    width: 170px;
    transition: width .3s ease;
}
.search-container form:focus-within input { width: 240px; }
.search-container input::placeholder { color: rgba(255, 255, 255, .5); }
.search-container button {
    width: 36px; height: 36px; border: 0; border-radius: 50%;
    display: grid; place-items: center; cursor: pointer;
    color: #fff; background: var(--gradient-brand);
    box-shadow: var(--shadow-brand);
    transition: transform .2s ease;
}
.search-container button:hover { transform: scale(1.1); }

.nav-meta {
    display: flex; align-items: center; gap: 16px;
    padding-left: 20px;
    border-left: 1px solid var(--nav-border);
    height: 40px;
}
.social-icons { display: flex; align-items: center; gap: 8px; }
.social-icons a {
    width: 34px; height: 34px;
    display: grid; place-items: center;
    border-radius: 50%;
    color: var(--nav-text);
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .08);
    font-size: 14px; text-decoration: none;
    transition: all .25s ease;
}
.social-icons a:hover {
    color: #fff; background: var(--gradient-brand);
    border-color: transparent; transform: translateY(-2px);
    box-shadow: var(--shadow-brand);
}

/* Desktop language dropdown */
.language-selector { position: relative; display: flex; align-items: center; height: var(--nav-h); }
.language-selector > a {
    display: inline-flex; align-items: center; gap: 4px;
    color: var(--nav-text); text-decoration: none;
    font-size: 13px; font-weight: 700; letter-spacing: .05em;
    padding: 8px 14px; border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .12);
    background: rgba(255, 255, 255, .04);
    transition: all .25s ease;
}
.language-selector:hover > a { color: #fff; border-color: var(--brand-primary-light); background: rgba(126, 34, 206, .2); }
.lang-dropdown {
    display: none;
    position: absolute; top: calc(100% - 14px); right: 0;
    min-width: 92px; margin: 0; padding: 8px; list-style: none;
    background: #151515;
    border: 1px solid #2d2d2d; border-radius: 14px;
    box-shadow: 0 14px 30px rgba(0, 0, 0, .8);
    z-index: 1000;
}
.language-selector:hover .lang-dropdown { display: block; animation: slideDownFade .25s ease forwards; }
.lang-dropdown li a {
    display: block; text-align: center;
    padding: 8px 12px; border-radius: 8px;
    color: #aaa; text-decoration: none; font-size: 13px; font-weight: 600;
    transition: all .2s ease;
}
.lang-dropdown li a:hover { background: var(--gradient-brand); color: #fff; }

/* ---------- Mega menu ---------- */
.mega-dropdown { position: static; }
.mega-menu {
    position: absolute; top: 100%; left: 0; width: 100%;
    padding: 34px 40px 40px;
    background: linear-gradient(135deg, #0d0d0d 0%, #1a0b2e 100%);
    border-bottom: 1px solid var(--nav-border);
    box-shadow: 0 30px 50px rgba(0, 0, 0, .7);
    z-index: 1055;
    opacity: 0; visibility: hidden; pointer-events: none;
    transform: translateY(10px);
    transition: opacity .25s ease, transform .25s ease, visibility .25s ease;
}
.mega-dropdown:hover .mega-menu,
.mega-dropdown:focus-within .mega-menu {
    opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0);
}
.mega-inner { max-width: 1440px; margin: 0 auto; }
.mega-title {
    display: flex; align-items: center; gap: 10px;
    margin: 0 0 18px; color: #fff; font-size: .8rem; font-weight: 700;
    letter-spacing: .16em; text-transform: uppercase;
}
.mega-title::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(168,85,247,.5), transparent); }
.mega-menu .mega-link {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; border-radius: 12px;
    color: #d1d5db; text-decoration: none; font-weight: 500;
    background: rgba(255, 255, 255, .03);
    border: 1px solid rgba(255, 255, 255, .06);
    transition: all .25s ease;
}
.mega-menu .mega-link i { font-size: 11px; color: var(--brand-primary-light); transition: transform .25s ease; }
.mega-menu .mega-link:hover {
    color: #fff; background: rgba(126, 34, 206, .22);
    border-color: var(--brand-primary-light); transform: translateY(-2px);
}
.mega-menu .mega-link:hover i { transform: translateX(4px); color: #fff; }

/* ---------- Mobile ---------- */
.mobile-actions { align-items: center; gap: 12px; }

.language-selector-mobile {
    position: relative; cursor: pointer;
    color: #fff; font-size: 13px; font-weight: 700;
    padding: 9px 13px;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 10px;
}
.lang-dropdown-mobile {
    display: none; position: absolute; top: 120%; right: 0;
    min-width: 84px; margin: 0; padding: 8px; list-style: none;
    background: #1a1a1a; border: 1px solid #333; border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, .8); z-index: 1060;
}
.lang-dropdown-mobile.show { display: block; animation: slideDownFade .25s ease forwards; }
.lang-dropdown-mobile li a {
    display: block; text-align: center; padding: 8px 12px; border-radius: 8px;
    color: #ccc; text-decoration: none;
}
.lang-dropdown-mobile li a:hover { background: var(--brand-primary); color: #fff; }

.navbar-toggler {
    width: 46px; height: 46px; border-radius: 12px;
    display: grid; place-items: center;
    color: #fff; font-size: 20px;
    background: var(--gradient-brand);
    border: 0; box-shadow: var(--shadow-brand);
}

/* Off-canvas */
.mobile-menu {
    position: fixed; top: 0; right: -110%;
    width: min(330px, 88vw); height: 100vh;
    display: flex; flex-direction: column;
    background: linear-gradient(180deg, #0a0a0a 0%, #1a0b2e 100%);
    box-shadow: -10px 0 40px rgba(0, 0, 0, .8);
    z-index: 2000;
    transition: right .4s cubic-bezier(.77, 0, .175, 1);
}
.mobile-menu.active { right: 0; }
.mobile-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.mobile-header .brand-logo { height: 56px; width: 56px; }
.mobile-menu .close-btn {
    width: 40px; height: 40px; display: grid; place-items: center;
    font-size: 26px; color: #fff; cursor: pointer; border-radius: 50%;
    background: rgba(255, 255, 255, .07);
}
.mobile-menu .menu-links { display: flex; flex-direction: column; gap: 6px; padding: 20px; overflow-y: auto; }
.mobile-menu .menu-links > a {
    display: flex; align-items: center; gap: 12px;
    padding: 13px 14px; border-radius: 12px;
    color: #fff; font-size: 16px; font-weight: 500; text-decoration: none;
    transition: background .2s ease;
}
.mobile-menu .menu-links > a .m-icon {
    width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px;
    background: rgba(126, 34, 206, .25); color: var(--brand-primary-light); font-size: 14px;
}
.mobile-menu .menu-links > a:hover { background: rgba(126, 34, 206, .2); }
.mobile-menu .search-container form { width: 100%; background: rgba(255, 255, 255, .06); }
.mobile-menu .search-container input { width: 100%; }
.mobile-menu .search-container form:focus-within input { width: 100%; }
.mobile-footer {
    margin-top: auto; padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, .08);
    background: rgba(0, 0, 0, .3);
}
.mobile-footer .social-icons { justify-content: center; }

/* Categories modal */
.modal-body { background: #0a0a0a; color: #fff; }
.modal-body a {
    display: block; padding: 12px 15px; color: #ccc; text-decoration: none;
    border-bottom: 1px solid #222; transition: all .2s ease;
}
.modal-body a:hover { background: rgba(126, 34, 206, .2); color: #fff; padding-left: 20px; }

/* ---------- Breakpoints ---------- */
@media (max-width: 1199px) {
    .brand-text { display: none; }
    .search-container input, .search-container form:focus-within input { width: 130px; }
    .social-icons { display: none; }
}
@media (max-width: 991px) {
    :root { --nav-h: 76px; --nav-h-scrolled: 70px; --logo-size: 56px; }
    .header-container { padding: 0 16px; }
    .header-container.scrolled .brand-logo { height: 52px; width: 52px; }
}

.no-scroll { overflow: hidden; }

@keyframes slideDownFade {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }