/*
 * HR1-RB-C1-R4
 * Mobile category-bar visibility and fit correction.
 * Fixes two confirmed defects:
 * 1. The homepage's older R6-R2 stylesheet hides the shared category bar on mobile.
 * 2. Three full labels are forced into narrow thirds and overlap on offer-detail pages.
 * Desktop rules are intentionally untouched.
 */
.rib360-category-summary-label-mobile { display: none; }

@media (max-width: 720px) {
  /* Override the older homepage-only suppression with higher specificity. */
  html body.rib360-home-hr1 .rib360-oei1-s3-action-directory-shell {
    display: grid !important;
  }

  html body .rib360-oei1-s3-action-directory-shell {
    box-sizing: border-box !important;
    position: relative !important;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    align-items: start !important;
    column-gap: 4px !important;
    row-gap: 0 !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 8px auto 0 !important;
    padding: 0 12px 8px !important;
    overflow: visible !important;
    --rib360-mobile-category-row-height: 46px;
  }

  html body .rib360-oei1-s3-action-directory-shell >
  .rib360-public-category-nav[data-oei1-s3-primary-actions="all-recommended"] {
    grid-column: 1 / span 2 !important;
    position: static !important;
    z-index: auto !important;
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    border: 0 !important;
    background: transparent !important;
  }

  html body .rib360-oei1-s3-action-directory-shell >
  .rib360-public-category-nav[data-oei1-s3-primary-actions="all-recommended"] >
  .rib360-public-category-track {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    align-items: stretch !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    gap: 4px !important;
    overflow: visible !important;
  }

  html body .rib360-oei1-s3-action-directory-shell >
  .rib360-public-category-nav[data-oei1-s3-primary-actions="all-recommended"] >
  .rib360-public-category-track > a {
    box-sizing: border-box !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: var(--rib360-mobile-category-row-height) !important;
    margin: 0 !important;
    padding: 5px 3px !important;
    border: 0 !important;
    border-radius: 10px !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #24384f !important;
    font-size: clamp(10.5px, 2.9vw, 12.5px) !important;
    font-weight: 720 !important;
    line-height: 1.08 !important;
    text-align: center !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    overflow: hidden !important;
  }

  html body .rib360-oei1-s3-action-directory-shell >
  .rib360-public-category-nav[data-oei1-s3-primary-actions="all-recommended"] >
  .rib360-public-category-track > a::before {
    flex: 0 0 13px !important;
    width: 13px !important;
    height: 13px !important;
    margin: 0 !important;
  }

  html body .rib360-oei1-s3-action-directory-shell >
  .rib360-public-category-nav[data-oei1-s3-primary-actions="all-recommended"] >
  .rib360-public-category-track > a.is-active,
  html body .rib360-oei1-s3-action-directory-shell >
  .rib360-public-category-nav[data-oei1-s3-primary-actions="all-recommended"] >
  .rib360-public-category-track > a[aria-current="page"] {
    color: #9b5f00 !important;
    background: rgba(255, 247, 230, 0.88) !important;
  }

  html body .rib360-oei1-s3-action-directory-shell > .rib360-oei1-s3-directory {
    grid-column: 3 !important;
    position: static !important;
    z-index: auto !important;
    display: block !important;
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: var(--rib360-mobile-category-row-height) !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: visible !important;
  }

  html body .rib360-oei1-s3-action-directory-shell >
  .rib360-oei1-s3-directory > summary {
    position: relative !important;
    inset: auto !important;
    box-sizing: border-box !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: var(--rib360-mobile-category-row-height) !important;
    margin: 0 !important;
    padding: 5px 14px 5px 3px !important;
    border: 0 !important;
    border-radius: 10px !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #24384f !important;
    font-size: clamp(10.5px, 2.9vw, 12.5px) !important;
    font-weight: 720 !important;
    line-height: 1.08 !important;
    text-align: center !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    cursor: pointer !important;
    list-style: none !important;
  }

  html body .rib360-oei1-s3-action-directory-shell >
  .rib360-oei1-s3-directory > summary::before {
    flex: 0 0 13px !important;
    width: 13px !important;
    height: 13px !important;
    margin: 0 !important;
    transform: scale(.8667) !important;
    transform-origin: center !important;
  }

  html body .rib360-oei1-s3-action-directory-shell >
  .rib360-oei1-s3-directory > summary::after {
    right: 2px !important;
    width: 10px !important;
    font-size: 13px !important;
  }

  .rib360-category-summary-label-full { display: none !important; }
  .rib360-category-summary-label-mobile { display: inline !important; }

  html body .rib360-oei1-s3-action-directory-shell >
  .rib360-oei1-s3-directory[open] {
    padding-top: 0 !important;
  }

  html body .rib360-oei1-s3-action-directory-shell >
  .rib360-oei1-s3-directory[open] > summary {
    color: #9b5f00 !important;
    background: rgba(255, 247, 230, 0.88) !important;
  }

  /* Expand the catalogue from the third column across the full row in normal flow. */
  html body .rib360-oei1-s3-action-directory-shell >
  .rib360-oei1-s3-directory > .rib360-oei1-s3-directory-grid {
    position: relative !important;
    inset: auto !important;
    transform: translateX(-66.666667%) !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    box-sizing: border-box !important;
    width: 300% !important;
    max-width: none !important;
    max-height: min(54vh, 420px) !important;
    margin: 8px 0 0 !important;
    padding: 10px !important;
    gap: 6px !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    border: 1px solid #d8e0e8 !important;
    border-radius: 16px !important;
    background: #ffffff !important;
    box-shadow: 0 12px 28px rgba(17, 38, 66, 0.10) !important;
  }

  html body .rib360-oei1-s3-directory-grid > li > a {
    min-height: 48px !important;
  }
}

@media (max-width: 350px) {
  html body .rib360-oei1-s3-action-directory-shell {
    padding-inline: 6px !important;
    column-gap: 2px !important;
  }

  html body .rib360-oei1-s3-action-directory-shell >
  .rib360-public-category-nav[data-oei1-s3-primary-actions="all-recommended"] >
  .rib360-public-category-track,
  html body .rib360-oei1-s3-action-directory-shell {
    column-gap: 2px !important;
  }

  html body .rib360-oei1-s3-action-directory-shell >
  .rib360-public-category-nav[data-oei1-s3-primary-actions="all-recommended"] >
  .rib360-public-category-track > a,
  html body .rib360-oei1-s3-action-directory-shell >
  .rib360-oei1-s3-directory > summary {
    gap: 3px !important;
    padding-left: 1px !important;
    font-size: 10px !important;
    letter-spacing: -0.025em !important;
  }
}
