/**
 * GniYes Nav Menu — shadcn NavigationMenu-style widget
 *
 * Sections:
 *   1. Desktop Nav Bar
 *   2. Viewport Dropdown
 *   3. Mobile Visibility Toggle
 *   4. Mobile Hamburger
 *   5. Mobile Sheet
 *   6. Mobile Sheet Footer
 *   7. Placeholder
 */

/* ==========================================================================
   1. Desktop Nav Bar
   ========================================================================== */

.gniyes-nm-wrapper { position: relative; width: 100%; }
.gniyes-nm-nav { position: relative; z-index: 100; width: 100%; }
.gniyes-nm-list { display: flex; align-items: center; gap: 2px; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; width: 100%; }
.gniyes-nm-item { position: relative; margin: 0; padding: 0; }

/* Stretch alignment — items fill the bar equally (left/center/right handled by Elementor selectors) */
.gniyes-nm-align-stretch .gniyes-nm-item { flex: 1 1 0; text-align: center; }
.gniyes-nm-align-stretch .gniyes-nm-trigger,
.gniyes-nm-align-stretch .gniyes-nm-link { width: 100%; justify-content: center; }

/* Trigger button (has children) */
.gniyes-nm-trigger {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 14px; border-radius: 8px;
    background: transparent; border: none; cursor: pointer;
    font-family: 'Manrope', sans-serif; font-weight: 600; font-size: 0.875rem;
    color: #374151; transition: background 200ms, color 200ms;
    line-height: 1.4; white-space: nowrap;
}
.gniyes-nm-trigger:hover, .gniyes-nm-trigger[data-state="open"] {
    background: rgba(0, 64, 174, 0.08); color: #0040ae;
}

/* Direct link (no children) */
.gniyes-nm-link {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 14px; border-radius: 8px;
    text-decoration: none;
    font-family: 'Manrope', sans-serif; font-weight: 600; font-size: 0.875rem;
    color: #374151; transition: background 200ms, color 200ms;
    line-height: 1.4; white-space: nowrap;
}
.gniyes-nm-link:hover { background: rgba(0, 64, 174, 0.08); color: #0040ae; }

/* Chevron */
.gniyes-nm-chevron {
    width: 12px; height: 12px; flex-shrink: 0;
    transition: transform 200ms ease;
}
.gniyes-nm-trigger[data-state="open"] .gniyes-nm-chevron {
    transform: rotate(180deg);
}

/* Icon */
.gniyes-nm-icon {
    font-size: 20px; flex-shrink: 0; line-height: 1;
    color: #6b7280; transition: color 200ms;
}
.gniyes-nm-trigger:hover .gniyes-nm-icon,
.gniyes-nm-trigger[data-state="open"] .gniyes-nm-icon,
.gniyes-nm-link:hover .gniyes-nm-icon {
    color: #0040ae;
}

/* ==========================================================================
   2. Viewport Dropdown
   ========================================================================== */

/* Viewport wrapper — positioned below the active trigger */
.gniyes-nm-viewport-wrapper {
    position: absolute; top: 100%; left: 0;
    perspective: 2000px;
    z-index: 99;
    pointer-events: none;
    /* left is set dynamically by JS based on active trigger position */
}
.gniyes-nm-viewport-wrapper[data-state="open"] { pointer-events: auto; }

/* Viewport container — morphs width/height with zoom animation */
.gniyes-nm-viewport {
    position: relative; overflow: hidden;
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 12px;
    box-shadow: 0 10px 38px -10px rgba(0,0,0,0.12), 0 10px 20px -15px rgba(0,0,0,0.06);
    transition: width 250ms ease, height 250ms ease, opacity 200ms ease, transform 200ms ease;
    transform-origin: top center;
    opacity: 0;
    transform: scale(0.9);
    width: 0; height: 0;
}
/* Open: zoom in from 90% → 100% */
.gniyes-nm-viewport-wrapper[data-state="open"] .gniyes-nm-viewport {
    opacity: 1;
    transform: scale(1);
}
/* Close: zoom out to 95% (handled by transition back to default) */

/* Content panels — auto-width based on content */
.gniyes-nm-content {
    position: absolute; top: 0; left: 0;
    width: max-content;
    min-width: 200px;
    padding: 16px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms ease, transform 200ms ease;
}
.gniyes-nm-content[data-state="open"] {
    opacity: 1; pointer-events: auto; position: relative;
}

/* Content panel transition — simple fade (no slide) */

/* Sub-list (standard mode) */
.gniyes-nm-sub-list {
    list-style: none; margin: 0; padding: 0;
    display: flex; flex-direction: column; gap: 2px;
}

/* Sub-list (featured mode) — grid */
.gniyes-nm-sub-list.gniyes-nm-featured {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px;
}

/* Sub-item link */
.gniyes-nm-sub-link {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 10px 12px; border-radius: 8px;
    text-decoration: none; color: #374151;
    transition: background 150ms;
    white-space: nowrap;
}
.gniyes-nm-sub-link:hover {
    background: #f5f7fa;
}
.gniyes-nm-sub-link .gniyes-nm-icon {
    margin-top: 2px; color: #6b7280;
}
.gniyes-nm-sub-link:hover .gniyes-nm-icon {
    color: #0040ae;
}

/* Sub-item text */
.gniyes-nm-sub-text { flex: 1; min-width: 0; }
.gniyes-nm-sub-title {
    display: block;
    font-family: 'Manrope', sans-serif; font-weight: 600; font-size: 0.875rem;
    color: #1f2937; line-height: 1.4;
}
.gniyes-nm-sub-desc {
    display: block; margin-top: 2px;
    font-family: 'Inter', sans-serif; font-size: 0.8125rem; font-weight: 400;
    color: #6b7280; line-height: 1.4;
}

/* ==========================================================================
   3. Mobile — Visibility Toggle
   ========================================================================== */

/* Default: desktop visible, mobile hidden */
.gniyes-nm-desktop { display: flex; }
.gniyes-nm-mobile { display: none; }

@media (max-width: 1023px) {
    .gniyes-nm-desktop { display: none !important; }
    .gniyes-nm-mobile { display: flex !important; }
}

/* ==========================================================================
   4. Mobile Hamburger
   ========================================================================== */

.gniyes-nm-hamburger {
    display: flex; align-items: center; justify-content: center;
    background: transparent; border: none; cursor: pointer;
    padding: 8px; border-radius: 8px;
    color: #374151; transition: background 150ms;
}
.gniyes-nm-hamburger:hover { background: rgba(0,0,0,0.05); }
.gniyes-nm-hamburger .material-symbols-outlined { font-size: 24px; }

/* ==========================================================================
   5. Mobile Sheet
   ========================================================================== */

/* Sheet overlay */
.gniyes-nm-sheet {
    position: fixed; inset: 0; z-index: 99999;
    pointer-events: none;
}
.gniyes-nm-sheet[data-open="true"] { pointer-events: auto; }

/* Backdrop */
.gniyes-nm-sheet-backdrop {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0);
    transition: background 200ms ease;
}
.gniyes-nm-sheet[data-open="true"] .gniyes-nm-sheet-backdrop {
    background: rgba(0, 0, 0, 0.5);
}

/* Panel */
.gniyes-nm-sheet-panel {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: 320px; max-width: 85vw;
    background: #ffffff;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
    transform: translateX(-100%);
    transition: transform 300ms cubic-bezier(0.32, 0.72, 0, 1);
    display: flex; flex-direction: column;
    overflow: hidden;
}
.gniyes-nm-sheet[data-open="true"] .gniyes-nm-sheet-panel {
    transform: translateX(0);
}

/* Sheet header */
.gniyes-nm-sheet-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #f3f4f6;
    flex-shrink: 0;
}
.gniyes-nm-sheet-logo {
    font-family: 'Manrope', sans-serif; font-weight: 800; font-size: 1.125rem;
    color: #111827; letter-spacing: -0.02em;
}
.gniyes-nm-sheet-close {
    display: flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 50%;
    background: transparent; border: none; cursor: pointer;
    color: #6b7280; transition: background 150ms, color 150ms;
}
.gniyes-nm-sheet-close:hover { background: #f3f4f6; color: #111827; }
.gniyes-nm-sheet-close .material-symbols-outlined { font-size: 20px; }

/* Sheet body — scrollable */
.gniyes-nm-sheet-body {
    flex: 1; overflow-y: auto; padding: 8px 24px;
    -webkit-overflow-scrolling: touch;
}

/* Sheet menu list */
.gniyes-nm-sheet-menu {
    list-style: none; margin: 0; padding: 0;
}

/* Sheet item */
.gniyes-nm-sheet-item {
    border-bottom: 1px solid #f3f4f6;
}
.gniyes-nm-sheet-item:last-child { border-bottom: none; }

/* Sheet trigger (parent with children) */
.gniyes-nm-sheet-trigger {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%; padding: 16px 0;
    background: transparent; border: none; cursor: pointer;
    font-family: 'Manrope', sans-serif; font-size: 1rem; font-weight: 500;
    color: #1f2937; text-align: left;
    gap: 8px;
}
.gniyes-nm-sheet-trigger:hover { color: #0040ae; }
.gniyes-nm-sheet-trigger .gniyes-nm-chevron {
    transition: transform 250ms ease; flex-shrink: 0;
}
.gniyes-nm-sheet-trigger[data-expanded="true"] .gniyes-nm-chevron {
    transform: rotate(90deg);
}
.gniyes-nm-sheet-trigger .gniyes-nm-icon {
    font-size: 22px; color: #6b7280;
}

/* Sheet direct link (no children) */
.gniyes-nm-sheet-link {
    display: flex; align-items: center; gap: 8px;
    padding: 16px 0;
    font-family: 'Manrope', sans-serif; font-size: 1rem; font-weight: 500;
    color: #1f2937; text-decoration: none;
}
.gniyes-nm-sheet-link:hover { color: #0040ae; }
.gniyes-nm-sheet-link .gniyes-nm-icon {
    font-size: 22px; color: #6b7280;
}

/* Sheet accordion children */
.gniyes-nm-sheet-children {
    max-height: 0; overflow: hidden;
    transition: max-height 250ms ease;
}
.gniyes-nm-sheet-children[data-expanded="true"] {
    /* max-height set by JS based on scrollHeight */
}

/* Sheet child link */
.gniyes-nm-sheet-child-link {
    display: flex; align-items: center; gap: 8px;
    padding: 12px 0 12px 16px;
    font-family: 'Inter', sans-serif; font-size: 0.9375rem; font-weight: 400;
    color: #4b5563; text-decoration: none;
    transition: color 150ms;
}
.gniyes-nm-sheet-child-link:hover { color: #0040ae; }
.gniyes-nm-sheet-child-link .gniyes-nm-icon {
    font-size: 18px; color: #9ca3af;
}

/* ==========================================================================
   6. Mobile Sheet Footer (Buttons)
   ========================================================================== */

.gniyes-nm-sheet-footer {
    padding: 16px 24px;
    border-top: 1px solid #f3f4f6;
    display: flex; flex-direction: column; gap: 8px;
    flex-shrink: 0;
}
.gniyes-nm-sheet-btn {
    display: block; width: 100%; text-align: center;
    padding: 14px 20px; border-radius: 9999px;
    font-family: 'Manrope', sans-serif; font-weight: 700; font-size: 0.9375rem;
    text-decoration: none; transition: all 200ms;
    box-sizing: border-box;
}
/* First button: filled primary */
.gniyes-nm-sheet-btn:first-child {
    background: #0040ae; color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 64, 174, 0.2);
}
.gniyes-nm-sheet-btn:first-child:hover {
    background: #0856de;
    box-shadow: 0 6px 16px rgba(0, 64, 174, 0.3);
}
/* Subsequent buttons: outlined */
.gniyes-nm-sheet-btn:not(:first-child) {
    background: transparent; color: #0040ae;
    border: 2px solid #0040ae;
}
.gniyes-nm-sheet-btn:not(:first-child):hover {
    background: rgba(0, 64, 174, 0.05);
}

/* ==========================================================================
   7. Placeholder
   ========================================================================== */

.gniyes-nm-placeholder {
    font-family: 'Inter', sans-serif; font-size: 14px;
    color: #9ca3af; text-align: center; padding: 20px;
}
