/* ============================================================
   Hardy Commodities — header-menu.css (Merged + Renumbered)
   ============================================================

   INDEX
   ------------------------------------------------------------
   1. Base Font & Reset for Menu
   2. Links
   3. Header Bar
   4. Header Container
   5. Desktop Header Tightening
   6. Header Brand & Contact
   7. Hamburger Menu (Mobile)
   8. Hamburger → X Animation
   9. Navigation Menu (Baseline)
   10. Dropdown Containers
   11. Submenu Links
   12. Mobile Styles
   13. Desktop Styles
   14. Header Upscale — 1360×768
   15. Header Upscale — 1920×1080
   16. Accessibility & Nav Fixes
   ============================================================ */


/* ============================================================
   1. BASE FONT & RESET FOR MENU   -   Do Not Remove
   ============================================================ */
html, body {
  margin: 0;
  padding: 0;
  font-family: Verdana, Arial, sans-serif;
  overflow-x: hidden;
}

html {
  font-size: 18px;
}

body {
  font-size: clamp(18px, 1.5vw, 20px);
  line-height: 1.8;
}


/* ============================================================
   2. LINKS    -   Do Not Remove
   ============================================================ */
a { color: gold; text-decoration: none; }
a:hover { text-decoration: underline; color: gold; }


/* ============================================================
   3. HEADER BAR
   ============================================================ */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  background: black;
  z-index: 1000;
}


/* ============================================================
   4. HEADER CONTAINER
   ============================================================ */
.header-container {
  display: flex;
  align-items: center;
  padding: 0.8rem 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
}


/* ============================================================
   5. DESKTOP HEADER TIGHTENING
   ============================================================ */
@media (min-width: 1025px) {
  header {
    padding-top: 2px;
    padding-bottom: 2px;
  }

  .header-container {
    padding-top: 2px;
    padding-bottom: 2px;
  }
}


/* ============================================================
   6. HEADER BRAND & CONTACT
   ============================================================ */
.header-brand {
  color: gold;
  font-weight: bold;
  flex: 1;
  text-align: left;
  font-size: clamp(0.90rem, 1.4vw, 1.10rem);
  line-height: 1.0;
}

.header-contact {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.classic-link,
.phone-number {
  color: gold;
  font-size: clamp(0.80rem, 1.1vw, 0.95rem);
  line-height: 1.0;
}

.icon {
  height: 14px;
}


/* ============================================================
   7. HAMBURGER MENU — MOBILE ONLY
   ============================================================ */
#menu-toggle {
  background: none;
  border: none;
  cursor: pointer;
  width: 30px;
  height: 30px;
  position: relative;
  padding: 0;
  display: none;
  margin-left: 8px;
  margin-top: 4px;
}

.hamburger {
  position: relative;
  display: block;
  width: 28px;
  height: 3px;
  background: gold;
  left: 2px;
  top: 10%;
  transform: translateY(-50%);
  transition: all 0.3s ease;
}

.hamburger::before,
.hamburger::after {
  content: '';
  position: absolute;
  width: 28px;
  height: 3px;
  background: gold;
  transition: all 0.3s ease;
}

.hamburger::before { top: -9px; left: 0; }
.hamburger::after { bottom: -9px; left: 0; }


/* ============================================================
   8. HAMBURGER → X ANIMATION
   ============================================================ */
#menu-toggle[aria-expanded="true"] .hamburger {
  background: transparent;
}

#menu-toggle[aria-expanded="true"] .hamburger::before {
  top: 0;
  transform: rotate(45deg);
}

#menu-toggle[aria-expanded="true"] .hamburger::after {
  bottom: 0;
  transform: rotate(-45deg);
}


/* ============================================================
   9. NAVIGATION MENU (BASELINE)
   ============================================================ */
#main-nav {
  padding: 0.5rem 0;
}

#main-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.5rem;
}

#main-nav > ul > li {
  position: relative;
}

.menu-label,
#main-nav > ul > li > a {
  display: block;
  padding: 0.6rem 1rem;
  color: white;
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  text-decoration: none;
  cursor: pointer;
  border: none;
  background: none;
  transition: background 0.2s;
}

.menu-label:hover,
#main-nav a:hover,
.menu-label:focus,
#main-nav a:focus {
  background: #222;
  border-radius: 4px;
}

.arrow {
  margin-left: 0.4rem;
  font-size: 0.9rem;
  transition: transform 0.3s;
}

[aria-expanded="true"] .arrow {
  transform: rotate(180deg);
}

#main-nav a:link,
#main-nav a:visited,
#main-nav a:active {
  color: white !important;
}


/* ============================================================
   10. DROPDOWN CONTAINERS
   ============================================================ */
.submenu {
  display: none !important;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: #1a1a1a;
  box-shadow: 0 8px 16px rgba(0,0,0,0.5);
  z-index: 1001;
  padding: 0.5rem 0;
  border-radius: 4px;
  text-align: left;
}

.submenu a,
.submenu .menu-label {
  display: block;
  padding: 0.6rem 1.5rem;
  color: white;
  white-space: nowrap;
}

.submenu .arrow { display: none; }

@media (min-width: 1025px) {
  .has-submenu:hover > .submenu,
  .has-submenu:focus-within > .submenu {
    display: block !important;
  }

  .submenu .submenu {
    position: absolute;
    top: 0;
    left: 100%;
    margin-left: -4px;
  }

  .submenu > li { position: relative; }

  .submenu .menu-label::after {
    content: "▶";
    float: right;
    margin-top: 3px;
    font-size: 0.8rem;
    color: #aaa;
  }
}


/* ============================================================
   11. SUBMENU LINKS
   ============================================================ */
#main-nav li ul li a,
#main-nav li ul li .menu-label {
  display: block;
  width: 100%;
  padding: 8px 16px;
  box-sizing: border-box;
  color: #fff;
  font-size: inherit;
  line-height: inherit;
  border-top: 1px solid #444;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* ============================================================
   12. MOBILE STYLES  (MERGED OVERRIDES)
   ============================================================ */
@media (max-width: 1024px) {

  #menu-toggle { display: block; }

  .header-container {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .header-brand {
    margin-bottom: 0rem;
    font-size: 1.18rem;
    line-height: 1.2;
  }

  .header-contact {
    justify-content: center;
    gap: 0.15rem;
    flex-wrap: wrap;
  }

  .classic-link {
    font-size: 2.05rem !important;
    font-weight: bold;
    line-height: 1.1;
  }

  .phone-number {
    font-size: 0.95rem !important;
    line-height: 1.2;
  }

  .icon {
    height: 24px;
  }

#main-nav {
    position: fixed;
    right: 0;
    /* bottom: 0; */   /* stays removed */
    width: 80%;
    max-width: 320px;
    background: #000000;
    transform: translateX(100%);
    transition: transform 0.4s ease;
    overflow-y: auto;
    padding: 6px 1rem 0.8rem;
    z-index: 900;

    /* ⭐ This is the fix */
    max-height: calc(100vh - 10px);
}

  #main-nav.open { transform: translateX(0); }

  #main-nav > ul {
    flex-direction: column;
    gap: 0.5rem;
  }

  /* ============================================================
     EXTRA BOTTOM SPACING FOR SCROLLING
     ============================================================ */
  #main-nav ul::after {
      content: "";
      display: block;
      height: 0.8rem; /* adjust if you want more/less */
  }

  /* FULL-ROW CLICK */
  #main-nav > ul > li > .menu-label {
    display: block;
    width: 100%;
    text-align: left;
  }

  /* COLOR TIERS */
  #main-nav > ul > li > a,
  #main-nav > ul > li > .menu-label {
    background: #000000;
    color: #fff;
  }

  #main-nav > ul > li > ul > li > a,
  #main-nav > ul > li > ul > li > .menu-label {
    background: #006400;
    color: #fff;
  }

  #main-nav > ul > li > ul > li > ul > li > a,
  #main-nav > ul > li > ul > li > ul > li > .menu-label {
    background: #556B2F;
    color: #fff;
  }

  /* HOVER */
  #main-nav > ul > li > a:hover,
  #main-nav > ul > li > .menu-label:hover {
    background: #222222;
  }

  /* REMOVE FOCUS OUTLINES */
  #main-nav button:focus,
  #main-nav a:focus {
    outline: none;
    box-shadow: none;
  }

  #menu-toggle:focus {
    outline: none !important;
    box-shadow: none !important;
    background: none !important;
  }


  /* SUBMENU OPEN */
  #main-nav .submenu {
    display: none !important;
    position: static;
    box-shadow: none;
    background: transparent;
    padding: 0 0 0 1.5rem;
    border-left: 1px solid #444;
  }

  #main-nav .submenu.open {
    display: block !important;
  }

  #main-nav .submenu > li > .menu-label::after {
    content: "▼";
    float: right;
    margin-top: 3px;
    font-size: 0.8rem;
    color: #aaa;
  }

  #main-nav .submenu > li > .menu-label[aria-expanded="true"]::after {
    content: "▲";
  }

  #main-nav > ul > li > .menu-label .arrow {
    display: inline-block;
  }

  #main-nav > ul > li > .menu-label[aria-expanded="true"] .arrow {
    transform: rotate(180deg);
  }

  #main-nav > ul > li > .menu-label::after {
    content: none !important;
  }

  .nav-backdrop {
    position: fixed;
    inset: 0;
    background: transparent !important;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease;
    z-index: 800;
  }

  #main-nav.open ~ .nav-backdrop {
    opacity: 0;
    visibility: hidden;
  }
}


/* ============================================================
   13. DESKTOP STYLES  (MERGED OVERRIDES)
   ============================================================ */
@media (min-width: 1025px) {

  header {
    background: black;
    padding: 4px 0;
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
  }

  .header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 20px;
    max-width: 100%;
    margin: 0 auto;
  }

  .header-brand {
    font-size: clamp(1.20rem, 1.2vw + 0.5rem, 1.85rem);
    font-weight: bold;
    color: gold;
    line-height: 1.1;
  }

  .classic-link,
  .phone-number {
    font-size: clamp(1.00rem, 1.0vw + 0.4rem, 1.55rem);
    color: gold;
    line-height: 1.1;
  }

  .icon {
    height: clamp(18px, 1.0vw + 12px, 32px);
  }

  #main-nav {
    border-bottom: 1px solid #444;
    padding: 0.4rem 0;
  }

  #main-nav ul {
    display: flex;
    justify-content: center;
    gap: 0.5rem 0.7rem;
    list-style: none;
    padding: 0;
    margin: 0;
  }

  #main-nav > ul > li {
    position: relative;
  }

  #main-nav > ul > li > a,
  #main-nav > ul > li > .menu-label {
    font-size: clamp(1.15rem, 1.55vw, 1.65rem);
    padding: 0.55rem 0.9rem;
    color: white;
    background: none;
    border-radius: 4px;
    transition: background 0.2s;
  }

  #main-nav > ul > li > a:hover,
  #main-nav > ul > li > .menu-label:hover {
    background: #222;
  }

  #main-nav > ul > li > .menu-label .arrow {
    display: inline-block;
    transition: transform 0.3s ease;
  }

  #main-nav > ul > li.has-submenu:hover > .menu-label .arrow,
  #main-nav > ul > li.has-submenu:focus-within > .menu-label .arrow {
    transform: rotate(180deg);
  }

  #main-nav > ul > li.has-submenu > .submenu {
    top: calc(100% + 4px);
    position: absolute;
    background: #1a1a1a;
    min-width: 220px;
    padding: 0.5rem 0;
    border-radius: 4px;
    display: none;
    z-index: 1001;
  }

  .has-submenu:hover > .submenu,
  .has-submenu:focus-within > .submenu {
    display: block !important;
  }

  #main-nav > ul > li.has-submenu::after {
    content: "";
    position: absolute;
    left: 0; right: 0;
    top: 100%;
    height: 8px;
    background: transparent;
    pointer-events: auto;
  }

  .submenu a,
  .submenu .menu-label {
    padding: 0.6rem 1.5rem;
    color: white;
    white-space: nowrap;
  }

  .submenu a:hover,
  .submenu .menu-label:hover {
    background: #111;
  }
}


/* ============================================================
   14. HEADER UPSCALE — 1360×768
   ============================================================ */
@media (min-width: 1280px) and (max-width: 1440px) {

  .header-brand {
    font-size: 1.45rem;
  }

  .classic-link {
    font-size: 1.25rem !important;
  }

  .phone-number {
    font-size: 1.25rem !important;
  }

  .icon {
    height: 26px;
  }
}


/* ============================================================
   15. HEADER UPSCALE — 1920×1080
   ============================================================ */
@media (min-width: 1920px) {

  .header-brand {
    font-size: 1.75rem;
  }

  .classic-link {
    font-size: 1.45rem !important;
  }

  .phone-number {
    font-size: 1.45rem !important;
  }

  .icon {
    height: 30px;
  }
}


/* ============================================================
   16. ACCESSIBILITY & NAV FIXES
   ============================================================ */
a:focus,
button:focus,
.menu-label:focus {
  outline: 3px solid gold;
  outline-offset: 2px;
  background-color: #333;
}
