/* ============================================================
   CAPE OFFICE FURNITURE, Site Header (all pages)
   The one place for the header's styles. Markup: includes/site-header.php
   (loaded by page-header.php); behaviour: js/site-header.js.
     .site-top          wraps everything below
     .site-contact-bar  phone and email strip (phones only)
     header.hdr-v2      logo bar: logo, showroom, email, call button
     #nav               dark menu bar with dropdowns
   ============================================================ */

:root {
  --cof-green: #a5c711;
  --cof-green-darker: #97b410;
  --cof-grey: #333;
  --cof-light-grey: #f2f2f2;
}

/* ---- Logo bar (moved from master.css) ---------------------------------- */
header {
  position: relative;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  margin: 0 1rem;
  font-size: 0.9rem;
}

header .logo img {
  height: 100px;
}

header .location h5 {
  font-size: 1rem;
  color: var(--cof-green);
  font-weight: 400;
  text-transform: uppercase;
}

header .location p {
  font-size: 0.85rem;
  font-weight: 300;
}

header .contact-details p {
  text-transform: none;
  font-size: 0.85rem;
  font-weight: 300;
}

header .contact-details p i {
  margin-right: 0.25rem;
}

header .contact-details h5 {
  font-size: 1rem;
  color: var(--cof-green);
  font-weight: 400;
  text-transform: uppercase;
}

@media screen and (min-width: 620px) and (max-width: 979px) {
  header .logo img {
    height: 75px;
  }

  header .location {
    display: none;
  }
}

@media screen and (max-width: 619px) {
header {
  justify-content: center;
}

header .location,
.contact-details {
  display: none;
}
}


/* ============================================================
   HEADER (all pages, header.hdr-v2 in page-header.php)
   All white. Logo on the left;
   showroom, email and a green phone button on the right.
   ============================================================ */
header.hdr-v2 {
  padding: 0 2.5rem 0 0;
  margin: 0;
  background: #fff;
  border-bottom: 1px solid #ececef;
  color: #1f2330;
}
header.hdr-v2 .logo {
  padding: 1rem 2.5rem;
}
header.hdr-v2 .logo img { height: 64px; width: auto; display: block; }
.hdr-v2-info { display: flex; align-items: center; gap: 2.25rem; line-height: 1.5; font-size: 0.88rem; }
.hdr-v2-item small {
  display: block;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #8fb00d;
  margin-bottom: 0.2rem;
}
.hdr-v2-item a { color: inherit; text-decoration: none; transition: color 0.2s ease; }
.hdr-v2-item a:hover { color: #8fb00d; text-decoration: none; }
.hdr-v2-call {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  background: var(--cof-green);
  color: #fff;
  font-weight: 800;
  font-size: 0.85rem;
  padding: 0.75rem 1.4rem;
  border-radius: 999px;
  text-decoration: none;
  transition: background-color 0.2s ease;
}
.hdr-v2-call:hover { background: #1f2330; color: #fff; text-decoration: none; }

/* Tablet: drop the showroom, then the email, as space runs out */
@media (max-width: 1099px) {
  header.hdr-v2 { padding-right: 1.5rem; }
  .hdr-v2-showroom { display: none; }
}
@media (max-width: 799px) {
  .hdr-v2-email { display: none; }
}
/* Phone: logo only (the menu button is lifted into this bar, see below) */
@media (max-width: 619px) {
  header.hdr-v2 { padding: 0 1rem; }
  header.hdr-v2 .logo { padding: 0; }
  header.hdr-v2 .logo img { height: 44px; }
  .hdr-v2-info { display: none; }
}

/* Phone: one slim white bar, logo on the left, menu button on the right */
@media (max-width: 619px) {
  /* One slim bar: logo on the left, menu button on the right */
  header {
    justify-content: flex-start;
    height: 64px;
    padding: 0 1rem;
    margin: 0;
    border-bottom: 1px solid #ececef;
  }
  header .logo img {
    height: 44px;
    width: auto;
  }
  #nav .navbar-custom {
    position: relative;
  }
  /* Lift the menu button out of its dark strip into the header bar */
  #nav .navbar-custom .navbar-toggler {
    position: absolute;
    top: -57px;
    right: 0.5rem;
    width: 48px;
    height: 48px;
    padding: 0;
    font-size: 1.35rem;
    color: var(--cof-grey);
  }
}

/* ---- Menu bar and dropdowns (moved from menu.css) ----------------------- */
/*#nav {
  padding: 0 15px;
  position: -webkit-sticky;
  position: -moz-sticky;
  position: -ms-sticky;
  position: -o-sticky;
  position: sticky;
  top:0;
  z-index:5
}*/



/* change the background color */
.navbar-custom {
  background-color: var(--cof-grey);
  color: var(--cof-light-grey);
  font-size: 0.8rem;
  text-transform: capitalize;
  z-index:2;
}

/* change the brand and text color */
.navbar-custom .navbar-brand,
.navbar-custom .navbar-text {
  color: #fff; /*rgba(255,255,255,.8)*/
  padding: 0;
}

/*.navbar-custom .navbar-nav {
  overflow-x: auto;
}*/

/* change the link color and add padding for height */
.navbar-custom .navbar-nav .nav-link {
  color: #fff; /*rgba(255,255,255,.5);*/
  padding: 14px 16px;
  white-space: nowrap;
}

.navbar-custom .navbar-nav .nav-link:hover {
  color: #f2f2f2; /*rgba(255,255,255,.5);*/
  background-color: var(--cof-green-darker);
  box-sizing: border-box;
}

.navbar-custom .navbar-nav .nav-link:hover::before,
.navbar-custom .navbar-nav .nav-link:focus::before {
  transform: scaleX(1);
}

/* change the color of active or hovered links */
.navbar-custom .nav-item.active .nav-link {
  color: #fff;
  background-color: var(--cof-green); /* add background-color to active links */
}

.dropdown {
  list-style: none;
  background: none;
  padding: 0;
  display: inline-block;
  /*color: #fff;*/
}

.dropdown .nav-link {
  color: #fff;
  text-decoration: none;
}

/*.dropdown .dropdown-toggle a{background:green; color: orange}*/
.dropdown .dropdown-menu {
  background: #f9f9f9;
  border: none;
  margin: 0;
  padding: 0;
  border-radius: 0px;
  /*box-shadow: 3px 6px 9px #c0c0c0;*/
}

.dropdown-menu .dropdown-item {
  display: inline-block;
  width: 100%;
  padding: 8px 15px;
  border-bottom: 1px solid #333;
}
.dropdown .dropdown-menu a:link {
  color: #333;
  font-size: 0.8rem;
  text-decoration: none;
  border-bottom: 1px solid #333;
}
.dropdown .dropdown-menu a:hover {
  color: #fff;
  background-color: var(--cof-green);
  border-bottom: 1px solid #333;
}
.navbar-custom .navbar-toggler {
  border: none;
  padding: 0.8rem 0.8rem;
  color: #fff;
}

@media screen and (max-width: 767px) {

  .dropdown .dropdown-menu {
    box-shadow: none;
  }
}

@media (min-width: 992px) and (max-width: 1230px) {
  .navbar-custom {
    font-size: 0.8rem;
  }

  .dropdown {
    display: inline-block;
  }

  .dropdown .dropdown-menu a:link {
    font-size: 0.8rem;
  }
}

/* ---- Nav dropdowns (all pages) ------------------------------------------
   White panel with thin dividers; the hovered item shifts right and a green
   arrow slides in. The green line sits under the open menu's own tab only,
   so the part of the panel that reaches under the next tab stays white.
   Desktop only: the navbar collapses into the menu button below 1200px. */
@media (min-width: 1200px) {
  #nav .navbar-nav > li.dropdown.show > .nav-link {
    box-shadow: inset 0 -4px 0 var(--cof-green);
  }
  #nav .dropdown .dropdown-menu {
    background: #fff;
    border: 0;
    border-radius: 0 0 10px 10px;
    min-width: 240px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 16px 34px rgba(20,22,30,0.14);
  }
  #nav .dropdown .dropdown-menu .dropdown-item,
  #nav .dropdown .dropdown-menu .dropdown-item:link {
    position: relative;
    border: 0;
    border-bottom: 1px solid #f0f0f2;
    color: #1f2330;
    font-size: 0.85rem;
    padding: 11px 18px;
    transition: background-color 0.2s ease, color 0.2s ease, padding 0.2s ease;
  }
  #nav .dropdown .dropdown-menu .dropdown-item:last-child { border-bottom: 0; }
  #nav .dropdown .dropdown-menu .dropdown-item::after {
    content: "\f061";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 0.7rem;
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translate(-6px, -50%);
    opacity: 0;
    color: var(--cof-green);
    transition: transform 0.2s ease, opacity 0.2s ease;
  }
  #nav .dropdown .dropdown-menu .dropdown-item:hover {
    border-bottom: 1px solid #f0f0f2;
    background: #fafafb;
    color: #8fb00d;
    padding-left: 22px;
  }
  #nav .dropdown .dropdown-menu .dropdown-item:last-child:hover { border-bottom: 0; }
  #nav .dropdown .dropdown-menu .dropdown-item:hover::after {
    transform: translate(0, -50%);
    opacity: 1;
  }
}

/* ---- Phones: contact strip + header that hides on scroll down -------------
   Below 768px the whole top (contact strip, logo bar, menu bar) sticks to
   the top of the screen, slides away while scrolling down and slides back
   in on any scroll up. js/site-header.js adds .is-hidden. ------------------ */
.site-contact-bar { display: none; }

@media (max-width: 767px) {
  /* The page wrapper hides sideways overflow, which also turns off sticky;
     clip hides it the same way and lets the header stick. */
  .site-top {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: #fff;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    will-change: transform;
  }
  .site-top.is-hidden { transform: translateY(-100%); }
  .site-top.is-stuck { box-shadow: 0 8px 20px -12px rgba(20,22,30,0.35); }

  .site-contact-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    height: 36px;
    padding: 0 1rem;
    background: #1f2330;
    font-size: 0.74rem;
    font-weight: 700;
    line-height: 1;
  }
  .site-contact-bar a {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
    color: #fff;
    text-decoration: none;
    white-space: nowrap;
  }
  .site-contact-bar a:hover,
  .site-contact-bar a:focus { color: var(--cof-green); text-decoration: none; }
  .site-contact-bar i { color: var(--cof-green); font-size: 0.72rem; }
  .site-contact-bar-email { overflow: hidden; text-overflow: ellipsis; }

  /* phone and email now sit in the strip, so the logo bar shows the logo only */
  .hdr-v2-info { display: none; }

  /* an open menu scrolls inside the stuck header rather than running off screen */
  #nav .navbar-collapse { max-height: calc(100vh - 110px); overflow-y: auto; }
}
@media (max-width: 359px) {
  .site-contact-bar { font-size: 0.68rem; padding: 0 0.75rem; }
}
@media (prefers-reduced-motion: reduce) {
  .site-top { transition: none; }
}


/* ---- All screens: header stays reachable on scroll up ---------------------
   The page wrapper hides sideways overflow, which would also turn off sticky;
   clip hides it the same way and lets the header stick. */
@supports (overflow: clip) {
  body, .page-wrapper { overflow-x: clip; }
}
/* Desktop and tablet: only the dark menu bar comes back. .site-top sticks at
   minus the logo bar's height (--site-logo-h, set by js/site-header.js), so
   the logo bar scrolls away and the menu bar is what shows. */
@media (min-width: 768px) {
  .site-top {
    position: sticky;
    top: calc(-1 * var(--site-logo-h, 97px));
    z-index: 1030;
    transition: transform 0.3s ease;
    will-change: transform;
  }
  .site-top.is-hidden { transform: translateY(-100%); }
  .site-top.is-stuck #nav .navbar-custom { box-shadow: 0 10px 24px -14px rgba(20,22,30,0.55); }
}
@media (prefers-reduced-motion: reduce) {
  .site-top { transition: none; }
}
