/**
 * fc-nav.css - Amazon-style Navigation for All Roles
 *
 * Navigation redesign that replaces the sidebar+header layout with:
 *   Desktop: Two-row top nav (primary bar + role-specific tabs)
 *   Mobile:  Bottom tab bar (retail only) + full-screen menu overlay
 *
 * Gated behind body.layout-topnav for all roles.
 * body.layout-retailer-v2 adds retail-specific CSS (mobile bottom tabs, cart).
 * Uses CSS custom properties from style.css for theme support.
 */

/* ==========================================================
   1. LAYOUT OVERRIDES - top nav (all roles)
   ========================================================== */

/* Desktop: hide sidebar, show top nav for all roles */
@media (min-width: 769px) {
  body.layout-topnav .sidebar {
    display: none !important;
  }

  body.layout-topnav .fc-header-bar {
    display: none !important;
  }

  body.layout-topnav .main-content {
    margin-left: 0 !important;
    margin-top: 88px;
    width: 100%;
    box-sizing: border-box;
  }

  /* Hide elements marked as desktop-hidden by JS */
  .fc-desktop-hidden {
    display: none !important;
  }
}

/* Mobile: retail hides sidebar + uses bottom tabs */
@media (max-width: 768px) {
  body.layout-retailer-v2 .sidebar {
    display: none !important;
  }

  body.layout-retailer-v2 .main-content {
    margin-top: 0;
    padding-bottom: calc(56px + env(safe-area-inset-bottom));
  }

  /* Non-retail roles: hide top nav on mobile, keep sidebar */
  body.layout-topnav:not(.layout-retailer-v2) .fc-topnav {
    display: none;
  }

  body.layout-topnav:not(.layout-retailer-v2) .sidebar {
    display: block !important;
  }

  body.layout-topnav:not(.layout-retailer-v2) .main-content {
    margin-left: 0 !important;
    margin-top: 0;
  }

  /* Show elements on mobile that are hidden on desktop */
  .fc-desktop-hidden {
    display: block !important;
  }
}

/* Tab badge styles */
.fc-topnav-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: var(--primary-red, #ff4b4b);
  border-radius: 9px;
  line-height: 1;
  vertical-align: middle;
}

/* ==========================================================
   2. MOBILE BOTTOM TAB BAR  (<=768px only)
   ========================================================== */

.fc-bottom-tabs {
  display: none;
}

@media (max-width: 768px) {
  .fc-bottom-tabs {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(56px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    z-index: var(--z-header);
    align-items: stretch;
  }

  .fc-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border: none;
    background: none;
    color: var(--text-light);
    text-decoration: none;
    cursor: pointer;
    padding: 6px 0;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.15s;
    font-family: inherit;
  }

  .fc-tab svg,
  .fc-tab-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
  }

  .fc-tab-label {
    font-size: 10px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
  }

  .fc-tab.active,
  .fc-tab[aria-current="page"] {
    color: var(--primary-red);
  }

  /* Cart badge on tab */
  .fc-tab-badge {
    position: absolute;
    top: 4px;
    right: 50%;
    transform: translateX(14px);
    background: var(--primary-red);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
  }

  .fc-tab-badge:empty {
    display: none;
  }
}

/* ==========================================================
   3. DESKTOP TWO-ROW TOP NAV  (>=769px only)
   ========================================================== */

.fc-topnav {
  display: none;
}

@media (min-width: 769px) {
  .fc-topnav {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--z-header);
  }

  /* ------- Row 1: Primary bar (48px) ------- */
  .fc-topnav-primary {
    height: 48px;
    background: #1a1a2e;
    color: #fff;
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 16px;
  }

  .fc-topnav-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #fff;
    flex-shrink: 0;
    margin-right: 8px;
  }

  .fc-topnav-logo-text {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--primary-red);
    letter-spacing: -0.01em;
  }

  .fc-topnav-logo:hover .fc-topnav-logo-text {
    opacity: 0.9;
  }

  .fc-topnav-welcome {
    display: block;
    font-size: 11px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.75);
    margin-top: -2px;
  }

  /* Spacer to push actions right */
  .fc-topnav-spacer {
    flex: 1;
  }

  /* Right actions group */
  .fc-topnav-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
  }

  .fc-topnav-action {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 6px;
    border: none;
    background: none;
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    position: relative;
    transition: background 0.15s;
    font-family: inherit;
    font-size: inherit;
    line-height: 1;
  }

  .fc-topnav-action:hover {
    background: rgba(255, 255, 255, 0.1);
  }

  .fc-topnav-action svg {
    width: 20px;
    height: 20px;
  }

  /* Notification/cart badge */
  .fc-topnav-badge {
    position: absolute;
    top: 1px;
    right: 1px;
    background: var(--primary-red);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    min-width: 15px;
    height: 15px;
    padding: 0 3px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
  }

  .fc-topnav-badge:empty {
    display: none;
  }

  /* Cart total text */
  .fc-topnav-cart-total {
    font-size: 0.8125rem;
    font-weight: 600;
    opacity: 0.9;
  }

  /* Avatar button */
  .fc-topnav-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    border: none;
    transition: background 0.15s;
    flex-shrink: 0;
  }

  .fc-topnav-avatar:hover {
    background: rgba(255, 255, 255, 0.25);
  }

  /* ------- Row 2: Category/links bar (40px) ------- */
  .fc-topnav-secondary {
    height: 40px;
    background: #141425;
    color: #fff;
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
  }

  .fc-topnav-link {
    display: flex;
    align-items: center;
    padding: 0 14px;
    height: 40px;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    transition:
      color 0.15s,
      background 0.15s;
    position: relative;
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
  }

  .fc-topnav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
  }

  .fc-topnav-link.active {
    color: #fff;
    box-shadow: inset 0 -2px 0 var(--primary-red);
  }

  /* ------- Mega Dropdown ------- */
  .fc-topnav-dropdown-wrap {
    position: relative;
  }

  .fc-mega-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 260px;
    background: var(--card-bg);
    color: var(--text-dark);
    border: 1px solid var(--border-color);
    border-radius: 0 0 8px 8px;
    box-shadow: var(--shadow-lg);
    padding: 8px 0;
    z-index: var(--z-dropdown);
  }

  /* Hover intent: show dropdown with slight delay */
  .fc-topnav-dropdown-wrap:hover .fc-mega-dropdown,
  .fc-mega-dropdown.active {
    display: block;
    animation: fcFadeIn 0.15s ease;
  }

  /* Invisible bridge so mouse can move from link to dropdown */
  .fc-topnav-dropdown-wrap::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 4px;
  }

  .fc-mega-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    color: var(--text-dark);
    text-decoration: none;
    font-size: 13px;
    transition: background 0.15s;
  }

  .fc-mega-dropdown-item:hover {
    background: var(--hover-bg);
  }

  .fc-mega-dropdown-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--text-light);
  }

  .fc-mega-dropdown-heading {
    padding: 6px 16px 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-light);
  }

  .fc-mega-dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 6px 0;
  }

  /* ------- Account Dropdown ------- */
  .fc-account-dropdown-wrap {
    position: relative;
  }

  .fc-account-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 200px;
    background: var(--card-bg);
    color: var(--text-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    padding: 6px 0;
    z-index: var(--z-dropdown);
  }

  .fc-account-dropdown.active {
    display: block;
    animation: fcFadeIn 0.15s ease;
  }

  .fc-account-dropdown-header {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-color);
  }

  .fc-account-dropdown-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
  }

  .fc-account-dropdown-role {
    font-size: 12px;
    color: var(--text-light);
  }

  .fc-account-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    color: var(--text-dark);
    text-decoration: none;
    font-size: 13px;
    transition: background 0.15s;
  }

  .fc-account-dropdown-item:hover {
    background: var(--hover-bg);
  }

  .fc-account-dropdown-item svg {
    width: 16px;
    height: 16px;
    color: var(--text-light);
  }

  .fc-account-dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
  }
}

/* ==========================================================
   4. SPOTLIGHT SEARCH
   ========================================================== */

/* Hide search bar for retailer users */
body.layout-retailer .fc-spotlight {
  display: none;
}

/* Search container - sits in primary row between logo and actions */
.fc-spotlight {
  position: relative;
  flex: 1;
  max-width: 560px;
}

@media (max-width: 768px) {
  .fc-spotlight {
    max-width: 100%;
  }
}

.fc-spotlight-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.fc-spotlight-icon {
  position: absolute;
  left: 12px;
  width: 16px;
  height: 16px;
  color: rgba(255, 255, 255, 0.5);
  pointer-events: none;
  transition: color 0.15s;
}

.fc-spotlight-input {
  width: 100%;
  height: 34px;
  padding: 0 40px 0 36px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition:
    background 0.2s,
    border-color 0.2s,
    box-shadow 0.2s;
}

.fc-spotlight-input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.fc-spotlight-input:focus {
  background: #fff;
  color: var(--text-dark);
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.2);
}

.fc-spotlight-input:focus::placeholder {
  color: var(--text-light);
}

.fc-spotlight-input:focus ~ .fc-spotlight-icon {
  color: var(--text-light);
}

/* Keyboard shortcut hint */
.fc-spotlight-kbd {
  position: absolute;
  right: 10px;
  display: flex;
  align-items: center;
  gap: 2px;
  pointer-events: none;
  opacity: 0.5;
  transition: opacity 0.15s;
}

.fc-spotlight-input:focus ~ .fc-spotlight-kbd {
  opacity: 0;
}

.fc-spotlight-kbd kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 4px;
  font-family: inherit;
  font-size: 10px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
}

/* ------- Search Results Dropdown ------- */
.fc-spotlight-results {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 480px;
  overflow-y: auto;
  background: var(--card-bg);
  color: var(--text-dark);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  z-index: var(--z-overlay);
  overscroll-behavior: contain;
}

.fc-spotlight-results.active {
  display: block;
  animation: fcFadeIn 0.12s ease;
}

.fc-spotlight-group-title {
  padding: 8px 14px 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-light);
}

.fc-spotlight-result {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  color: var(--text-dark);
  text-decoration: none;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.12s;
}

.fc-spotlight-result:hover,
.fc-spotlight-result.focused {
  background: var(--hover-bg);
}

.fc-spotlight-result-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--hover-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.fc-spotlight-result-icon svg {
  width: 16px;
  height: 16px;
  color: var(--text-light);
}

.fc-spotlight-result-text {
  flex: 1;
  min-width: 0;
}

.fc-spotlight-result-label {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fc-spotlight-result-secondary {
  font-size: 12px;
  color: var(--text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fc-spotlight-empty {
  padding: 24px 14px;
  text-align: center;
  color: var(--text-light);
  font-size: 13px;
}

.fc-spotlight-divider {
  height: 1px;
  background: var(--border-color);
  margin: 4px 0;
}

/* ==========================================================
   5. SUB-TAB PILLS  (Orders | Interests | Account | Lists)
   ========================================================== */

.fc-sub-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
}

.fc-sub-tabs::-webkit-scrollbar {
  display: none;
}

/* Desktop: stick below two-row nav */
@media (min-width: 769px) {
  .fc-sub-tabs {
    position: sticky;
    top: 88px;
    z-index: var(--z-sticky);
  }
}

/* Mobile: stick to top (no top nav above) */
@media (max-width: 768px) {
  .fc-sub-tabs {
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    padding: 8px 16px;
  }
}

.fc-sub-tab {
  display: inline-flex;
  align-items: center;
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  background: none;
  color: var(--text-medium);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s,
    border-color 0.15s;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.fc-sub-tab:hover {
  background: var(--hover-bg);
  color: var(--text-dark);
}

.fc-sub-tab.active,
.fc-sub-tab[aria-selected="true"] {
  background: var(--primary-blue);
  color: #fff;
  border-color: var(--primary-blue);
}

/* ==========================================================
   6. MOBILE MENU OVERLAY  (full-screen slide-up)
   ========================================================== */

.fc-menu-overlay {
  position: fixed;
  inset: 0;
  background: var(--card-bg);
  z-index: var(--z-modal);
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  overflow: hidden;
  visibility: hidden;
}

.fc-menu-overlay.open {
  transform: translateY(0);
  visibility: visible;
}

/* Menu header */
.fc-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.fc-menu-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-dark);
}

.fc-menu-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  color: var(--text-dark);
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.15s;
  font-size: 20px;
  font-family: inherit;
}

.fc-menu-close:hover {
  background: var(--hover-bg);
}

/* Menu body - scrollable */
.fc-menu-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 0 0 env(safe-area-inset-bottom);
}

/* Section within menu */
.fc-menu-section {
  padding: 12px 0 4px;
}

.fc-menu-section-title {
  padding: 0 16px 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-light);
}

/* Horizontal scroll shortcuts (pills) */
.fc-menu-shortcuts {
  display: flex;
  gap: 8px;
  padding: 0 16px 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.fc-menu-shortcuts::-webkit-scrollbar {
  display: none;
}

.fc-menu-shortcut {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 20px;
  background: var(--hover-bg);
  color: var(--text-dark);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s;
}

.fc-menu-shortcut:hover {
  background: var(--border-color);
}

.fc-menu-shortcut svg {
  width: 16px;
  height: 16px;
}

/* Accordion items (Browse by Vendor / Browse by Category) */
.fc-menu-accordion {
  border-top: 1px solid var(--border-color);
}

.fc-menu-accordion-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0 16px;
  height: 48px;
  border: none;
  background: none;
  color: var(--text-dark);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}

.fc-menu-accordion-trigger:hover {
  background: var(--hover-bg);
}

.fc-menu-accordion-arrow {
  width: 18px;
  height: 18px;
  color: var(--text-light);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.fc-menu-accordion.expanded .fc-menu-accordion-arrow {
  transform: rotate(180deg);
}

.fc-menu-accordion-content {
  display: none;
  padding: 0 0 8px;
}

.fc-menu-accordion.expanded .fc-menu-accordion-content {
  display: block;
}

.fc-menu-accordion-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 10px 28px;
  color: var(--text-medium);
  text-decoration: none;
  font-size: 14px;
  transition:
    background 0.12s,
    color 0.12s;
}

.fc-menu-accordion-link:hover {
  background: var(--hover-bg);
  color: var(--text-dark);
}

.fc-menu-accordion-link svg {
  width: 18px;
  height: 18px;
  color: var(--text-light);
  flex-shrink: 0;
}

/* More links section at bottom */
.fc-menu-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-dark);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  border-top: 1px solid var(--border-color);
  transition: background 0.12s;
}

.fc-menu-link:hover {
  background: var(--hover-bg);
}

.fc-menu-link svg {
  width: 20px;
  height: 20px;
  color: var(--text-light);
}

.fc-menu-signout {
  width: 100%;
  background: none;
  border: none;
  border-top: 1px solid var(--border-color);
  margin-top: 8px;
  color: #ef4444;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
  padding: 14px 16px;
  text-align: left;
}
.fc-menu-signout:hover {
  background: #fef2f2;
}

/* ==========================================================
   7. DARK THEME SUPPORT
   ========================================================== */

/* Desktop top nav row 1 */
[data-theme="dark"] .fc-topnav-primary {
  background: #0d1117;
}

/* Desktop top nav row 2 */
[data-theme="dark"] .fc-topnav-secondary {
  background: #090e14;
  border-top-color: rgba(255, 255, 255, 0.04);
}

/* Spotlight input in dark mode */
[data-theme="dark"] .fc-spotlight-input {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .fc-spotlight-input:focus {
  background: var(--input-bg);
  color: var(--text-dark);
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(66, 165, 245, 0.2);
}

[data-theme="dark"] .fc-spotlight-input:focus::placeholder {
  color: var(--text-light);
}

/* Spotlight results dropdown */
[data-theme="dark"] .fc-spotlight-results {
  background: var(--card-bg);
  border-color: var(--border-color);
}

/* Bottom tabs dark */
[data-theme="dark"] .fc-bottom-tabs {
  background: var(--card-bg);
  border-top-color: var(--border-color);
}

/* Menu overlay dark */
[data-theme="dark"] .fc-menu-overlay {
  background: var(--card-bg);
}

[data-theme="dark"] .fc-menu-shortcut {
  background: var(--input-bg);
  color: var(--text-dark);
}

[data-theme="dark"] .fc-menu-shortcut:hover {
  background: var(--hover-bg);
}

/* Account dropdown dark */
[data-theme="dark"] .fc-account-dropdown {
  background: var(--card-bg);
  border-color: var(--border-color);
}

/* Mega dropdown dark */
[data-theme="dark"] .fc-mega-dropdown {
  background: var(--card-bg);
  border-color: var(--border-color);
}

/* Sub-tabs dark */
[data-theme="dark"] .fc-sub-tabs {
  background: var(--card-bg);
  border-bottom-color: var(--border-color);
}

/* ==========================================================
   8. ANIMATIONS & UTILITIES
   ========================================================== */

@keyframes fcFadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Backdrop for menu overlay */
.fc-menu-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: calc(var(--z-modal) - 1);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
}

.fc-menu-backdrop.active {
  opacity: 1;
  visibility: visible;
}

/* Prevent body scroll when menu is open */
body.fc-menu-open {
  overflow: hidden;
}

/* Screen reader only utility */
.fc-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ==========================================================
   9. MOBILE SEARCH BAR  (<=768px only)
   ========================================================== */

.fc-mobile-search {
  display: none;
}

@media (max-width: 768px) {
  .fc-mobile-search {
    display: block;
    position: sticky;
    top: 0;
    z-index: calc(var(--z-header, 1000) - 1);
    background: #1a1a2e;
    padding: 8px 12px;
  }

  .fc-mobile-search-inner {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 8px 12px;
  }

  .fc-mobile-search-icon {
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.6);
    flex-shrink: 0;
  }

  .fc-mobile-search-input {
    flex: 1;
    border: none;
    background: none;
    color: #fff;
    font-size: 14px;
    font-family: inherit;
    outline: none;
  }

  .fc-mobile-search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
  }
}

/* ==========================================================
   10. AI CHAT FULLSCREEN MODE  (mobile bottom tab trigger)
   ========================================================== */

.ai-chat-fullscreen-mode .ai-chat-button {
  display: none !important;
}

.ai-chat-panel.ai-chat-fullscreen {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-height: 100% !important;
  border-radius: 0 !important;
  z-index: calc(var(--z-modal, 2000) + 1);
  display: flex !important;
  flex-direction: column;
}

.ai-chat-panel.ai-chat-fullscreen .ai-chat-header {
  flex-shrink: 0;
}

.ai-chat-panel.ai-chat-fullscreen .ai-chat-messages {
  flex: 1;
  overflow-y: auto;
}

.ai-chat-panel.ai-chat-fullscreen .ai-chat-input-container {
  flex-shrink: 0;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

/* Hide floating chat button when bottom tabs are active on mobile */
@media (max-width: 768px) {
  body.layout-retailer-v2 #ai-chat-widget .ai-chat-button {
    display: none !important;
  }
}

/* ==========================================================
   11. MENU LOADING PLACEHOLDER
   ========================================================== */

.fc-menu-loading {
  padding: 12px 28px;
  font-size: 13px;
  color: var(--text-light);
}

/* ==========================================================
   12. MENU "MORE" LINKS LIST
   ========================================================== */

.fc-menu-links {
  display: flex;
  flex-direction: column;
}

/* ==========================================================
   13. MOBILE SPOTLIGHT OVERLAY
   ========================================================== */

.fc-mobile-spotlight-overlay {
  display: none;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--card-bg, #fff);
  z-index: 10001;
}
.fc-mobile-spotlight-header {
  display: flex;
  align-items: center;
  padding: 0.75rem;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-color, #e0e0e0);
}
.fc-mobile-spotlight-input {
  flex: 1;
  padding: 0.625rem 1rem;
  border: 1px solid var(--border-color, #e0e0e0);
  border-radius: 8px;
  font-size: 1rem;
  background: var(--sidebar-bg, #f5f5f5);
  outline: none;
}
.fc-mobile-spotlight-input:focus {
  border-color: var(--primary-blue, #1e88e5);
}
.fc-mobile-spotlight-close {
  background: none;
  border: none;
  color: var(--primary-blue, #1e88e5);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.5rem;
  white-space: nowrap;
}
.fc-mobile-spotlight-results {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
}
.fc-mobile-spotlight-results .fc-spot-group {
  margin-bottom: 1rem;
}
.fc-mobile-spotlight-results .fc-spot-group-label {
  padding: 0.5rem;
  font-weight: 600;
  color: var(--text-light);
  font-size: 0.75rem;
  text-transform: uppercase;
}
.fc-mobile-spotlight-results .fc-spot-item {
  padding: 0.75rem;
  border-radius: 6px;
}
.fc-mobile-spotlight-results .fc-spot-item:hover {
  background: var(--sidebar-bg, #f5f5f5);
}
.fc-mobile-spotlight-results .fc-spot-item a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-dark);
}
