/* "Grandstream" mega-menu dropdown (#cbp-hrmenu-tab-68). Markup from tools/menu/build_grandstream_menu.php.
   Loaded after ift-megamenu.css; selectors start with #cbp-hrmenu #cbp-hrmenu-tab-68 so they win over the shared tab rules.
   Family rail (switched by ift-megamenu.js data-apm-dept / data-apm-panel) + series cards + "Which one do I need?" strip.
   The dropdown has one fixed height so it does not jump between families; it must fit a 1280x720 screen (about 490px). */

@media (min-width: 992px) {
  #cbp-hrmenu #cbp-hrmenu-tab-68 .cbp-hrsub-inner {
    padding: 0 !important;
    background: #fff !important;
  }
  #cbp-hrmenu #cbp-hrmenu-tab-68 .cbp-hrsub-inner > .container,
  #cbp-hrmenu #cbp-hrmenu-tab-68 .menu_row,
  #cbp-hrmenu #cbp-hrmenu-tab-68 .cbp-menu-column {
    margin: 0 auto;
    padding: 0;
  }
  #cbp-hrmenu #cbp-hrmenu-tab-68 .cbp-menu-column-inner {
    padding: 0 !important;
    background: none !important;
    border: 0 !important;
    border-radius: 0;
  }

  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    height: 476px;
    color: #111827;
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    font-size: 13px;
    line-height: 1.4;
    text-align: left;
  }
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm a {
    color: inherit;
    text-decoration: none;
  }
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm p,
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm ul {
    margin: 0;
    padding: 0;
  }
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm ul {
    list-style: none;
  }

  /* Family rail */
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm-rail {
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 0 0 8px;
    border-right: 1px solid #e5e7eb;
    background: #f5f6f7;
  }
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm-rail__logo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    height: 46px;
    margin-bottom: 6px;
    padding: 0 16px 0 17px;
    border-bottom: 1px solid #e5e7eb;
  }
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm-rail__logo img {
    display: block;
    width: 116px;
    height: auto;
  }
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm-rail__logo span {
    color: #3f6212;
    font-size: 12.5px;
    font-weight: 700;
    white-space: nowrap;
  }
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm-rail__logo:hover span {
    text-decoration: underline;
    text-underline-offset: 3px;
  }
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm-rail__note {
    margin: auto 16px 4px 18px !important;
    padding-top: 8px;
    border-top: 1px solid #e5e7eb;
    color: #6b7280;
    font-size: 11.5px;
    line-height: 1.4;
  }
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm-rail__note strong {
    color: #374151;
    font-weight: 700;
  }
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm-fam {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 11px;
    width: 100%;
    margin: 0;
    padding: 6px 12px 6px 15px;
    border: 0;
    border-left: 3px solid transparent;
    background: none;
    color: #1f2937;
    font: inherit;
    text-align: left;
    cursor: pointer;
  }
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm-fam:hover {
    background: #eceef0;
  }
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm-fam.is-active {
    border-left-color: #8cd400;
    background: #fff;
  }
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm-fam:focus-visible {
    outline: 2px solid #8cd400;
    outline-offset: -2px;
  }
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm-fam__img {
    display: flex;
    flex: 0 0 42px;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #fff;
  }
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm-fam__img img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
  }
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm-fam__txt {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
  }
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm-fam__l {
    color: #1f2937;
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.3;
  }
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm-fam__s {
    overflow: hidden;
    color: #6b7280;
    font-size: 11.5px;
    line-height: 1.35;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm-fam.is-active .gsm-fam__l {
    color: #111827;
    font-weight: 700;
  }

  /* Family panel */
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm-panels {
    position: relative;
    min-width: 0;
  }
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm-panel {
    position: absolute;
    inset: 0;
    display: none;
    flex-direction: column;
    padding: 0 22px 14px;
  }
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm-panel.is-active {
    display: flex;
  }
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm-head {
    display: flex;
    flex: 0 0 auto;
    align-items: baseline;
    gap: 14px;
    height: 44px;
    padding-top: 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
  }
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm-head__t {
    flex: none;
    color: #111827;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.25;
    white-space: nowrap;
  }
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm-head__d {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    color: #6b7280;
    font-size: 13px;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm-head__all {
    flex: none;
    color: #3f6212 !important;
    font-size: 13.5px;
    font-weight: 700;
    white-space: nowrap;
  }
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm-head__all:hover {
    text-decoration: underline !important;
    text-underline-offset: 3px;
  }

  /* Series cards: each card spans the six grid rows (photo, name, best for, facts, models, price) through a subgrid,
     so every row lines up across the family; the photo takes whatever height is left. */
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm-cards {
    display: grid;
    flex: 1 1 auto;
    grid-template-columns: repeat(var(--gsm-n, 4), minmax(0, 1fr));
    grid-template-rows: minmax(0, 1fr) repeat(5, auto);
    column-gap: 10px;
    min-height: 0;
  }
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm-card {
    display: grid;
    grid-row: 1 / -1;
    grid-template-rows: subgrid;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    transition: border-color .12s ease;
  }
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm-card:hover {
    border-color: #8cd400;
  }
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm-card > :not(.gsm-card__img) {
    margin-right: 11px;
    margin-left: 11px;
  }
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm-card__img {
    position: relative;
    display: block;
    min-height: 0;
    background: #f5f6f7;
  }
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm-card__img img {
    position: absolute;
    top: 4px;
    left: 6px;
    width: calc(100% - 12px);
    height: calc(100% - 8px);
    object-fit: contain;
  }
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm-card__badge {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 0 6px;
    border: 1px solid #d6e7b0;
    border-radius: 4px;
    background: #fff;
    color: #3f6212;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
  }
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm-card__name {
    padding-top: 9px;
    color: #111827;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
  }
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm-card:hover .gsm-card__name {
    color: #3f6212;
  }
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm-card__for {
    display: -webkit-box;
    margin-top: 1px;
    overflow: hidden;
    color: #6b7280;
    font-size: 12px;
    line-height: 1.35;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm-card__facts {
    margin-top: 6px;
  }
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm-card__facts li {
    position: relative;
    padding-left: 11px;
    color: #374151;
    font-size: 12px;
    line-height: 1.4;
  }
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm-card__facts li::before {
    content: '';
    position: absolute;
    top: .6em;
    left: 1px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #8cd400;
  }
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm-card__models {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
  }
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm-card__models span {
    margin-right: 1px;
    color: #9ca3af;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .02em;
  }
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm-card__models a {
    padding: 1px 6px;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    background: #fff;
    color: #1f2937 !important;
    font-size: 11.5px;
    font-weight: 600;
    line-height: 17px;
    white-space: nowrap;
    transition: border-color .12s ease, color .12s ease;
  }
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm-card__models a:hover,
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm-card__models a:focus-visible {
    border-color: #8cd400;
    background: #f7fbef;
    color: #3f6212 !important;
  }
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm-card__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 26px;
    margin-top: 8px;
    margin-bottom: 7px;
    padding-top: 6px;
    border-top: 1px solid #f0f1f3;
  }
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm-card__from {
    overflow: hidden;
    color: #6b7280;
    font-size: 12px;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm-card__from strong {
    color: #111827;
    font-size: 13.5px;
    font-weight: 700;
  }
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm-card__foot a {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: 1px;
    color: #3f6212 !important;
    font-size: 12.5px;
    font-weight: 700;
  }
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm-card__foot a:hover {
    text-decoration: underline !important;
    text-underline-offset: 3px;
  }

  /* "Which one do I need?" strip */
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm-help {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 18px;
    margin-top: 12px;
    padding: 9px 16px;
    border-radius: 8px;
    background: #f5f6f7;
  }
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm-help__img {
    display: block;
    flex: 0 0 104px;
    height: 58px;
    margin: -2px 0 -2px -8px;
    overflow: hidden;
    border-radius: 6px;
  }
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm-help__img img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm-help__t {
    flex: 0 0 auto;
    width: 92px;
    color: #111827;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
  }
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm-help__l {
    display: grid;
    flex: 1 1 auto;
    grid-auto-columns: minmax(0, 1fr);
    grid-auto-flow: column;
    gap: 18px;
    min-width: 0;
  }
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm-help__l li {
    color: #4b5563;
    font-size: 12px;
    line-height: 1.38;
  }
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm-help__l strong {
    display: block;
    color: #111827;
    font-size: 12.5px;
    font-weight: 700;
  }
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm-help__ask {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: 1px;
    color: #3f6212 !important;
    font-size: 12.5px;
    font-weight: 700;
    white-space: nowrap;
  }
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm-help__ask:hover {
    text-decoration: underline !important;
    text-underline-offset: 3px;
  }
}

@media (min-width: 992px) and (max-width: 1365px) {
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm { grid-template-columns: 236px minmax(0, 1fr); }
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm-panel { padding: 0 18px 14px; }
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm-fam { gap: 9px; padding-right: 10px; padding-left: 12px; }
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm-cards { column-gap: 8px; }
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm-cards[data-n="6"] .gsm-card > :not(.gsm-card__img) { margin-right: 9px; margin-left: 9px; }
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm-cards[data-n="6"] .gsm-card__name { font-size: 13.5px; }
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm-cards[data-n="6"] .gsm-card__models a { padding: 1px 5px; font-size: 11px; }
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm-help { gap: 14px; padding: 9px 14px; }
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm-help__l { gap: 14px; }
}

@media (min-width: 992px) and (max-width: 1199px) {
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm { grid-template-columns: 200px minmax(0, 1fr); }
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm-fam__img { display: none; }
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm-head__d,
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm-help__l li:nth-child(n+4),
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm-help__ask { display: none; }
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm-card__facts li:nth-child(n+3) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm-card,
  #cbp-hrmenu #cbp-hrmenu-tab-68 .gsm-card__models a { transition: none; }
}
