.ims-ac {
    --ims-ac-text: #20252b;
    --ims-ac-muted: #868a90;
    --ims-ac-line: #e7e7e7;
    --ims-ac-active: #f1f1f1;
    --ims-ac-danger: #d92532;
    box-sizing: border-box;
    color: var(--ims-ac-text);
}

.ims-ac *,
.ims-ac *::before,
.ims-ac *::after {
    box-sizing: border-box;
}

.ims-ac svg {
    display: block;
    fill: currentColor;
}

.ims-ac-editor-notice {
    width: 100%;
    padding: 16px;
    color: #3c434a;
    font-size: 13px;
    line-height: 1.5;
    text-align: center;
    background: #f6f7f7;
    border: 1px dashed #c3c4c7;
}

/* Header */
.ims-ac-header {
    --ims-ac-header-dropdown-width: 282px;
    --ims-ac-header-dropdown-offset: 8px;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ims-ac-header__trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    overflow: hidden;
    color: var(--ims-ac-text);
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    background: transparent;
    border: 0;
    border-radius: 50%;
    outline: 0;
    transition: color 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.ims-ac-header__trigger:focus-visible {
    box-shadow: 0 0 0 3px rgba(32, 37, 43, .16);
}

.ims-ac-header__avatar {
    display: block;
    width: 42px;
    height: 42px;
    object-fit: cover;
    border-radius: 50%;
}

.ims-ac-header__guest-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.ims-ac-header__dropdown {
    position: absolute;
    top: 100%;
    z-index: 99999;
    width: var(--ims-ac-header-dropdown-width, 282px);
    max-width: calc(100vw - 24px);
    margin-top: var(--ims-ac-header-dropdown-offset, 8px);
    overflow: hidden;
    background: #fff;
    border: 1px solid #eeeeee;
    border-radius: 0;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .10);
}

.ims-ac-header[data-align="right"] .ims-ac-header__dropdown { right: 0; }
.ims-ac-header[data-align="left"] .ims-ac-header__dropdown { left: 0; }
.ims-ac-header__dropdown[hidden] { display: none !important; }

.ims-ac-header__user-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 8px;
    padding: 10px;
    background: #fff;
    border: 1px solid var(--ims-ac-line);
    border-radius: 12px;
}

.ims-ac-header__user-copy {
    display: flex;
    min-width: 0;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 2px;
}

.ims-ac-header__name,
.ims-ac-header__phone {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ims-ac-header__name {
    color: var(--ims-ac-text);
    font-size: 16px;
    font-weight: 600;
    line-height: 1.35;
}

.ims-ac-header__phone {
    color: var(--ims-ac-muted);
    font-size: 14px;
    line-height: 1.35;
}

.ims-ac-header__dropdown-avatar {
    display: block;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    object-fit: cover;
    border-radius: 50%;
}

.ims-ac-header__menu {
    display: flex;
    flex-direction: column;
}

.ims-ac-header__menu-link {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 42px;
    padding: 10px 16px;
    color: #555a60;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.35;
    text-decoration: none;
    background: transparent;
    border: 0;
    outline: 0;
    transition: color 180ms ease, background-color 180ms ease;
}

.ims-ac-header__menu-link:hover,
.ims-ac-header__menu-link:focus-visible {
    color: var(--ims-ac-text);
    background: #f4f4f4;
}

.ims-ac-header__menu-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    flex: 0 0 18px;
    font-size: 15px;
}

.ims-ac-header__menu-icon svg {
    display: block;
    max-width: 100%;
    max-height: 100%;
}

.ims-ac-header__menu-label {
    min-width: 0;
    flex: 1 1 auto;
}

.ims-ac-header__menu-separator {
    height: 1px;
    margin: 2px 0;
    background: #eeeeee;
}

.ims-ac-header__menu-link--logout {
    color: var(--ims-ac-danger);
}

.ims-ac-header__menu-link--logout:hover,
.ims-ac-header__menu-link--logout:focus-visible {
    color: var(--ims-ac-danger);
}

/* Guest menu follows the supplied compact reference. */
.ims-ac-header__dropdown--guest .ims-ac-header__menu-link {
    min-height: 46px;
}

@media (max-width: 1024px) {
    .ims-ac-header {
        --ims-ac-header-dropdown-width: 282px;
    }
}

/* Sidebar */
.ims-ac-sidebar {
    width: 100%;
    overflow: hidden;
    background: #fff;
}

.ims-ac-sidebar__user {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border-bottom: 1px solid var(--ims-ac-line);
}

.ims-ac-sidebar__avatar-wrap {
    position: relative;
    width: 64px;
    height: 64px;
    flex: 0 0 auto;
}

.ims-ac-sidebar__avatar {
    display: block;
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 50%;
}

.ims-ac-sidebar__camera {
    position: absolute;
    right: 1px;
    bottom: -2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 20px;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    background: rgba(55, 58, 62, .72);
    border-radius: 999px;
}

.ims-ac-sidebar__user-copy {
    display: flex;
    min-width: 0;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 2px;
}

.ims-ac-sidebar__name,
.ims-ac-sidebar__phone {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ims-ac-sidebar__name {
    color: var(--ims-ac-text);
    font-size: 16px;
    font-weight: 600;
    line-height: 1.35;
}

.ims-ac-sidebar__phone {
    color: var(--ims-ac-muted);
    font-size: 14px;
    line-height: 1.35;
}

.ims-ac-sidebar__mobile-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    cursor: pointer;
}

.ims-ac-sidebar__mobile-toggle svg,
.ims-ac-sidebar__chevron svg {
    width: 12px;
    height: 12px;
    transition: transform 180ms ease;
}

.ims-ac-sidebar.is-mobile-open .ims-ac-sidebar__mobile-toggle svg,
.ims-ac-sidebar__group.is-open .ims-ac-sidebar__chevron svg {
    transform: rotate(180deg);
}

.ims-ac-sidebar__navigation,
.ims-ac-sidebar__submenu {
    display: flex;
    flex-direction: column;
}

.ims-ac-sidebar__link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 11px 16px;
    color: #555a60;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.35;
    text-decoration: none;
    background: transparent;
    transition: color 180ms ease, background-color 180ms ease;
}

.ims-ac-sidebar__link:hover,
.ims-ac-sidebar__link:focus-visible {
    color: var(--ims-ac-text);
    background: #f4f4f4;
}

.ims-ac-sidebar__link.is-active {
    color: var(--ims-ac-text);
    background: var(--ims-ac-active);
}

.ims-ac-sidebar__link.is-active::after,
.ims-ac-sidebar__sublink.is-active::after {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 2px;
    content: "";
    background: var(--ims-ac-text);
}

.ims-ac-sidebar__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    flex: 0 0 18px;
    font-size: 14px;
}

.ims-ac-sidebar__label { min-width: 0; flex: 1 1 auto; }

.ims-ac-sidebar__chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    cursor: pointer;
}

.ims-ac-sidebar__submenu[hidden] { display: none !important; }
.ims-ac-sidebar__submenu { padding: 4px 0 8px; }

.ims-ac-sidebar__sublink {
    position: relative;
    display: block;
    padding: 9px 16px 9px 28px;
    color: #555a60;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.35;
    text-decoration: none;
    transition: color 180ms ease, background-color 180ms ease;
}

.ims-ac-sidebar__sublink:hover,
.ims-ac-sidebar__sublink:focus-visible {
    color: var(--ims-ac-text);
    background: #f7f7f7;
}

.ims-ac-sidebar__sublink.is-active {
    color: var(--ims-ac-text);
    background: var(--ims-ac-active);
}

.ims-ac-sidebar__separator { height: 1px; background: var(--ims-ac-line); }
.ims-ac-sidebar__link--logout { color: var(--ims-ac-danger); }

@media (max-width: 767px) {
    .ims-ac-header[data-align="right"] .ims-ac-header__dropdown,
    .ims-ac-header[data-align="left"] .ims-ac-header__dropdown {
        position: fixed;
        top: var(--ims-ac-mobile-top, 70px);
        right: 12px;
        left: 12px;
        width: auto;
        max-width: none;
        margin-top: 0;
        max-height: calc(100dvh - var(--ims-ac-mobile-top, 70px) - 12px);
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .ims-ac-header__user-card {
        margin: 8px;
        padding: 10px;
    }

    .ims-ac-header__menu-link {
        min-height: 44px;
        padding: 11px 16px;
    }

    .ims-ac-sidebar--mobile-collapsible .ims-ac-sidebar__mobile-toggle { display: inline-flex; }
    .ims-ac-sidebar--mobile-collapsible .ims-ac-sidebar__navigation { display: none; }
    .ims-ac-sidebar--mobile-collapsible.is-mobile-open .ims-ac-sidebar__navigation { display: flex; }
}

@media (prefers-reduced-motion: reduce) {
    .ims-ac-header__trigger,
    .ims-ac-header__menu-link,
    .ims-ac-sidebar__link,
    .ims-ac-sidebar__sublink,
    .ims-ac-sidebar__chevron svg,
    .ims-ac-sidebar__mobile-toggle svg {
        transition: none;
    }
}

/* =========================================================
 * 1.2.2 - Account Header dropdown viewport clamp
 * ========================================================= */
.ims-ac-header {
    --ims-ac-responsive-top: 70px;
    --ims-ac-tablet-left: 12px;
}

/*
 * Tablet: dropdown becomes viewport-positioned instead of being anchored
 * to the narrow Elementor/header column. This prevents it from spilling
 * beyond the right edge of the screen.
 */
@media (min-width: 768px) and (max-width: 1024px) {
    .ims-ac-header[data-align="right"] .ims-ac-header__dropdown,
    .ims-ac-header[data-align="left"] .ims-ac-header__dropdown {
        position: fixed;
        top: var(--ims-ac-responsive-top, 70px);
        right: auto;
        left: var(--ims-ac-tablet-left, 12px);
        width: min(
            var(--ims-ac-header-dropdown-width, 282px),
            calc(100vw - 24px)
        );
        max-width: calc(100vw - 24px);
        margin-top: 0;
        max-height: calc(
            100dvh
            - var(--ims-ac-responsive-top, 70px)
            - 12px
        );
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
    }
}

/*
 * Mobile: full safe-width dropdown with 12px gutters.
 * Keep it independent from the Elementor column width.
 */
@media (max-width: 767px) {
    .ims-ac-header[data-align="right"] .ims-ac-header__dropdown,
    .ims-ac-header[data-align="left"] .ims-ac-header__dropdown {
        top: var(--ims-ac-responsive-top, 70px);
        right: 12px;
        left: 12px;
        width: auto;
        max-width: none;
        margin-top: 0;
        max-height: calc(
            100dvh
            - var(--ims-ac-responsive-top, 70px)
            - 12px
        );
    }
}
