/* css/menu.css - Menu latéral gauche avec accordéon */

/* ============================================
   MENU GAUCHE - TOP MENU
============================================ */
#topMenu {
  position: absolute;
  top: calc(var(--header-height) + var(--banner-height));
  bottom: var(--nav-height);
  left: 0;
  width: 100%;
  background: var(--surface);
  z-index: 1100;
  transform: translateY(-100%);
  transition: var(--transition-dropdown);
  display: flex;
  flex-direction: column;
}

#topMenu.active {
  transform: translateY(0);
  animation: slideIn 0.4s ease;
}

/* ============================================
   HEADER DU MENU
============================================ */
.top-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.top-menu-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
}

.close-top-btn {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.2s ease, transform 0.2s ease;
}

.close-top-btn:hover {
  color: var(--primary);
  transform: scale(1.1);
}

/* ============================================
   PANEL MAIN (liste des items)
============================================ */
#panel-main {
  flex-grow: 1;
  overflow-y: auto;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* ============================================
   ITEM PARENT
============================================ */
.menu-item-parent {
  border-bottom: 1px solid var(--dropdown-item-border);
  transition: var(--transition);
}

.menu-item-parent:hover {
  background: var(--accordion-bg);
}

.app-menu__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 16px 20px;
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.app-menu__toggle:hover {
  background: var(--accordion-bg);
}

.app-menu__link-main {
  display: flex;
  align-items: center;
}

.app-menu__link-main i {
  width: 24px;
  text-align: center;
  margin-right: 14px;
  color: var(--primary);
  font-size: 1.1rem;
}

.app-menu__chevron {
  transition: transform 0.4s ease;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.menu-item-parent.is-open .app-menu__chevron {
  transform: rotate(180deg);
}

/* ============================================
   SOUS-MENU
============================================ */
.submenu-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--accordion-bg);
  list-style: none;
  margin: 0;
  padding: 0;
}

.menu-item-parent.is-open .submenu-content {
  max-height: 800px;
}

.submenu-content li a {
  display: block;
  padding: 14px 20px 14px 58px;
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.9rem;
  border-top: 1px solid var(--dropdown-item-border);
  transition: var(--transition);
}

.submenu-content li a:hover {
  background: var(--surface);
  color: var(--primary);
  padding-left: 62px;
}

.submenu-content li a i {
  margin-right: 10px;
  width: 16px;
  color: var(--primary);
}

/* ============================================
   MENU DIVIDER
============================================ */
.menu-divider {
  border: none;
  border-bottom: 1px solid var(--dropdown-item-border);
  margin: 8px 0;
}

/* ============================================
   FOOTER DU MENU
============================================ */
.menu-footer {
  padding: 8px 20px 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.menu-footer_title {
  display: inline-flex;
  justify-content: center;
  font-weight: 600;
  text-transform: uppercase;
  font-size: small;
  align-items: end;
  border-bottom: 1px solid var(--border);
  padding-bottom: 5px;
}

.menu-footer_title :first-child {
  font-size: medium;
  font-weight: 560;
}

.app-menu__socials {
  gap: 10px;
  flex-wrap: wrap;
  display: flex;
  justify-content: space-around;
  align-items: stretch;
}

.app-menu__social {
  flex-grow: 1;
  flex: 1;
  width: 250px;
  min-height: 44px;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  text-decoration: none;
  transition: var(--transition);
}

.app-menu__social:hover {
  color: var(--primary);
  transform: scale(1.1);
}
/* ── PAYS : sous-menu scrollable (197 pays) ─────────────── */
.submenu-countries {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.menu-item-parent.is-open .submenu-countries {
    max-height: 320px;          /* Visible : ~8 pays */
    overflow-y: auto;
    overflow-x: hidden;
    /* Scrollbar fine */
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.menu-item-parent.is-open .submenu-countries::-webkit-scrollbar {
    width: 4px;
}

.menu-item-parent.is-open .submenu-countries::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

/* Indicateur visuel "il y a plus à scroller" */
.submenu-countries-wrap {
    position: relative;
}

.submenu-countries-wrap::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 32px;
    background: linear-gradient(transparent, var(--surface));
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.3s;
}

.submenu-countries-wrap.scrolled-to-end::after {
    opacity: 0;
}
