/* =========================================
   NAVIGATION.CSS - Menú Dinàmic Glassmorphism
   Projecte Share Theme
========================================= */

/* Main container */
.nav-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 30px 5%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Inner content wrapper */
.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    width: 100%;
    max-width: 1300px;
    transition: all 0.5s ease;
}

/* Link groups */
.nav-group {
    display: flex;
    gap: 20px;
    flex-wrap: nowrap;
    align-items: center;
}

.nav-group.left {
    justify-content: flex-end;
    padding-right: 20px;
}

.nav-group.right {
    justify-content: flex-start;
    padding-left: 20px;
}

/* Ensure WordPress UL uses flex layout */
.nav-group ul {
    display: flex;
    gap: 20px;
    margin: 0;
    padding: 0;
    list-style: none;
    align-items: center;
    flex-wrap: nowrap;
}

/* Ensure Logo takes exact space */

/* Logo */
.nav-logo {
    text-align: center;
    text-decoration: none;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.nav-logo h1 {
    font-size: 1.8rem;
    font-weight: 800;
    color: #ffffff;
    transition: all 0.4s ease;
    white-space: nowrap;
    margin: 0;
}

.nav-logo span {
    color: var(--pshare-primary, #E32219);
}

.nav-logo-img {
    height: 45px;
    width: auto;
    transition: all 0.4s ease;
}

/* Links */
.nav-links a {
    text-decoration: none;
    color: #ffffff;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    position: relative;
    white-space: nowrap;
}

.nav-links a:not(.nav-btn)::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--pshare-primary, #E32219);
    transition: width 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.nav-links a.nav-btn {
    color: var(--pshare-primary, #E32219) !important;
    font-weight: 700;
}

/* =========================================
   SCROLLED STATE / SOLID STATE
========================================= */
.nav-container.scrolled,
.nav-container.force-solid {
    padding: 15px 5%;
}

.nav-container.scrolled .nav-content,
.nav-container.force-solid .nav-content {
    background: rgba(255, 255, 255, var(--pshare-nav-bg-opacity, 0.85));
    backdrop-filter: blur(var(--pshare-nav-blur, 15px));
    -webkit-backdrop-filter: blur(var(--pshare-nav-blur, 15px));
    padding: 12px 40px;
    border-radius: var(--pshare-nav-radius, 100px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    max-width: 1100px;
}

.nav-container.scrolled .nav-logo h1,
.nav-container.scrolled .nav-links a:not(.nav-btn),
.nav-container.force-solid .nav-logo h1,
.nav-container.force-solid .nav-links a:not(.nav-btn) {
    color: var(--pshare-dark, #1E2022);
}

.nav-container.scrolled .nav-logo-img,
.nav-container.force-solid .nav-logo-img {
    height: 35px;
}

/* No hero pages - always scrolled look */
body:not(.has-hero) .nav-container {
    padding: 15px 5%;
}

body:not(.has-hero) .nav-content {
    background: rgba(255, 255, 255, var(--pshare-nav-bg-opacity, 0.85));
    backdrop-filter: blur(var(--pshare-nav-blur, 15px));
    -webkit-backdrop-filter: blur(var(--pshare-nav-blur, 15px));
    padding: 12px 40px;
    border-radius: var(--pshare-nav-radius, 100px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    max-width: 1100px;
}

body:not(.has-hero) .nav-logo h1,
body:not(.has-hero) .nav-links a:not(.nav-btn) {
    color: var(--pshare-dark, #1E2022);
}

/* =========================================
   HAMBURGER MENU BUTTON
========================================= */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1100;
    padding: 8px;
}

.hamburger-line {
    display: block;
    width: 24px;
    height: 2px;
    background: #ffffff;
    border-radius: 2px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

.nav-container.scrolled .hamburger-line,
.nav-container.force-solid .hamburger-line,
body:not(.has-hero) .hamburger-line {
    background: var(--pshare-dark, #1E2022);
}

/* Hamburger animation - open state */
.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
    background: #ffffff;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
    background: #ffffff;
}

/* =========================================
   MOBILE MENU OVERLAY
========================================= */
.mobile-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(30, 32, 34, 0.97);
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(20px);
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-content {
    text-align: center;
    transform: translateY(30px);
    opacity: 0;
    transition: all 0.5s ease 0.2s;
}

.mobile-menu-overlay.active .mobile-menu-content {
    transform: translateY(0);
    opacity: 1;
}

.mobile-menu-header {
    margin-bottom: 40px;
}

.mobile-logo {
    text-decoration: none;
}

.mobile-logo h2 {
    color: #ffffff;
    font-size: 2rem;
    font-weight: 800;
}

.mobile-logo span {
    color: var(--pshare-primary, #E32219);
}

/* Mobile nav links */
.mobile-links-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-links-list li {
    margin: 0;
}

.mobile-links-list a {
    display: block;
    padding: 15px 0;
    color: #ffffff;
    font-size: 1.4rem;
    font-weight: 600;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.3s ease;
    position: relative;
}

.mobile-links-list a:hover {
    color: var(--pshare-primary, #E32219);
    transform: translateX(10px);
}

.mobile-links-list .sub-menu {
    list-style: none;
    padding: 0;
}

.mobile-links-list .sub-menu a {
    font-size: 1rem;
    padding: 10px 0;
    color: rgba(255,255,255,0.6);
    letter-spacing: 1px;
}

.mobile-links-list .sub-menu a:hover {
    color: var(--pshare-primary);
}

/* Mobile menu footer */
.mobile-menu-footer {
    margin-top: 40px;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.mobile-social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.2);
    color: #ffffff;
    transition: all 0.3s ease;
}

.mobile-social-link:hover {
    background: var(--pshare-primary);
    border-color: var(--pshare-primary);
    transform: translateY(-3px);
    color: #ffffff;
}
