/* R-models: mobile header and catalog restoration, 2026-10-16.
   Deliberately limited to phones/tablets up to 768px. */
.rm-c1-mobile-guide { display: none; }

@media (max-width: 768px) {
  /* Keep the brand at the left, purchase icons on the right. */
  .rmodels-theme .rm-c1 .rm-c1-main {
    display: flex !important;
    flex-flow: row nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
    column-gap: 6px !important;
  }
  .rmodels-theme .rm-c1 .rm-c1-brand {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    justify-self: start !important;
    flex: 0 1 auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    text-align: left !important;
  }
  .rmodels-theme .rm-c1 .rm-c1-actions {
    display: flex !important;
    flex: 0 0 auto !important;
    justify-content: flex-end !important;
    margin-left: auto !important;
    min-width: 0 !important;
    gap: 0 !important;
  }

  /* Restore all three customer-help links below the search area. */
  .rmodels-theme .rm-c1 .rm-c1-mobile-guide {
    display: flex !important;
    order: 35 !important;
    width: 100% !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: nowrap !important;
    gap: 6px !important;
    min-height: 43px;
    padding: 6px 16px !important;
    border-top: 1px solid #edf2f7;
    background: #fff;
  }
  .rmodels-theme .rm-c1 .rm-c1-mobile-guide a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 3px 0;
    color: var(--c1-ink, #243953);
    font-size: 12px;
    line-height: 18px;
    font-weight: 650;
    white-space: nowrap;
    text-decoration: none;
  }

  /* The catalogue should fill the mobile screen rather than the button width. */
  .rmodels-theme .rm-c1 .rm-c1-mega {
    position: fixed !important;
    inset: 0 !important;
    left: 0 !important;
    right: 0 !important;
    top: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 18px 72px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box !important;
    background: #fff !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    z-index: 9999 !important;
  }
  .rmodels-theme .rm-c1 .rm-c1-mega-mobile-head {
    display: flex !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 3 !important;
    width: 100% !important;
    min-height: 68px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 15px !important;
    padding: 12px 0 !important;
    background: #fff !important;
    border-bottom: 1px solid #e3eaf2;
  }
  .rmodels-theme .rm-c1 .rm-c1-mega-mobile-head strong {
    min-width: 0;
    font-size: 22px;
    line-height: 28px;
  }
  .rmodels-theme .rm-c1 .rm-c1-mega-mobile-head button {
    flex: 0 0 auto;
    min-width: 86px;
    min-height: 42px;
    text-align: center;
  }
  .rmodels-theme .rm-c1 .rm-c1-mega-head {
    display: flex !important;
    width: 100% !important;
    margin-bottom: 16px !important;
  }
  .rmodels-theme .rm-c1 .rm-c1-mega-columns {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 24px !important;
    width: 100% !important;
    min-width: 0 !important;
  }
  .rmodels-theme .rm-c1 .rm-c1-mega-columns > section,
  .rmodels-theme .rm-c1 .rm-c1-mega-item,
  .rmodels-theme .rm-c1 .rm-c1-mega-sub {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }
  .rmodels-theme .rm-c1 .rm-c1-mega-item > a {
    font-size: 15px;
    line-height: 22px;
    padding: 7px 0;
    min-height: 38px;
  }
  .rmodels-theme .rm-c1 .rm-c1-mega-sub a {
    font-size: 14px;
    line-height: 21px;
    min-height: 34px;
    padding: 5px 0;
    overflow-wrap: break-word;
    word-break: normal;
  }
  .rmodels-theme .rm-c1 .rm-c1-mega-help {
    width: 100% !important;
    margin-top: 24px;
  }
}

@media (max-width: 359px) {
  .rmodels-theme .rm-c1 .rm-c1-main {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }
  .rmodels-theme .rm-c1 .rm-c1-mobile-guide {
    padding-left: 12px !important;
    padding-right: 12px !important;
    gap: 3px !important;
  }
  .rmodels-theme .rm-c1 .rm-c1-mobile-guide a {
    font-size: 11px;
    letter-spacing: -0.1px;
  }
}


/* Collapsible, readable category hierarchy on phones; desktop remains unchanged. */
.rm-c1-mobile-category-accordion { display: none; }
@media (max-width: 768px) {
  .rmodels-theme .rm-c1 .rm-c1-mega-columns { display: none !important; }
  .rmodels-theme .rm-c1 .rm-c1-mobile-category-accordion {
    display: block !important;
    width: 100% !important;
  }
  .rmodels-theme .rm-c1 .rm-c1-mobile-category-group {
    margin: 0;
    border-bottom: 1px solid #e7edf5;
  }
  .rmodels-theme .rm-c1 .rm-c1-mobile-category-group summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    list-style: none;
    cursor: pointer;
    min-height: 60px;
    padding: 13px 2px;
    color: #193c74;
    font-size: 16px;
    line-height: 23px;
    font-weight: 750;
  }
  .rmodels-theme .rm-c1 .rm-c1-mobile-category-group summary::-webkit-details-marker { display: none; }
  .rmodels-theme .rm-c1 .rm-c1-mobile-category-group summary::after {
    content: "+";
    color: #245bc3;
    font-size: 24px;
    line-height: 23px;
    font-weight: 400;
  }
  .rmodels-theme .rm-c1 .rm-c1-mobile-category-group[open] summary::after { content: "−"; }
  .rmodels-theme .rm-c1 .rm-c1-mobile-category-content {
    padding: 0 6px 15px 12px;
  }
  .rmodels-theme .rm-c1 .rm-c1-mobile-group-all {
    display: block;
    padding: 5px 0 12px;
    color: #215bc1;
    font-size: 13px;
    font-weight: 700;
  }
  .rmodels-theme .rm-c1 .rm-c1-mobile-category-content .rm-c1-mega-item {
    width: 100%;
    min-width: 0;
  }
  .rmodels-theme .rm-c1 .rm-c1-mobile-category-content .rm-c1-mega-sub {
    padding-left: 12px;
  }
}
