/*
 * Service plan render-compatibility layer.
 * Ordinary presentation is owned by Divi attributes in ServicePlanPageTransform.php.
 * Every rule below implements an internal-markup relationship, pseudo-element,
 * focus/reduced-motion fallback, or a measured narrow-screen reflow guard.
 */

:where(
  .rrb-service-hero,
  .rrb-service-productnav,
  .rrb-service-intro,
  .rrb-service-camera-plans,
  .rrb-service-alarm-plans,
  .rrb-service-custom,
  .rrb-service-onsite
) :is(h1, h2, h3, p, ul, li) {
  overflow-wrap: anywhere;
}

:where(
  .rrb-service-hero,
  .rrb-service-productnav,
  .rrb-service-intro,
  .rrb-service-camera-plans,
  .rrb-service-alarm-plans,
  .rrb-service-custom,
  .rrb-service-onsite
) .et_pb_text_inner > :last-child {
  margin-block-end: 0;
  padding-block-end: 0;
}

/* Divi owns the values on .et_pb_text_inner; legacy site rules target p/li. */
:where(
  .rrb-service-hero,
  .rrb-service-productnav,
  .rrb-service-intro,
  .rrb-service-camera-plans,
  .rrb-service-alarm-plans,
  .rrb-service-custom,
  .rrb-service-onsite
) .et_pb_text_inner > :is(p, ul, ol),
:where(
  .rrb-service-hero,
  .rrb-service-productnav,
  .rrb-service-intro,
  .rrb-service-camera-plans,
  .rrb-service-alarm-plans,
  .rrb-service-custom,
  .rrb-service-onsite
) .et_pb_text_inner > :is(ul, ol) > li {
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  line-height: inherit;
  text-align: inherit;
  text-transform: inherit;
}

:where(
  .rrb-service-hero,
  .rrb-service-productnav,
  .rrb-service-camera-plans,
  .rrb-service-alarm-plans,
  .rrb-service-custom,
  .rrb-service-onsite
) .et_pb_button:focus-visible {
  outline: 3px solid #066aab;
  outline-offset: 3px;
  box-shadow: 0 0 0 6px rgba(6, 106, 171, 0.2);
}

/* Measured Divi/legacy cascade repair for page-local buttons only. */
:is(#page-container #et-boc) .rrb-service-button--primary.et_pb_button,
:is(#page-container #et-boc) .rrb-service-button--camera.et_pb_button,
:is(#page-container #et-boc) .rrb-service-button--alarm.et_pb_button {
  align-items: center;
  display: inline-flex !important;
  justify-content: center;
  /* Keep the approved value as a fallback, not an override of Builder-local spacing. */
  padding-block: 7px;
  padding-inline: 40px;
  text-align: center !important;
}

:is(#page-container #et-boc) .rrb-service-button--primary.et_pb_button::before,
:is(#page-container #et-boc) .rrb-service-button--primary.et_pb_button::after,
:is(#page-container #et-boc) .rrb-service-button--camera.et_pb_button::before,
:is(#page-container #et-boc) .rrb-service-button--camera.et_pb_button::after,
:is(#page-container #et-boc) .rrb-service-button--alarm.et_pb_button::before,
:is(#page-container #et-boc) .rrb-service-button--alarm.et_pb_button::after {
  display: none !important;
}

/* The Divi Group owns tracks/gap; this only stretches the generated wrappers. */
#page-container #et-boc .rrb-service-hero__actions > .et_pb_button_module_wrapper {
  align-items: stretch;
  display: flex !important;
  margin: 0 !important;
  margin-block-start: 12px !important;
  margin-block-end: 12px !important;
  min-width: 0;
  width: min(288px, 100%) !important;
}

#page-container #et-boc .rrb-service-hero__actions > .et_pb_button_module_wrapper > .et_pb_button {
  height: auto;
  width: 100% !important;
}

@media (min-width: 768px) {
  #page-container #et-boc .rrb-service-hero__actions > .et_pb_button_module_wrapper > .et_pb_button {
    white-space: nowrap !important;
  }
}

.rrb-service-hero__media {
  position: relative;
}

.rrb-service-hero__media > .rrb-camera-hero__badge {
  inset-block-end: 18px;
  inset-inline-end: 18px;
  position: absolute;
  z-index: 3;
}

#page-container #et-boc .rrb-service-plan-card > .rrb-service-plan-badge {
  margin-inline-start: 0 !important;
  margin-left: 0 !important;
}

@media (max-width: 767px) {
  .rrb-service-hero__media > .rrb-camera-hero__badge {
    inset-block-start: auto;
    inset-block-end: 12px;
    inset-inline-end: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  :where(
    .rrb-service-hero,
    .rrb-service-productnav,
    .rrb-service-camera-plans,
    .rrb-service-alarm-plans,
    .rrb-service-custom,
    .rrb-service-onsite
  ) .et_pb_button,
  .rrb-service-plan-card {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
