/**
 * CAC Sticky Module - Frontend Styles
 * By TebarDigital
 */

/* Divi Theme Builder Flexbox & Sticky Container Compatibility */
.et_pb_row:has(.cac-sticky),
.et_flex_row:has(.cac-sticky),
.et_pb_row:has(.cac-sticky-module),
.et_flex_row:has(.cac-sticky-module),
.et_pb_row:has([data-cac-sticky]),
.et_flex_row:has([data-cac-sticky]) {
    align-items: stretch !important;
    overflow: visible !important;
}

.et_pb_column:has(.cac-sticky),
.et_flex_column:has(.cac-sticky),
.et_pb_column:has(.cac-sticky-module),
.et_flex_column:has(.cac-sticky-module),
.et_pb_column:has([data-cac-sticky]),
.et_flex_column:has([data-cac-sticky]) {
    display: block !important;
    align-self: stretch !important;
    overflow: visible !important;
    position: relative !important;
    min-height: 100% !important;
}

/* Divi Ancestor Sticky Compatibility */
html:has(.cac-sticky),
body:has(.cac-sticky),
#page-container:has(.cac-sticky),
#et-boc:has(.cac-sticky),
#et-main-area:has(.cac-sticky),
#main-content:has(.cac-sticky),
.et-l--body:has(.cac-sticky),
.et_builder_inner_content:has(.cac-sticky),
html:has(.cac-sticky-module),
body:has(.cac-sticky-module),
#page-container:has(.cac-sticky-module),
#et-boc:has(.cac-sticky-module),
#et-main-area:has(.cac-sticky-module),
#main-content:has(.cac-sticky-module),
.et-l--body:has(.cac-sticky-module),
.et_builder_inner_content:has(.cac-sticky-module) {
    overflow-y: visible !important;
}

/* Base Desktop Sticky Styles */
@media (min-width: 981px) {
    .cac-sticky,
    .cac-sticky-module,
    [data-cac-sticky] {
        position: -webkit-sticky !important;
        position: sticky !important;
        top: 90px; /* Overridden dynamically by cac-sticky.js based on header */
        z-index: 25;
        will-change: transform;
    }
}

/* Responsive Reset on Mobile & Tablet */
@media (max-width: 980px) {
    .cac-sticky,
    .cac-sticky-module,
    [data-cac-sticky] {
        position: static !important;
        transform: none !important;
        top: auto !important;
    }
}
