/* Mobile refinement for the current BRAVEST WordPress/Divi runtime.
   Enqueue after every current BRAVEST stylesheet. Desktop starts at 981px. */
@media (min-width: 981px) {
  body.home.et-db #et-boc .et-l .bravest-hero .bravest-showroom-link {
    bottom: calc(8.6% + 38px + 24px);
    margin-bottom: 0 !important;
  }
}

@media (max-width: 980px) {
  body.et-db #et-boc .et-l :is(.bravest-home, .brv-section, .brv-page, .bravest-product) {
    font-size: 16px;
    line-height: 1.6;
  }

  body.et-db #et-boc .et-l :is(.bravest-home, .brv-section, .brv-page, .bravest-product) h1,
  body.et-db #et-boc .et-l .brv3-products-hero-copy h1,
  body.et-db #et-boc .et-l .bravest-product-hero h1 {
    font-size: clamp(29px, 4.7vw, 43px) !important;
    line-height: 1.15;
  }

  body.et-db #et-boc .et-l :is(.bravest-home, .brv-section, .brv-page, .bravest-product) h2,
  body.et-db #et-boc .et-l :is(.brv3-types-heading, .brv3-products-inquiry, .brv-home-map__address) h2 {
    font-size: clamp(25px, 4vw, 34px) !important;
    line-height: 1.18;
  }

  body.et-db #et-boc .et-l :is(.bravest-home, .brv-section, .brv-page, .bravest-product) h3 {
    font-size: clamp(20px, 2.8vw, 25px);
    line-height: 1.25;
  }

  body.et-db #et-boc .et-l :is(.bravest-about-copy, .bravest-reference-description, .brv3-card-summary,
    .brv3-types-heading, .brv-lead, .brv-card-body > p, .bravest-product-subtitle) {
    font-size: 16px;
    line-height: 1.6;
  }

  body.et-db #et-boc .et-l :is(.bravest-display, .brv3-hero-lead) {
    font-size: clamp(25px, 4vw, 34px);
    line-height: 1.26;
  }

  body.et-db #et-boc .et-l .bravest-products .bravest-category .et_pb_module_header {
    font-size: 15px;
    line-height: 1.3;
  }

  body.et-db #et-boc .et-l .brv-card-body h2 {
    font-size: 24px !important;
  }

  /* The shared product template sits outside Divi's .et-l page wrapper. */
  body.et-db #main-content.bravest-product {
    font-size: 16px;
    line-height: 1.6;
  }

  body.et-db #main-content.bravest-product h1 {
    font-size: clamp(29px, 4.7vw, 43px);
    line-height: 1.15;
  }

  body.et-db #main-content.bravest-product h2 {
    font-size: clamp(25px, 4vw, 34px);
    line-height: 1.18;
  }

  body.et-db #main-content.bravest-product h3 {
    font-size: clamp(20px, 2.8vw, 25px);
    line-height: 1.25;
  }

  body.et-db #main-content.bravest-product .bravest-product-subtitle {
    font-size: 16px;
    line-height: 1.6;
  }

  /* The native Text/Image modules remain in their existing editable order. */
  body.home.et-db #et-boc .et-l .bravest-home.bravest-hero {
    box-sizing: border-box;
    height: auto;
    min-height: 500px;
    min-height: max(500px, calc(100vh - var(--brv-mobile-admin-offset, 0px)));
    min-height: max(500px, calc(100svh - var(--brv-mobile-admin-offset, 0px)));
    max-height: none;
  }

  body.home.et-db #et-boc .et-l .bravest-hero-row {
    height: auto;
    min-height: inherit;
  }

  body.home.et-db #et-boc .et-l .bravest-hero-row > .et_pb_column {
    box-sizing: border-box;
    display: grid;
    height: auto;
    min-height: inherit;
    grid-template-rows: minmax(min-content, 1fr) auto auto;
    row-gap: 16px;
    padding: clamp(110px, 18vh, 170px) 7vw max(22px, env(safe-area-inset-bottom, 0px));
    padding-top: clamp(110px, 18svh, 170px);
  }

  body.home.et-db #et-boc .et-l .bravest-hero :is(.bravest-hero-copy, .bravest-showroom-link, .bravest-social-links) {
    position: relative;
    inset: auto;
    width: 100%;
    margin: 0 !important;
    padding: 0;
  }

  body.home.et-db #et-boc .et-l .bravest-hero .bravest-hero-copy {
    grid-row: 1;
    align-self: center;
    padding-bottom: clamp(18px, 6svh, 55px);
  }

  body.home.et-db #et-boc .et-l .bravest-hero .bravest-hero-copy h1 {
    font-size: clamp(25px, 6.5vw, 43px) !important;
    line-height: 1.15;
  }

  body.home.et-db #et-boc .et-l .bravest-hero .bravest-hero-copy p {
    margin-top: 14px;
    font-size: clamp(25px, 6.2vw, 40px);
    line-height: 1.25;
  }

  body.home.et-db #et-boc .et-l .bravest-hero .bravest-showroom-link {
    grid-row: 2;
    align-self: end;
  }

  body.home.et-db #et-boc .et-l .bravest-showroom-link a {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 420px;
    min-height: 44px;
    margin: 0 auto;
    padding: 4px 6px;
    font-size: 11px;
    line-height: 1.65;
    letter-spacing: .17em;
  }

  body.home.et-db #et-boc .et-l .bravest-hero .bravest-social-links {
    grid-row: 3;
  }

  body.home.et-db #et-boc .et-l .bravest-social-links :is(.brv-socials, p) {
    gap: 15px;
    margin: 0;
    line-height: 1;
  }

  body.home.et-db #et-boc .et-l .bravest-social-links a[data-social] {
    width: 44px;
    height: 44px;
    min-width: 44px;
    padding: 10px;
  }

  /* A smaller arrow drawing retains a 44px keyboard and touch target. */
  body.et-db #et-boc .et-l .brv-review-carousel > .brv-carousel-controls {
    position: static;
    inset: auto;
    display: flex;
    flex-flow: row nowrap;
    justify-content: center;
    align-items: center;
    width: 100%;
    gap: 9px;
    margin: 16px 0 0;
    padding: 0;
  }

  body.et-db #et-boc .et-l .brv-review-carousel > .brv-carousel-controls[hidden] {
    display: none !important;
  }

  body.et-db #et-boc .et-l .brv-review-carousel .brv-carousel-controls > [data-brv-dots] {
    display: none;
  }

  body.et-db #et-boc .et-l .brv-review-carousel .brv-carousel-controls > :is([data-prev], [data-next]) {
    position: static;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    margin: 0;
    padding: 13px;
    border: 1px solid #b7b1b0;
    background: #fff;
    color: #393536;
    transform: none;
  }

  body.et-db #et-boc .et-l .brv-review-carousel .brv-carousel-controls > :is([data-prev], [data-next]) svg {
    width: 17px;
    height: 17px;
  }

  body.et-db #et-boc .et-l .brv-review-carousel .brv-carousel-controls > :is([data-prev], [data-next]):hover {
    background: #393536;
    color: #fff;
  }

  body.et-db #et-boc .et-l .brv-review-carousel :is(.brv-review-excerpt, .brv-review-details blockquote) {
    font-size: 15px;
    line-height: 1.5;
  }

  body.et-db #et-boc .et-l .brv-review-carousel .brv-review-author {
    font-size: 17px;
  }

  /* The script enables fixed positioning only after measuring the native header. */
  body.brv-mobile-refined.et-db #et-boc .et-l .bravest-header.et_pb_section {
    position: fixed;
    inset: var(--brv-mobile-admin-offset, 0px) 0 auto;
    z-index: 1000;
    box-sizing: border-box;
    padding: max(14px, env(safe-area-inset-top, 0px)) 0 12px !important;
    transition: padding .2s ease, background-color .2s ease, box-shadow .2s ease;
  }

  body.brv-mobile-refined.et-db #et-boc .et-l .bravest-header .bravest-header-row {
    grid-template-columns: minmax(0, 1fr) 62px;
    align-items: center;
    padding-right: max(17px, env(safe-area-inset-right, 0px));
  }

  body.brv-mobile-refined.et-db #et-boc .et-l .bravest-header .bravest-header-row > .bravest-header-logo-column {
    width: clamp(215px, 75vw, 350px) !important;
    max-width: 100% !important;
    transition: width .2s ease;
  }

  body.brv-mobile-refined.et-db #et-boc .et-l .bravest-header .bravest-header-logo {
    height: 54px;
    padding: 10px 25px 10px 12%;
    transition: height .2s ease, padding .2s ease;
  }

  body.brv-mobile-refined.et-db #et-boc .et-l .bravest-header .bravest-header-menu {
    padding: 0;
  }

  body.brv-mobile-refined.et-db #et-boc .et-l .bravest-header .mobile_menu_bar {
    width: 48px;
    min-width: 48px;
    height: 48px;
    min-height: 48px;
  }

  body.brv-mobile-refined.et-db #et-boc .et-l .bravest-header .mobile_menu_bar::before {
    width: 32px;
    height: 32px;
    transition: width .2s ease, height .2s ease;
  }

  body.brv-mobile-refined.et-db #et-boc .et-l .bravest-header .et_mobile_menu {
    top: calc(100% + 14px);
    right: 0;
    box-sizing: border-box;
    width: min(90vw, 500px);
    max-height: calc(100vh - var(--brv-mobile-header-height, 80px) - var(--brv-mobile-admin-offset, 0px) - 16px);
    max-height: calc(100svh - var(--brv-mobile-header-height, 80px) - var(--brv-mobile-admin-offset, 0px) - 16px);
    overflow-y: auto !important;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }

  body.brv-mobile-refined.et-db #et-boc .et-l .bravest-header.brv-mobile-header--compact {
    padding-top: max(6px, env(safe-area-inset-top, 0px)) !important;
    padding-bottom: 6px !important;
    background: rgb(57 53 54 / 97%) !important;
    box-shadow: 0 3px 16px rgb(0 0 0 / 12%);
  }

  body.brv-mobile-refined.et-db #et-boc .et-l .bravest-header.brv-mobile-header--compact .bravest-header-row > .bravest-header-logo-column {
    width: clamp(176px, 58vw, 260px) !important;
  }

  body.brv-mobile-refined.et-db #et-boc .et-l .bravest-header.brv-mobile-header--compact .bravest-header-logo {
    height: 44px;
    padding-top: 8px;
    padding-bottom: 8px;
    padding-right: 20px;
  }

  body.brv-mobile-refined.et-db #et-boc .et-l .bravest-header.brv-mobile-header--compact .mobile_menu_bar::before {
    width: 29px;
    height: 29px;
  }

  body.brv-mobile-refined.et-db #et-boc .et-l .bravest-header.brv-mobile-header--menu-open {
    background: #393536 !important;
  }

  body.brv-mobile-refined :is(.brv-mobile-header-spacer) {
    display: block;
    height: var(--brv-mobile-header-rest-height, 80px);
    pointer-events: none;
  }

  body.brv-mobile-refined :is(#main-content [id], .brv-section, .bravest-product-section) {
    scroll-margin-top: calc(var(--brv-mobile-header-height, 80px) + var(--brv-mobile-admin-offset, 0px) + 16px);
  }
}

@media (max-width: 640px) {
  body.et-db #et-boc .et-l .brv3-products-hero-copy .brv3-hero-lead {
    font-size: 25px;
  }

  body.et-db #et-boc .et-l .bravest-reference-heading .bravest-display {
    font-size: 29px;
  }

  body.et-db #et-boc .et-l .brv-pergola-hero__copy h2 {
    font-size: clamp(28px, 7vw, 36px);
  }
}

/* A short landscape screen needs natural vertical room for readable content. */
@media (max-width: 980px) and (max-height: 520px) {
  body.home.et-db #et-boc .et-l .bravest-hero-row > .et_pb_column {
    padding-top: 100px;
  }

  body.home.et-db #et-boc .et-l .bravest-hero .bravest-hero-copy {
    padding-bottom: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.brv-mobile-refined.et-db #et-boc .et-l .bravest-header,
  body.brv-mobile-refined.et-db #et-boc .et-l .bravest-header :is(.bravest-header-logo-column, .bravest-header-logo),
  body.brv-mobile-refined.et-db #et-boc .et-l .bravest-header .mobile_menu_bar::before {
    transition: none;
  }
}
