.ec-sb3-anchor,
.ec-sb3-floating-host {
    --ec-sb3-rail-width: 460px;
    --ec-sb3-max-rail-width: 460px;
    --ec-sb3-min-rail-width: 320px;
    --ec-sb3-outer-margin: 16px;
    --ec-sb3-gap: 32px;
    --ec-sb3-sticky-top: 20px;
    --ec-sb3-effective-top: var(--ec-sb3-sticky-top);
    box-sizing: border-box;
}

/* Tablet/mobile fallback: modules become normal content after the page. */
.ec-sb3-anchor {
    position: relative;
    clear: both;
    width: 100%;
    margin: 36px 0 0;
}

.ec-sb3-anchor.ec-sb3-is-docked {
    height: 0;
    margin: 0;
    overflow: visible;
}

.ec-sb3-rail,
.ec-sb3-panel,
.ec-sb3-module,
.ec-sb3-related-card,
.ec-sb3-book-card {
    box-sizing: border-box;
}

.ec-sb3-rail {
    position: relative;
    width: 100%;
    margin: 0;
}

.ec-sb3-panel {
    width: 100%;
    padding: 25px;
    border: 0;
    border-left: 5px solid #5F6FB2;
    border-radius: 8px;
    background: #f9faff;
    box-shadow: none;
    color: #5f5f5f;
    font-family: 'ABeeZee', sans-serif;
    font-size: 18px;
    line-height: 1.8;
}

/* Desktop sidebar host. It never wraps or resizes Elementor content. */
.ec-sb3-floating-host {
    position: absolute;
    z-index: 20;
    width: var(--ec-sb3-rail-width);
    margin: 0;
    padding: 0;
    overflow: visible;
    pointer-events: none;
}

.ec-sb3-floating-host .ec-sb3-rail {
    width: 100%;
    pointer-events: none;
}

.ec-sb3-floating-host .ec-sb3-panel {
    pointer-events: auto;
}

.ec-sb3-floating-host.ec-sb3-is-normal .ec-sb3-panel {
    position: relative;
    top: 0;
}

.ec-sb3-floating-host.ec-sb3-is-sticky .ec-sb3-panel {
    position: sticky;
    top: var(--ec-sb3-effective-top);
}

.ec-sb3-module + .ec-sb3-module {
    margin-top: 28px;
    padding-top: 28px;
    border-top: 1px solid rgba(95, 111, 178, 0.18);
}

.ec-sb3-section-title {
    margin: 0 0 20px;
    color: #5F6FB2;
    font-family: 'ABeeZee', sans-serif;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.35;
    text-align: center;
}

.ec-sb3-related-list,
.ec-sb3-book-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 22px;
}

.ec-sb3-related-card {
    display: block;
    min-width: 0;
    overflow: hidden;
    border: 1px solid rgba(95, 111, 178, 0.20);
    border-radius: 10px;
    background: #fff;
    color: #5F6FB2 !important;
    font-family: 'ABeeZee', sans-serif;
    text-decoration: none !important;
    box-shadow: 0 3px 12px rgba(95, 111, 178, 0.08);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.ec-sb3-related-card:hover,
.ec-sb3-related-card:focus {
    color: #5F6FB2 !important;
    border-color: #5F6FB2;
    text-decoration: none !important;
    transform: translateY(-2px);
    box-shadow: 0 7px 18px rgba(95, 111, 178, 0.14);
}

.ec-sb3-related-media {
    display: block;
    width: 100%;
    overflow: hidden;
    background: #fff;
    border-bottom: 1px solid rgba(95, 111, 178, 0.14);
}

.ec-sb3-related-image {
    display: block;
    width: 100%;
    height: auto;
    margin: 0;
}

.ec-sb3-related-title {
    display: block;
    min-width: 0;
    padding: 16px 18px 18px;
    color: #5F6FB2;
    font-family: 'ABeeZee', sans-serif;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.45;
    text-align: center;
    overflow-wrap: anywhere;
}

/* Book module. Elementor's own button class supplies the site's button styling. */
.ec-sb3-book-card {
    padding: 18px;
    border: 1px solid rgba(95, 111, 178, 0.20);
    border-radius: 10px;
    background: #fff;
    color: #5f5f5f;
    font-family: 'ABeeZee', sans-serif;
    text-align: center;
    box-shadow: 0 3px 12px rgba(95, 111, 178, 0.08);
}

.ec-sb3-book-cover-link {
    display: block;
    color: inherit !important;
    text-decoration: none !important;
}

.ec-sb3-book-image {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: 440px;
    margin: 0 auto;
    border-radius: 10px;
}

.ec-sb3-book-title {
    margin: 16px 0 9px;
    color: #5F6FB2;
    font-family: 'ABeeZee', sans-serif;
    font-size: 21px;
    line-height: 1.4;
    text-align: center;
}

.ec-sb3-book-title a {
    color: #5F6FB2 !important;
    text-decoration: none !important;
}

.ec-sb3-book-text {
    margin: 0 0 16px;
    color: #5f5f5f;
    font-family: 'ABeeZee', sans-serif;
    font-size: 17px;
    line-height: 1.7;
    text-align: center;
}

.ec-sb3-book-button.elementor-button {
    display: inline-block;
    text-decoration: none !important;
}

/* Desktop host shows desktop count; bottom/mobile anchor shows mobile count. */
.ec-sb3-mobile-only { display: none !important; }
.ec-sb3-anchor .ec-sb3-mobile-only { display: block !important; }
.ec-sb3-anchor .ec-sb3-desktop-only { display: none !important; }

/* Bottom fallback is wider and can use two columns on tablets. */
.ec-sb3-anchor .ec-sb3-panel {
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

@media (min-width: 681px) {
    .ec-sb3-anchor .ec-sb3-related-list,
    .ec-sb3-anchor .ec-sb3-book-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .ec-sb3-anchor { margin-top: 28px; }
    .ec-sb3-panel { padding: 14px; border-radius: 14px; }
    .ec-sb3-section-title { font-size: 23px; }
    .ec-sb3-related-title { font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) {
    .ec-sb3-related-card { transition: none; }
}
