/**
 * BORGX - GLOBAL MENU STYLES
 * The app drawer mega menu (Google-style)
 * 
 * File: borgx/assets/css/borgx/gmenu.css
 */

/* ============================================
   TRIGGER BUTTON
   ============================================ */

.gmenu-trigger {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition-fast);
  color: var(--color-text);
  overflow: visible;
  background: none;
  border: none;
  padding: 0;
}

.gmenu-trigger:hover {
  background: var(--color-hover);
}

.gmenu-trigger:focus {
  outline: none;
  box-shadow: var(--focus-ring);
}

.gmenu-trigger .ph {
  font-size: 24px;
}

/* ============================================
   DROPDOWN CONTAINER
   ============================================ */

.gmenu-dropdown {
  position: absolute;
  top: calc(100% + var(--space-sm));
  right: 0;
  width: 340px;
  max-height: 70vh;
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-lg);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  z-index: 1000;
  
  /* Hidden by default */
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s ease;
  pointer-events: none;
}

.gmenu-trigger.active .gmenu-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

/* ============================================
   CONTENT
   ============================================ */

.gmenu-content {
  padding: var(--space-xs) var(--space-sm) var(--space-md);
}

.gmenu-section {
  background: var(--color-surface);
  border-radius: var(--radius-xl) var(--radius-xl) var(--radius-sm) var(--radius-sm);
  padding: var(--space-md) var(--space-sm);
  margin-bottom: var(--space-xs);
}

.gmenu-section:last-child {
  border-radius: var(--radius-sm) var(--radius-sm) var(--radius-xl) var(--radius-xl);
  margin-bottom: 0;
}

.gmenu-section:only-child {
  border-radius: var(--radius-xl);
}

/* ============================================
   GRID LAYOUT
   ============================================ */

.gmenu-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ============================================
   MENU ITEMS
   ============================================ */

.gmenu-item {
  list-style: none;
  margin: 0;
  padding: 0;
}

.gmenu-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-xs);
  text-align: center;
  text-decoration: none;
  color: var(--color-text);
  border-radius: var(--radius-md);
  transition: var(--transition-fast);
  min-height: 72px;
}

.gmenu-link:hover {
  background: var(--color-hover);
  transform: translateY(-2px);
  text-decoration: none;
  color: var(--color-text);
}

.gmenu-link:focus {
  outline: none;
  box-shadow: var(--focus-ring);
}

.gmenu-label {
  display: block;
  font-size: var(--typescale_label-small_size);
  line-height: var(--typescale_label-small_height);
  margin-top: var(--space-xs);
  font-weight: 500;
  color: var(--color-text);
}

/* ============================================
   ICON CONTAINER
   ============================================ */

.gmenu-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--brand-1) 0%, var(--brand-2) 100%);
  border-radius: var(--radius-md);
  color: var(--neutral-0);
}

.gmenu-icon .ph {
  font-size: 24px;
}

.gmenu-icon-image {
  background: var(--color-surface-raised);
  padding: var(--space-xs);
}

.gmenu-icon-image img {
  width: 32px;
  height: 32px;
  display: block;
  object-fit: contain;
}

/* ============================================
   SCROLLBAR STYLING
   ============================================ */

.gmenu-dropdown::-webkit-scrollbar {
  width: 8px;
}

.gmenu-dropdown::-webkit-scrollbar-track {
  background: transparent;
}

.gmenu-dropdown::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: var(--radius-full);
}

.gmenu-dropdown::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-muted);
}

/* ============================================
   SECTION LABELS
   ============================================ */

.gmenu-section-label {
  font-size: var(--typescale_label-small_size);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin: 0 0 var(--space-sm) 0;
  padding: 0 var(--space-xs);
}

/* Core section — slightly elevated background */
.gmenu-section-core {
  background: var(--color-surface-raised);
}

/* Core icon variant — orange/sunset gradient */
.gmenu-icon--core {
  background: linear-gradient(135deg, var(--brand-3) 0%, var(--brand-4) 100%);
}

/* Bottom section — rounded differently */
.gmenu-section-bottom {
  border-radius: var(--radius-sm) var(--radius-sm) var(--radius-xl) var(--radius-xl);
  margin-bottom: 0;
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  /* On mobile the dropdown must stay fully on-screen.
     The .gmenu-trigger is only 40px wide — the dropdown's
     right: 0 would bleed far off the left edge of the viewport.
     Switch to fixed positioning anchored to the viewport instead. */
  .gmenu-dropdown {
    position: fixed;
    top: 56px; /* below the mobile header */
    right: var(--space-sm);
    left: var(--space-sm);
    width: auto;
    max-width: 400px;
    max-height: 80vh;
  }
}

/* ============================================
   HEADER INTEGRATION
   ============================================ */

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}


