/* ============================================================
   Mobile & tablet header (≤991px)
   Replaces the wsmenu off-canvas drawer on small screens with a
   dedicated drawer: persistent Call/Book in the bar, split
   accordion rows, two-column service index, pinned action dock.
   Desktop (≥992px) navigation is untouched.
   Loads after responsive.css so equal-specificity overrides win.
   ============================================================ */

/* Drawer/scrim exist in the DOM at all sizes; desktop never shows them */
@media (min-width: 992px) {
  .mh-scrim,
  .mh-drawer {
    display: none;
  }
}

@media (max-width: 991px) {

  /* ---------- Bar ---------- */
  .wsmobileheader {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0 10px 0 16px;
    box-shadow: 0 0 2px rgba(50, 50, 50, 0.4);
  }

  /* .clearfix pseudo-elements would join the flex layout as extra items */
  .wsmobileheader::before,
  .wsmobileheader::after {
    display: none;
  }

  .wsmobileheader .smllogo {
    display: block;
    margin: 0;
    padding: 0;
    line-height: 0;
    flex-shrink: 0;
  }

  .wsmobileheader .smllogo a {
    display: inline-block;
    line-height: 0;
  }

  .smllogo img {
    height: 30px;
    width: auto;
    max-width: none;
  }

  .mh-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
  }

  .mh-call {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(194, 155, 102, 0.55);
    border-radius: 50%;
    text-decoration: none;
  }

  .mh-call svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: #C29B66;
    stroke-width: 1.6;
    stroke-linejoin: round;
  }

  .mh-call-num {
    display: none;
  }

  .mh-book {
    display: inline-block;
    background-color: #AF8855;
    color: #fff;
    font-family: 'Jost', sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    text-decoration: none;
    padding: 12px 16px;
    line-height: 1;
    white-space: nowrap;
  }

  .mh-book:hover,
  .mh-book:focus {
    color: #fff;
    background-color: #9a7648;
    text-decoration: none;
  }

  .mh-book-more {
    display: none;
  }

  .mh-menu {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: none;
    border: 0;
    cursor: pointer;
    padding: 6px 8px;
    min-width: 44px;
    min-height: 44px;
    justify-content: center;
  }

  .mh-menu-lines {
    display: flex;
    flex-direction: column;
    gap: 5px;
  }

  .mh-menu-lines span {
    width: 22px;
    height: 2px;
    background: #fff;
    border-radius: 1px;
  }

  .mh-menu-cap {
    color: #B9AF9F;
    font-family: 'Jost', sans-serif;
    font-size: 8px;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    line-height: 1;
  }

  /* Old wsmenu drawer can never appear on mobile */
  .wsmainfull {
    display: none;
  }

  /* Page-top offsets: the theme clears the fixed header with per-page rules
     sized for the old 80px bar (75px on the home hero) — some by class, some
     by ID (#hero-12, #blog-page, #single-post), which outrank class overrides.
     Match them all to the new 60px bar (68px on tablet below). #toc pages have
     no margin rule and clear the bar with .pt-9 padding instead. */
  .hero-section,
  .inner-page-title,
  #hero-12,
  #blog-page,
  #single-post {
    margin-top: 60px;
  }

  .blog-page-section.pt-9 {
    padding-top: 70px !important;
  }

  /* ---------- Scrim ---------- */
  .mh-scrim {
    position: fixed;
    inset: 0;
    background: rgba(10, 8, 5, 0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
    z-index: 10010;
  }

  body.mh-open .mh-scrim {
    opacity: 1;
    pointer-events: auto;
  }

  /* ---------- Drawer ---------- */
  .mh-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 85vw;
    max-width: 320px;
    background: #171512;
    z-index: 10012;
    transform: translateX(103%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: -12px 0 32px rgba(0, 0, 0, 0.4);
  }

  body.mh-open .mh-drawer {
    transform: translateX(0);
  }

  body.mh-open {
    overflow-y: hidden;
  }

  /* Third-party floaters (chat, Cherry) stay off the open menu */
  body.mh-open chat-widget,
  body.mh-open [id^="widget-floatingEstimator"] {
    display: none !important;
  }

  .mh-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 8px 12px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
  }

  .mh-drawer-logo {
    line-height: 0;
    display: inline-block;
  }

  .mh-drawer-logo img {
    height: 24px;
    width: auto;
    max-width: none;
  }

  .mh-close {
    width: 44px;
    height: 44px;
    background: none;
    border: 0;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
  }

  .mh-close::before,
  .mh-close::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 2px;
    background: #EDE6DA;
  }

  .mh-close::before { transform: translate(-50%, -50%) rotate(45deg); }
  .mh-close::after  { transform: translate(-50%, -50%) rotate(-45deg); }

  /* ---------- Nav rows ---------- */
  .mh-drawer-nav {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .mh-row {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  }

  .mh-row > a {
    flex: 1;
    display: flex;
    align-items: center;
    min-height: 52px;
    padding: 0 20px;
    color: #F1ECE2;
    font-family: 'Jost', sans-serif;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    text-decoration: none;
  }

  .mh-row > a:hover,
  .mh-row > a:focus {
    color: #C29B66;
    text-decoration: none;
  }

  .mh-ext {
    color: #8F8574;
    font-size: 11px;
    letter-spacing: 0;
    margin-left: 6px;
  }

  .mh-toggle-sub {
    width: 50px;
    background: none;
    border: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.07);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .mh-chev {
    border: solid #C29B66;
    border-width: 0 1.5px 1.5px 0;
    padding: 3.5px;
    transform: rotate(45deg);
    transition: transform 0.25s ease;
  }

  .mh-acc.expanded .mh-chev {
    transform: rotate(-135deg);
  }

  /* ---------- Sub-menus ---------- */
  .mh-sub {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    background: #12100D;
  }

  .mh-acc.expanded .mh-sub {
    max-height: 620px;
  }

  .mh-all {
    display: flex;
    align-items: center;
    min-height: 46px;
    padding: 0 20px;
    color: #C29B66;
    font-family: 'Jost', sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }

  .mh-all:hover,
  .mh-all:focus {
    color: #D5B285;
    text-decoration: none;
  }

  .mh-sublist a {
    display: flex;
    align-items: center;
    min-height: 46px;
    padding: 0 20px 0 34px;
    color: #CFC8BB;
    font-family: 'Jost', sans-serif;
    font-size: 11.5px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }

  .mh-sublist a:hover,
  .mh-sublist a:focus {
    color: #C29B66;
    text-decoration: none;
  }

  .mh-sublist.mh-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .mh-grid a {
    min-height: 44px;
    padding: 4px 12px 4px 20px;
    font-size: 11px;
    letter-spacing: 0.1em;
    line-height: 1.3;
  }

  .mh-grid a:nth-child(odd) {
    border-right: 1px solid rgba(255, 255, 255, 0.05);
  }

  /* ---------- Pinned dock ---------- */
  .mh-dock {
    flex-shrink: 0;
    border-top: 1px solid rgba(194, 155, 102, 0.35);
    padding: 14px 16px calc(12px + env(safe-area-inset-bottom));
    background: #14110D;
  }

  .mh-dock-btns {
    display: flex;
    gap: 10px;
  }

  .mh-dock-call {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 46px;
    border: 1px solid #C29B66;
    color: #C29B66;
    font-family: 'Jost', sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    text-decoration: none;
  }

  .mh-dock-call svg {
    width: 13px;
    height: 13px;
    fill: none;
    stroke: #C29B66;
    stroke-width: 1.8;
    stroke-linejoin: round;
  }

  .mh-dock-call:hover,
  .mh-dock-call:focus {
    color: #D5B285;
    border-color: #D5B285;
    text-decoration: none;
  }

  .mh-dock-book {
    flex: 1.2;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 46px;
    background: #AF8855;
    color: #fff;
    font-family: 'Jost', sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    text-decoration: none;
  }

  .mh-dock-book:hover,
  .mh-dock-book:focus {
    background: #9a7648;
    color: #fff;
    text-decoration: none;
  }

  .mh-dock-hours {
    margin: 10px 2px 0;
    font-family: 'Jost', sans-serif;
    font-size: 10.5px;
    letter-spacing: 0.06em;
    color: #8F8574;
    text-align: center;
  }

  /* ---------- Focus visibility ---------- */
  .mh-actions a:focus-visible,
  .mh-menu:focus-visible,
  .mh-close:focus-visible,
  .mh-toggle-sub:focus-visible,
  .mh-drawer a:focus-visible {
    outline: 2px solid #C29B66;
    outline-offset: -2px;
  }
}

/* ---------- Very narrow phones ---------- */
@media (max-width: 374px) {
  .smllogo img {
    height: 26px;
  }

  .mh-actions {
    gap: 6px;
  }

  .mh-book {
    padding: 12px 13px;
  }
}

/* ---------- Tablet refinements (601–991px) ---------- */
@media (min-width: 601px) and (max-width: 991px) {
  .wsmobileheader {
    height: 68px;
    padding: 0 18px 0 26px;
  }

  .smllogo img {
    max-height: 34px;
  }

  .mh-actions {
    gap: 22px;
  }

  .mh-call {
    width: auto;
    height: auto;
    border: 0;
    border-radius: 0;
    gap: 8px;
  }

  .mh-call-num {
    display: inline;
    color: #F1ECE2;
    font-family: 'Jost', sans-serif;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.14em;
    white-space: nowrap;
  }

  .mh-call:hover .mh-call-num,
  .mh-call:focus .mh-call-num {
    color: #C29B66;
  }

  .mh-book {
    padding: 13px 20px;
    font-size: 11.5px;
  }

  .mh-book-more {
    display: inline;
  }

  .hero-section,
  .inner-page-title,
  #hero-12,
  #blog-page,
  #single-post {
    margin-top: 68px;
  }

  .blog-page-section.pt-9 {
    padding-top: 78px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mh-scrim,
  .mh-drawer,
  .mh-sub,
  .mh-chev {
    transition: none;
  }
}
