/* ========================================
   RASTI - Navbar Styles
   ======================================== */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.navbar-content {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--navbar-height);
    position: relative;
}

/* Hamburger Menu Button */
.hamburger-btn {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    z-index: 1001;
    margin-left: auto;
}

.navbar button[type="button"],
.navbar button[type="reset"],
.navbar button[type="submit"] {
    margin-bottom: 0;
}

.hamburger-line {
    width: 22px;
    height: 2px;
    background-color: var(--gray-800);
    transition: all 0.3s ease;
    border-radius: 2px;
    transform-origin: center;
}

.hamburger-btn.active .hamburger-line:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

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

.hamburger-btn.active .hamburger-line:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* Mobile Menu - Two Column Layout */
.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: min(80vw, 320px);
    height: 100vh;
    background: var(--white);
    border-right: 1px solid var(--gray-200);
    box-shadow: 12px 0 24px rgba(0, 0, 0, 0.12);
    z-index: 1100;
    padding: 1rem 1rem 1.25rem;
    overflow-y: auto;

    /* Hidden state */
    display: flex;
    flex-direction: column;
    gap: 0.75rem;

    /* Animation */
    opacity: 0;
    transform: translateX(-100%);
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}

.mobile-menu.active {
    opacity: 1;
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
}

.mobile-menu-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    z-index: 1090;
}

.mobile-menu-backdrop.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--gray-200);
}

.mobile-menu-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    justify-content: flex-start;
    margin: 0;
    text-align: left;
}

.mobile-menu-logo img {
    height: 26px;
    width: auto;
}

.mobile-menu-logo .brand-text {
    font-size: 1.05rem;
    letter-spacing: 0.04em;
}

.mobile-menu-title {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--gray-500);
}

.mobile-menu-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid var(--gray-200);
    background: var(--gray-50);
    color: var(--gray-700);
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.mobile-menu-close:hover {
    background: var(--gray-100);
    color: var(--gray-900);
    border-color: var(--gray-300);
}

.nav-link-mobile {
    display: flex;
    align-items: center;
    padding: 0.6rem 0.85rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gray-700);
    text-align: left;
    border-radius: 12px;
    transition: all 0.2s ease;
    background: var(--gray-50);
    border: 1px solid var(--gray-100);
}

.nav-link-mobile:hover {
    background: var(--gray-100);
    color: var(--primary);
    border-color: var(--gray-200);
}

/* Desktop Links Container */
.nav-links-desktop {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-auth-mobile {
    display: none;
    align-items: center;
}

.nav-auth-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.user-avatar-nav {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--white);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: none;
    position: relative;
    overflow: visible;
}

.user-avatar-nav:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.admin-indicator {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #16a34a;
    color: white;
    font-size: 0.55rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    line-height: 1;
}

.nav-auth-mobile-btn {
    padding: 0.3rem 0.55rem !important;
    font-size: 0.75rem !important;
    line-height: 1 !important;
    min-height: 30px;
    white-space: nowrap;
    border-radius: 10px;
    border-width: 1px;
    box-shadow: none !important;
}

.user-avatar-guest {
    background: var(--primary);
    color: var(--white);
    border: none;
    box-shadow: none;
}

.user-avatar-guest svg {
    width: 18px;
    height: 18px;
}

/* Social Media Links */
.nav-social-links {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: var(--white);
    border: 2px solid var(--primary);
    color: var(--primary);
    transition: all 0.3s ease;
}

.nav-social-link svg {
    width: 16px;
    height: 16px;
}

.nav-social-link:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
}

.nav-social-header {
    align-items: center;
    margin-right: 1rem;
}

.nav-social-header.expand-social-links {
    margin-top: 0;
}

/* Responsive Breakpoints */
@media (max-width: 768px) {
    :root {
        --navbar-height: 96px;
    }

    .navbar {
        border-bottom: none;
        box-shadow: none;
    }

    .navbar-content {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        grid-template-rows: 56px 40px;
        align-items: center;
        gap: 0;
        height: var(--navbar-height);
    }

    .hamburger-btn {
        display: flex;
        margin-left: 0;
        justify-self: start;
        align-items: center;
        justify-content: center;
        order: 0;
        grid-column: 1;
        grid-row: 1;
        z-index: 1002;
        padding: 0.35rem;
        width: 36px;
        height: 36px;
        align-self: center;
    }

    .nav-links-desktop {
        display: none;
    }

    .nav-center {
        display: none !important;
    }

    /* Hide desktop color theme dropdown on mobile */
    .color-menu-desktop {
        display: none;
    }

    .navbar-content {
        padding: 0 1rem;
    }

    .logo {
        justify-self: center;
        margin: 0 auto;
        grid-column: 2;
        grid-row: 1;
        gap: 0.4rem;
        height: 100%;
        align-self: center;
    }

    .mobile-menu-header .mobile-menu-logo {
        margin: 0;
        justify-content: flex-start;
    }

    .nav-actions {
        justify-self: end;
        margin-left: 0;
        grid-column: 3;
        grid-row: 1;
        justify-content: flex-end;
        min-width: 44px;
        height: 100%;
        align-self: center;
    }

    .nav-social-header {
        grid-column: 1 / -1;
        grid-row: 2;
        justify-content: center;
        justify-self: center;
        margin: 0;
    }

    .nav-center {
        grid-column: 2;
        grid-row: 1;
    }

    .nav-auth-mobile {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        min-width: 36px;
        height: 100%;
    }

    .nav-auth-link {
        height: 100%;
    }

    .nav-auth-mobile .user-avatar-nav {
        width: 32px;
        height: 32px;
        font-size: 0.75rem;
    }

    .logo img {
        height: 26px;
    }

    .brand-text {
        font-size: 1.05rem;
        letter-spacing: 0.04em;
        line-height: 1;
    }

    .nav-actions {
        gap: 0.5rem;
    }

    /* Mobile Navigation Column */
    .mobile-nav-column {
        display: flex;
        flex-direction: column;
        gap: 0.4rem;
    }

    .mobile-cta-btn {
        margin-top: 0.125rem;
        text-align: center;
        padding: 0.6rem 0.85rem !important;
        font-size: 0.9rem !important;
        border-radius: 12px !important;
        box-shadow: none !important;
        width: 100%;
    }

    /* Mobile Theme Column */
    .mobile-theme-column {
        display: none;
    }

    .mobile-theme-label {
        display: block;
        font-size: 0.65rem;
        font-weight: 600;
        color: var(--gray-500);
        text-transform: uppercase;
        letter-spacing: 0.05em;
        margin-bottom: 0.25rem;
    }

    .mobile-theme-column .theme-toggle-wrapper {
        padding: 0;
        border: none;
    }

    .color-swatches-mobile {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.4rem;
    }

    .color-swatches-mobile .color-swatch {
        width: 28px;
        height: 28px;
        border-radius: 4px;
    }
}

/* Logo Section */
.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo img {
    height: 36px;
    width: auto;
}

.brand-text {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* Navigation Links */
.nav-center {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex: 1 1 auto;
    justify-content: center;
    min-width: 0;
}

/* Dropdown Wrapper */
.nav-dropdown-wrapper {
    position: relative;
}

.nav-link-dropdown::after {
    content: ' ▾';
    font-size: 0.7em;
    opacity: 0.7;
    transition: transform 0.2s ease;
}

.navbar.expanded .nav-link-dropdown::after {
    transform: rotate(180deg);
}

/* Expandable Secondary Navbar */
.expand-navbar {
    max-height: 0;
    overflow: hidden;
    background: var(--white);
    transition: max-height 0.15s ease-out, padding 0.15s ease-out;
}

.navbar.expanded .expand-navbar {
    max-height: 200px;
    padding: 1.5rem 0;
}

/* Hide main navbar border when expanded */
.navbar.expanded .navbar-content {
    border-bottom: none;
}

.navbar.expanded {
    border-bottom: none;
}

.expand-nav-content {
    display: flex;
    justify-content: center;
    gap: 3rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.expand-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    text-align: center;
    text-decoration: none;
    min-width: 120px;
    transition: transform 0.15s ease;
}

.expand-nav-item:hover {
    transform: translateY(-2px);
}

.expand-nav-item:hover .expand-item-text {
    color: var(--primary);
}

.expand-nav-item:hover .expand-item-desc {
    color: var(--gray-700);
}

.expand-nav-item svg {
    width: 24px;
    height: 24px;
    color: var(--primary);
    stroke-width: 1.5;
}

.expand-item-text {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--gray-800);
    transition: color 0.15s ease;
}

.expand-item-desc {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin: 0;
    transition: color 0.15s ease;
}

/* Social section with links */
.expand-social-item {
    gap: 0.35rem;
}

.expand-social-links {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.expand-social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--gray-50);
    border: 1.5px solid var(--gray-300);
    transition: all 0.3s ease;
}

.expand-social-link:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
}

.expand-social-link:hover svg {
    fill: var(--white);
}

.expand-social-link svg {
    width: 16px;
    height: 16px;
    fill: var(--gray-600);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--gray-700);
    position: relative;
    transition: color 0.3s ease;
    padding-bottom: 0.25rem;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), color-mix(in srgb, var(--primary) 60%, transparent));
    transition: width 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link:hover {
    color: var(--primary);
}

.nav-link:hover::after {
    width: 100%;
}

/* Highlighted Nav Link (CTA style) */
.nav-link-highlight {
    background: var(--primary);
    color: var(--white) !important;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(31, 82, 158, 0.25);
}

.nav-link-highlight:hover,
.nav-link-highlight:focus {
    background: #7ee8e8;
    color: #000 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(126, 232, 232, 0.4);
}

.nav-link-highlight::after {
    display: none;
}

/* Keep Descubre hover active when navbar is expanded */
.navbar.expanded #discoverToggle {
    color: var(--primary);
}

.navbar.expanded #discoverToggle::after {
    width: 100%;
}

.nav-link-dropdown::after {
    content: ' ▾';
    position: static;
    background: none;
    width: auto;
    height: auto;
    font-size: 0.7em;
    opacity: 0.7;
}

.nav-icon {
    font-size: 1rem;
}

/* Mobile Menu Divider */
.mobile-menu-divider {
    border: none;
    border-top: 1px solid var(--gray-200);
    margin: 0.75rem 0;
}

/* Right Actions */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* Color Theme Dropdown */
.color-menu-wrapper {
    position: relative;
}

.color-theme-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: none;
    cursor: pointer;
    padding: 0.4rem;
    border-radius: 6px;
    width: 34px;
    height: 34px;
    transition: all 0.3s ease;
    color: var(--primary);
    display: none;
}

.color-theme-btn:hover,
.color-menu-wrapper:hover .color-theme-btn {
    background-color: var(--primary);
    color: white;
    transform: scale(1.05);
}

.color-theme-btn svg {
    width: 18px;
    height: 18px;
}

.color-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

@media (max-width: 768px) {
    .nav-center {
        display: none;
    }
}

.color-menu-wrapper:hover .color-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Dark/Light Mode Toggle */
.theme-toggle-wrapper {
    display: flex;
    justify-content: center;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.theme-toggle-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    position: relative;
}

.theme-toggle-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.theme-icon {
    color: var(--gray-400);
    flex-shrink: 0;
    transition: color 0.3s;
}

/* Light mode (unchecked) - sun is primary */
.theme-toggle-label:has(.theme-toggle-input:not(:checked)) .sun-icon {
    color: var(--primary);
}

.theme-toggle-label:has(.theme-toggle-input:not(:checked)) .moon-icon {
    color: var(--gray-400);
}

/* Dark mode (checked) - moon is primary */
.theme-toggle-label:has(.theme-toggle-input:checked) .sun-icon {
    color: var(--gray-400);
}

.theme-toggle-label:has(.theme-toggle-input:checked) .moon-icon {
    color: var(--primary);
}

.theme-toggle-slider {
    width: 44px;
    height: 22px;
    background: var(--gray-200);
    border-radius: 11px;
    position: relative;
    transition: background-color 0.3s;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.theme-toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.theme-toggle-input:checked+.theme-toggle-slider {
    background: var(--primary);
}

.theme-toggle-input:checked+.theme-toggle-slider::before {
    transform: translateX(22px);
}

/* Color Swatches Grid */
.color-swatches-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    justify-items: center;
}

.color-swatch {
    width: 35px;
    height: 35px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.color-swatch:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

@media (max-width: 768px) {
    .nav-center,
    .nav-links-desktop {
        display: none !important;
    }

    .nav-auth-mobile-btn {
        width: auto !important;
    }
}


/* Mobile phones only - social links inline */
@media (max-width: 480px) {
    :root {
        --navbar-height: 56px;
    }

    .navbar-content {
        grid-template-columns: auto 1fr auto auto;
        grid-template-rows: 56px;
        gap: 0;
    }

    .hamburger-btn {
        grid-column: 1;
        grid-row: 1;
    }

    .logo {
        grid-column: 2;
        grid-row: 1;
        justify-self: center;
    }

    .nav-social-header {
        grid-column: 3;
        grid-row: 1;
        margin: 0;
        padding: 0;
    }

    .nav-social-header.expand-social-links {
        gap: 0.1rem;
    }

    .nav-social-header .expand-social-link {
        width: 28px;
        height: 28px;
        border-radius: 6px;
    }

    .nav-social-header .expand-social-link svg {
        width: 14px;
        height: 14px;
    }

    .nav-actions {
        grid-column: 4;
        grid-row: 1;
        margin-left: 0.25rem;
    }
}