/* RBS products mega menu. Desktop: a full-width panel under the header row.
   Mobile: the same markup flattens into an accordion inside Kadence's drawer.
   1024px is where Kadence swaps the desktop header for the mobile one. */

.rbs-mega-panel a { text-decoration: none; }
.rbs-mega-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.rbs-mega-head > a {
  font-weight: 700; font-size: .8rem; letter-spacing: .05em;
  text-transform: uppercase; color: #1d1f21; line-height: 1.3;
}
.rbs-mega-head > a:hover, .rbs-mega-head > a:focus { color: #aa1122; }
.rbs-mega-links { list-style: none; margin: .5rem 0 0; padding: 0; }
.rbs-mega-links a {
  color: #41464b; font-size: .92rem; display: block;
  padding: .26rem 0 .26rem .85rem; position: relative;
}
.rbs-mega-links a::before { content: "\203A"; position: absolute; left: 0; color: #aa1122; }
.rbs-mega-links a:hover, .rbs-mega-links a:focus { color: #aa1122; }
.rbs-mega-all a { font-weight: 700; color: #aa1122; }
.rbs-mega-cta {
  display: inline-block; font-size: .86rem; font-weight: 700; color: #aa1122;
  border: 1px solid #e3d3d6; border-radius: 4px; padding: .5rem .85rem; background: #fdf7f8;
}
.rbs-mega-cta:hover, .rbs-mega-cta:focus { background: #aa1122; color: #fff; border-color: #aa1122; }
.rbs-mega-cta-alt { margin-left: auto; background: #aa1122; color: #fff; border-color: #aa1122; }
.rbs-mega-cta-alt:hover, .rbs-mega-cta-alt:focus { background: #8c0e1c; }

/* ---------------- desktop ---------------- */
@media (min-width: 1025px) {
  /* The panel is absolutely positioned against the header row, so every
     ancestor between it and that row must stay static. */
  .site-main-header-wrap .site-header-row-container-inner { position: relative; }
  .main-navigation:has(.rbs-has-mega),
  .main-navigation:has(.rbs-has-mega) .primary-menu-container,
  .site-header-item:has(.rbs-has-mega),
  li.rbs-has-mega { position: static; }

  .rbs-mega-panel {
    position: absolute; top: 100%; left: 0; right: 0; z-index: 250;
    background: #fff; border-top: 3px solid #aa1122;
    box-shadow: 0 14px 34px rgba(0, 0, 0, .16);
    opacity: 0; visibility: hidden; transform: translateY(-6px);
    transition: opacity .14s ease, transform .14s ease, visibility .14s;
  }
  li.rbs-has-mega:hover > .rbs-mega-panel,
  li.rbs-has-mega:focus-within > .rbs-mega-panel {
    opacity: 1; visibility: visible; transform: none;
  }
  .rbs-mega-inner { max-width: 1180px; margin: 0 auto; padding: 1.6rem 1.5rem 1.2rem; }
  /* Multi-column, not grid: several categories have no children, and grid
     rows would size to the tallest column and leave ragged gaps. Columns
     let the blocks pack tight regardless of how uneven they are. */
  .rbs-mega-grid { column-count: 4; column-gap: 2.2rem; }
  .rbs-mega-col { break-inside: avoid; margin-bottom: 1.35rem; }
  @media (min-width: 1400px) { .rbs-mega-grid { column-count: 5; } }
  .rbs-mega-toggle { display: none; }
  .rbs-mega-promo {
    display: flex; flex-wrap: wrap; gap: .6rem; align-items: center;
    border-top: 1px solid #eee; margin-top: 1.3rem; padding-top: 1rem;
  }
}

/* ---------------- mobile drawer ---------------- */
@media (max-width: 1024px) {
  .rbs-mega-panel {
    position: static; opacity: 1; visibility: visible;
    border: 0; box-shadow: none; background: transparent;
  }
  .rbs-mega-inner { padding: 0 0 .5rem; }
  .rbs-mega-grid { display: block; }
  .rbs-mega-col { border-bottom: 1px solid rgba(0, 0, 0, .08); }
  .rbs-mega-head { min-height: 48px; padding-left: .75rem; }
  .rbs-mega-head > a { flex: 1; display: flex; align-items: center; min-height: 48px; font-size: .88rem; }
  .rbs-mega-toggle {
    flex: 0 0 48px; width: 48px; height: 48px; border: 0;
    background: transparent; color: inherit; cursor: pointer; position: relative;
  }
  .rbs-mega-toggle::before {
    content: ""; position: absolute; top: 50%; left: 50%;
    width: 9px; height: 9px;
    border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
    transform: translate(-50%, -70%) rotate(45deg); transition: transform .15s ease;
  }
  .rbs-mega-toggle[aria-expanded="true"]::before { transform: translate(-50%, -30%) rotate(225deg); }
  .rbs-mega-links { display: none; margin: 0; padding: 0 0 .5rem 1.5rem; }
  .rbs-mega-links.is-open { display: block; }
  .rbs-mega-links a { min-height: 44px; display: flex; align-items: center; padding: .5rem 0 .5rem .85rem; }
  .rbs-mega-promo { display: flex; flex-direction: column; gap: .5rem; padding: .9rem .75rem 0; }
  .rbs-mega-cta { text-align: center; padding: .8rem 1rem; }
  .rbs-mega-cta-alt { margin-left: 0; }
}
