﻿/* Basic resets and container */
.container {
  width: 100%;
  max-width: 1200px;
  margin: auto;
}
.table {
  display: table;
  margin: 0 auto;
}
.toggleMenu {
  display: none;
  padding: 10px 15px;
  color: #ffffff;
  cursor: pointer;
  text-decoration: none;
}
.nav {
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav a {
  padding: 10px 15px;
  color: #fff;
  text-decoration: none;
  display: block;
}

/* Shared arrow styling */
.nav li.has-sub > a::after {
  font-family: FontAwesome;
  content: "\f078"; /* chevron-down */
  font-size: 0.5em;
  margin-left: 8px;
  transition: transform 0.25s ease;
}
.nav li.open > a::after {
  transform: rotate(180deg);
}

/* ────────────────────────────────────────────────
   DESKTOP styles
──────────────────────────────────────────────── */
@media (min-width: 901px) {
  .nav {
    display: flex;
    justify-content: center;
  }

  .nav > li {
    position: relative;
  }

  /* Level 1 dropdowns — hover activated, under parent */
  .nav > li > ul {
    position: absolute;
    top: 100%;
    left: 0;                        /* ← change to left: 50%; transform: translateX(-50%); for centered */
    min-width: 16em;
    background: #593E15;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
    z-index: 999;
    box-shadow: 0 6px 12px rgba(0,0,0,0.25);
  }

  .nav > li:hover > ul,
  .nav > li.focus > ul {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
  }

  /* Level 2+ — click only, inline under parent */
  .nav li ul ul {
    position: relative;
    width: 100%;
    background: #402905;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: max-height 0.35s ease, opacity 0.3s ease;
  }

  .nav li.has-sub.open > ul {
    max-height: 800px;              /* large enough for deep menus */
    opacity: 1;
    visibility: visible;
  }

  .nav li ul li a {
    padding-left: 30px;             /* indent for visual hierarchy */
    border-top: 1px solid #000000;
  }

  /* Hover/focus feedback */
  .nav a:hover,
  .nav a:focus-visible {
    background: rgba(0, 0, 0, 0.15);
  }

  .nav a:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
  }
}

/* ────────────────────────────────────────────────
   MOBILE styles — unchanged from your original
──────────────────────────────────────────────── */
@media screen and (max-width: 900px) {
  .toggleMenu {
    display: block;
  }
  .nav {
    display: none;
    flex-direction: column;
    text-align: center;
  }
  .nav > li {
    width: 100%;
  }
  .nav li ul {
    position: static;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    opacity: 1;
    transform: none;
    visibility: visible;
    background: #593E15;
  }
  .nav li.open > ul {
    max-height: 500px;
  }
  .nav li ul ul {
    padding-left: 20px;
    background:#402905;
  }
  .nav li.has-sub > a::after {
    float: right;
    margin-right: 15px;
    margin-left: 0;
  }
}
  /* Hover/focus feedback */
  .nav a:hover,
  .nav a:focus-visible {
    background: rgba(0, 0, 0, 0.15);
  }

  .nav a:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
  }
}
