/*
 * Wide-desktop category rail for standard single-listing pages.
 *
 * The rail and right-lane content are normal-flow members of the listing
 * template's upper grid. Later template sections, including the random
 * related-listing widget, span the same canonical shell beneath them.
 */

.raovat1-single-listing-category-rail {
    display: none;
}

@media (min-width: 1440px) {
    body.raovat1-single-listing-category-rail-active {
        --raovat1-single-category-rail-width: 300px;
        --raovat1-single-category-rail-gap: 30px;
        --raovat1-single-category-shell-width: var(
            --raovat1-layout-shell-width,
            var(
                --raovat1-detail-shell-width,
                var(
                    --raovat1-page-shell-width,
                    calc(100vw - var(--raovat1-page-edge-gutter-total, 40px))
                )
            )
        );
    }

    /*
     * Replace the narrow utility rail only after JavaScript has successfully
     * mounted the category rail into the listing template.
     */
    body.raovat1-single-listing-category-rail-mounted.raovat1-global-nav-active {
        padding-left: 0 !important;
    }

    body.raovat1-single-listing-category-rail-mounted .raovat1-mobile-nav,
    body.raovat1-single-listing-category-rail-mounted .raovat1-desktop-drawer,
    body.raovat1-single-listing-category-rail-mounted .raovat1-desktop-drawer-mask {
        display: none !important;
    }

    body.raovat1-single-listing-category-rail-mounted .raovat1-single-listing-upper-shell {
        --raovat1-detail-shell-width: 100%;
        box-sizing: border-box;
        display: grid;
        width: min(100%, var(--raovat1-single-category-shell-width)) !important;
        max-width: var(--raovat1-single-category-shell-width) !important;
        margin-right: auto !important;
        margin-left: auto !important;
        padding-right: var(--raovat1-content-section-padding-x, 30px);
        padding-left: var(--raovat1-content-section-padding-x, 30px);
        grid-template-columns: var(--raovat1-single-category-rail-width) minmax(0, 1fr);
        grid-template-rows: auto;
        grid-auto-rows: auto;
        column-gap: var(--raovat1-single-category-rail-gap);
        row-gap: 0;
        align-items: start;
    }

    body.raovat1-single-listing-category-rail-mounted
        .raovat1-single-listing-upper-shell
        > .elementor-top-section {
        box-sizing: border-box !important;
        min-width: 0;
        width: 100% !important;
        max-width: 100% !important;
        margin-right: 0 !important;
        margin-left: 0 !important;
        grid-column: 1 / -1;
    }

    body.raovat1-single-listing-category-rail-mounted
        .raovat1-single-listing-upper-shell
        > .raovat1-single-listing-upper-shell__content {
        box-sizing: border-box;
        min-width: 0;
        width: 100%;
        max-width: 100%;
        grid-column: 2;
        grid-row: 1;
    }

    body.raovat1-single-listing-category-rail-mounted
        .raovat1-single-listing-upper-shell
        > .raovat1-single-listing-upper-shell__content
        > .elementor-top-section {
        box-sizing: border-box !important;
        min-width: 0;
        width: 100% !important;
        max-width: 100% !important;
        margin-right: 0 !important;
        margin-left: 0 !important;
    }

    body.raovat1-single-listing-category-rail-mounted
        .raovat1-single-listing-upper-shell
        > .elementor-top-section
        > .elementor-container,
    body.raovat1-single-listing-category-rail-mounted
        .raovat1-single-listing-upper-shell
        > .raovat1-single-listing-upper-shell__content
        > .elementor-top-section
        > .elementor-container {
        box-sizing: border-box !important;
        width: 100% !important;
        max-width: 100% !important;
        margin-right: auto !important;
        margin-left: auto !important;
        padding-right: 0 !important;
        padding-left: 0 !important;
    }

    /*
     * The template already contributes one 30px spacer before the random
     * listings section. Remove its additional top margin so the section
     * rhythm is not doubled, and keep five cards inside the shared inset.
     */
    body.raovat1-single-listing-category-rail-mounted
        .raovat1-single-listing-upper-shell
        .raovat1-single-related-grid-source {
        margin-top: 0 !important;
    }

    body.raovat1-single-listing-category-rail-mounted
        .raovat1-single-listing-upper-shell
        .raovat1-single-related-grid-source
        .raovat1-custom-wiget__grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)) !important;
    }

    body.raovat1-single-listing-category-rail-mounted
        .raovat1-single-listing-upper-shell
        > .raovat1-single-listing-upper-shell__content
        > .raovat1-single-listing-upper-shell__breadcrumbs {
        min-height: 72px;
    }

    body.raovat1-single-listing-category-rail-mounted
        .raovat1-single-listing-upper-shell
        > .raovat1-single-listing-upper-shell__content
        > .raovat1-single-listing-upper-shell__main {
        min-width: 0;
        width: 100%;
    }

    body.raovat1-single-listing-category-rail-mounted
        .raovat1-single-listing-upper-shell--gallery
        > .raovat1-single-listing-upper-shell__content
        > .raovat1-single-listing-upper-shell__gallery-hero {
        box-sizing: border-box;
        min-width: 0;
        width: 100% !important;
        max-width: 100% !important;
        margin:
            var(--raovat1-detail-title-top-breathing, clamp(22px, 1.8vw, 30px))
            0
            22px !important;
        align-self: start;
        justify-self: stretch;
    }

    body.raovat1-single-listing-category-rail-mounted
        .raovat1-single-listing-upper-shell
        > .raovat1-single-listing-category-rail {
        display: flex;
        box-sizing: border-box;
        width: var(--raovat1-single-category-rail-width);
        min-width: 0;
        margin-top: 16px;
        grid-column: 1;
        grid-row: 1;
        align-self: start;
        flex-direction: column;
        gap: 14px;
        color: var(--raovat1-text, #f5f2fa);
        font-family: var(--raovat1-font-family, sans-serif);
    }

    .raovat1-single-listing-category-rail__panel {
        flex: 0 0 auto;
        overflow: hidden;
        background:
            radial-gradient(circle at 90% 5%, rgba(216, 140, 255, 0.08), transparent 38%),
            linear-gradient(145deg, rgba(15, 16, 25, 0.99), rgba(8, 9, 15, 0.99));
        border: 1px solid rgba(216, 140, 255, 0.25);
        border-radius: 12px;
        box-shadow:
            0 18px 40px rgba(0, 0, 0, 0.28),
            inset 0 1px 0 rgba(255, 255, 255, 0.035);
    }

    .raovat1-single-listing-category-rail__heading {
        display: flex;
        min-height: 60px;
        padding: 14px 20px 10px;
        align-items: center;
        gap: 12px;
    }

    .raovat1-single-listing-category-rail__panel--advertising
        .raovat1-single-listing-category-rail__heading {
        min-height: 56px;
        padding-top: 12px;
        padding-bottom: 8px;
    }

    .raovat1-single-listing-category-rail__heading-icon,
    .raovat1-single-listing-category-rail__item-icon,
    .raovat1-single-listing-category-rail__arrow {
        display: inline-flex;
        flex: 0 0 auto;
        align-items: center;
        justify-content: center;
        color: var(--raovat1-purple, #d88cff);
    }

    .raovat1-single-listing-category-rail__heading-icon {
        width: 24px;
        height: 24px;
    }

    .raovat1-single-listing-category-rail__title {
        margin: 0;
        color: var(--raovat1-text, #f5f2fa);
        font-size: 20px;
        font-weight: 760;
        letter-spacing: -0.015em;
        line-height: 1.1;
        text-transform: uppercase;
    }

    .raovat1-single-listing-category-rail__badge {
        margin-left: auto;
        color: var(--raovat1-purple-strong, #e0a4ff);
        font-size: 12px;
        font-weight: 700;
        line-height: 1.1;
        white-space: nowrap;
    }

    .raovat1-single-listing-category-rail__list {
        margin: 0 8px;
        padding: 0;
        overflow: hidden;
        list-style: none;
        background: rgba(255, 255, 255, 0.018);
        border: 1px solid rgba(216, 140, 255, 0.11);
        border-radius: 10px;
    }

    .raovat1-single-listing-category-rail__item {
        margin: 0;
        padding: 0;
    }

    .raovat1-single-listing-category-rail__item + .raovat1-single-listing-category-rail__item {
        border-top: 1px solid rgba(216, 140, 255, 0.1);
    }

    .raovat1-single-listing-category-rail__link {
        display: grid;
        box-sizing: border-box;
        min-height: 52px;
        padding: 8px 14px;
        grid-template-columns: 28px minmax(0, 1fr) 18px;
        align-items: center;
        gap: 10px;
        color: var(--raovat1-text-soft, #eeeaf3);
        border-radius: 8px;
        font-size: 16px;
        font-weight: 480;
        line-height: 1.2;
        text-decoration: none;
        transition:
            color 160ms ease,
            background-color 160ms ease;
    }

    .raovat1-single-listing-category-rail__panel--advertising
        .raovat1-single-listing-category-rail__link {
        min-height: 44px;
        padding-top: 6px;
        padding-bottom: 6px;
    }

    .raovat1-single-listing-category-rail__link:hover {
        color: #ffffff;
        background: rgba(216, 140, 255, 0.09);
    }

    .raovat1-single-listing-category-rail__link:focus-visible,
    .raovat1-single-listing-category-rail__all-link:focus-visible {
        outline: 2px solid var(--raovat1-purple-strong, #e0a4ff);
        outline-offset: -3px;
    }

    .raovat1-single-listing-category-rail__item-icon {
        width: 24px;
        height: 24px;
    }

    .raovat1-single-listing-category-rail__label {
        min-width: 0;
    }

    .raovat1-single-listing-category-rail__arrow {
        width: 18px;
        height: 18px;
    }

    .raovat1-single-listing-category-rail .raovat1-add-listing-menu__icon-svg,
    .raovat1-single-listing-category-rail .raovat1-desktop-subheader__icon-svg {
        width: 100%;
        height: 100%;
    }

    .raovat1-single-listing-category-rail__arrow .raovat1-add-listing-menu__icon-svg {
        stroke-width: 1.9;
    }

    .raovat1-single-listing-category-rail__all-link {
        display: flex;
        box-sizing: border-box;
        min-height: 44px;
        margin: 12px 18px 14px;
        padding: 8px 14px;
        align-items: center;
        justify-content: center;
        gap: 10px;
        color: var(--raovat1-text-soft, #eeeaf3);
        background: rgba(7, 8, 14, 0.46);
        border: 1px solid rgba(216, 140, 255, 0.3);
        border-radius: 9px;
        font-size: 15px;
        font-weight: 560;
        line-height: 1.2;
        text-align: center;
        text-decoration: none;
        transition:
            color 160ms ease,
            background-color 160ms ease,
            border-color 160ms ease;
    }

    .raovat1-single-listing-category-rail__all-link:hover {
        color: #ffffff;
        background: rgba(216, 140, 255, 0.1);
        border-color: rgba(216, 140, 255, 0.5);
    }

    body.raovat1-theme-light .raovat1-single-listing-category-rail__panel {
        background:
            radial-gradient(circle at 90% 5%, rgba(155, 66, 209, 0.09), transparent 38%),
            linear-gradient(145deg, rgba(255, 255, 255, 0.99), rgba(246, 241, 250, 0.99));
        border-color: rgba(132, 68, 177, 0.22);
        box-shadow:
            0 16px 34px rgba(41, 27, 56, 0.13),
            inset 0 1px 0 rgba(255, 255, 255, 0.82);
    }

    body.raovat1-theme-light .raovat1-single-listing-category-rail__list {
        background: rgba(48, 34, 64, 0.025);
        border-color: rgba(48, 34, 64, 0.1);
    }

    body.raovat1-theme-light
        .raovat1-single-listing-category-rail__item
        + .raovat1-single-listing-category-rail__item {
        border-top-color: rgba(48, 34, 64, 0.09);
    }

    body.raovat1-theme-light .raovat1-single-listing-category-rail__link:hover,
    body.raovat1-theme-light .raovat1-single-listing-category-rail__all-link:hover {
        color: #301e3f;
        background: rgba(155, 66, 209, 0.08);
    }

    body.raovat1-theme-light .raovat1-single-listing-category-rail__all-link {
        color: #3f3150;
        background: rgba(255, 255, 255, 0.68);
        border-color: rgba(132, 68, 177, 0.24);
    }

    @media (prefers-color-scheme: light) {
        body.raovat1-theme-auto .raovat1-single-listing-category-rail__panel {
            background:
                radial-gradient(circle at 90% 5%, rgba(155, 66, 209, 0.09), transparent 38%),
                linear-gradient(145deg, rgba(255, 255, 255, 0.99), rgba(246, 241, 250, 0.99));
            border-color: rgba(132, 68, 177, 0.22);
            box-shadow:
                0 16px 34px rgba(41, 27, 56, 0.13),
                inset 0 1px 0 rgba(255, 255, 255, 0.82);
        }

        body.raovat1-theme-auto .raovat1-single-listing-category-rail__list {
            background: rgba(48, 34, 64, 0.025);
            border-color: rgba(48, 34, 64, 0.1);
        }

        body.raovat1-theme-auto
            .raovat1-single-listing-category-rail__item
            + .raovat1-single-listing-category-rail__item {
            border-top-color: rgba(48, 34, 64, 0.09);
        }

        body.raovat1-theme-auto .raovat1-single-listing-category-rail__all-link {
            color: #3f3150;
            background: rgba(255, 255, 255, 0.68);
            border-color: rgba(132, 68, 177, 0.24);
        }

        body.raovat1-theme-auto .raovat1-single-listing-category-rail__link:hover,
        body.raovat1-theme-auto .raovat1-single-listing-category-rail__all-link:hover {
            color: #301e3f;
            background: rgba(155, 66, 209, 0.08);
        }
    }
}

@media (min-width: 1440px) and (prefers-reduced-motion: reduce) {
    .raovat1-single-listing-category-rail__link,
    .raovat1-single-listing-category-rail__all-link {
        transition: none;
    }
}
