#atlasshop-live-chat.atlasshop-lc {
    position: fixed;
    right: 20px;
    bottom: var(--lc-offset-bottom-desktop, 92px);
    z-index: 99998;
    font-family: "Yekan Bakh", yekanbakh, Tahoma, Arial, sans-serif;
    direction: rtl;
    --lc-cream: #f5efe4;
    --lc-cream-2: #fff9ef;
    --lc-card: #fffdf8;
    --lc-card-strong: #fff4df;
    --lc-brown: #4b3728;
    --lc-header-title-color: #4b3728;
    --lc-bg-start-rgba: 255,253,248,0.82;
    --lc-bg-end-rgba: 242,230,213,0.82;
    --lc-muted: #8f7b66;
    --lc-line: rgba(139, 104, 70, 0.16);
    --lc-shadow: rgba(82, 61, 39, 0.18);
    --lc-edge-offset: 20px;
}

#atlasshop-live-chat.atlasshop-lc--pos-bottom-left {
    right: auto;
    left: var(--lc-edge-offset);
}

#atlasshop-live-chat.atlasshop-lc--pos-top-right {
    top: var(--lc-edge-offset);
    bottom: auto;
}

#atlasshop-live-chat.atlasshop-lc--pos-top-left {
    top: var(--lc-edge-offset);
    right: auto;
    bottom: auto;
    left: var(--lc-edge-offset);
}

#atlasshop-live-chat.atlasshop-lc--vis-mobile {
    display: none;
}

.atlasshop-lc__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    width: 62px;
    min-width: 62px;
    height: 62px;
    padding: 0;
    border: 1px solid rgba(139, 104, 70, 0.2);
    border-radius: 999px;
    color: #fff9ef;
    background: var(--lc-brown);
    box-shadow: 0 16px 34px var(--lc-shadow);
    cursor: pointer;
    font-weight: 700;
}

.atlasshop-lc__toggle-icon {
    display: inline-flex;
    line-height: 1;
}

.atlasshop-lc__toggle > span:not(.atlasshop-lc__toggle-icon) {
    display: none;
}

.atlasshop-lc__teaser {
    position: absolute;
    right: 0;
    bottom: 78px;
    width: 280px;
    max-width: calc(100vw - 34px);
    padding: 18px 42px 18px 20px;
    border: 1px solid rgba(139, 104, 70, 0.12);
    border-radius: 14px;
    color: var(--lc-brown);
    background: rgba(255, 253, 248, 0.98);
    box-shadow: 0 16px 34px rgba(82, 61, 39, 0.14);
    cursor: pointer;
    animation: atlasshop-lc-teaser-in 0.42s ease both;
}

.atlasshop-lc--pos-bottom-left .atlasshop-lc__teaser,
.atlasshop-lc--pos-top-left .atlasshop-lc__teaser {
    right: auto;
    left: 0;
}

.atlasshop-lc--pos-top-right .atlasshop-lc__teaser,
.atlasshop-lc--pos-top-left .atlasshop-lc__teaser {
    top: 78px;
    bottom: auto;
}

.atlasshop-lc__teaser::after {
    content: "";
    position: absolute;
    right: 34px;
    bottom: -10px;
    width: 20px;
    height: 20px;
    background: rgba(255, 253, 248, 0.98);
    border-right: 1px solid rgba(139, 104, 70, 0.12);
    border-bottom: 1px solid rgba(139, 104, 70, 0.12);
    transform: rotate(45deg);
}

.atlasshop-lc--pos-bottom-left .atlasshop-lc__teaser::after,
.atlasshop-lc--pos-top-left .atlasshop-lc__teaser::after {
    right: auto;
    left: 34px;
}

.atlasshop-lc--pos-top-right .atlasshop-lc__teaser::after,
.atlasshop-lc--pos-top-left .atlasshop-lc__teaser::after {
    top: -10px;
    bottom: auto;
    border-right: 0;
    border-bottom: 0;
    border-left: 1px solid rgba(139, 104, 70, 0.12);
    border-top: 1px solid rgba(139, 104, 70, 0.12);
}

.atlasshop-lc__teaser strong,
.atlasshop-lc__teaser span {
    display: block;
}

.atlasshop-lc__teaser strong {
    font-size: 14px;
    line-height: 1.9;
}

.atlasshop-lc__teaser span {
    margin-top: 4px;
    color: var(--lc-muted);
    font-size: 13px;
}

.atlasshop-lc__teaser-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    color: #9a8975;
    background: transparent;
    cursor: pointer;
    font-size: 22px;
    line-height: 20px;
}

.atlasshop-lc[data-open="1"] .atlasshop-lc__teaser,
.atlasshop-lc.is-teaser-closed .atlasshop-lc__teaser {
    display: none;
}

@keyframes atlasshop-lc-teaser-in {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.atlasshop-lc__panel {
    position: absolute;
    right: 0;
    bottom: 68px;
    width: min(349px, calc(100vw - 32px));
    height: 540px;
    max-height: calc(100vh - 140px);
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(139, 104, 70, 0.18);
    border-radius: 34px;
    background: linear-gradient(135deg, rgba(var(--lc-bg-start-rgba)) 0%, rgba(var(--lc-bg-end-rgba)) 100%);
    box-shadow: 0 28px 70px rgba(82, 61, 39, 0.22);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.atlasshop-lc--pos-bottom-left .atlasshop-lc__panel,
.atlasshop-lc--pos-top-left .atlasshop-lc__panel {
    right: auto;
    left: 0;
}

.atlasshop-lc--pos-top-right .atlasshop-lc__panel,
.atlasshop-lc--pos-top-left .atlasshop-lc__panel {
    top: 68px;
    bottom: auto;
}

.atlasshop-lc[data-open="1"] .atlasshop-lc__panel {
    display: flex;
    animation: atlasshop-lc-panel-open 0.46s cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.atlasshop-lc[data-open="1"] .atlasshop-lc__header,
.atlasshop-lc[data-open="1"] .atlasshop-lc__messages,
.atlasshop-lc[data-open="1"] .atlasshop-lc__form {
    animation: atlasshop-lc-content-rise 0.52s cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.atlasshop-lc[data-open="1"] .atlasshop-lc__messages {
    animation-delay: 0.06s;
}

.atlasshop-lc[data-open="1"] .atlasshop-lc__form {
    animation-delay: 0.12s;
}

@keyframes atlasshop-lc-panel-open {
    0% {
        opacity: 0;
        transform: translateY(28px) scale(0.9);
        filter: blur(8px);
        transform-origin: bottom right;
    }
    62% {
        opacity: 1;
        transform: translateY(-4px) scale(1.018);
        filter: blur(0);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
        transform-origin: bottom right;
    }
}

@keyframes atlasshop-lc-content-rise {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .atlasshop-lc[data-open="1"] .atlasshop-lc__panel,
    .atlasshop-lc[data-open="1"] .atlasshop-lc__header,
    .atlasshop-lc[data-open="1"] .atlasshop-lc__messages,
    .atlasshop-lc[data-open="1"] .atlasshop-lc__form {
        animation: none;
    }
}

.atlasshop-lc__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 18px 18px 12px;
    color: var(--lc-brown);
    background: transparent;
}

.atlasshop-lc__header > div {
    flex: 1;
    min-width: 0;
    padding: 10px 14px;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 10px 24px rgba(82, 61, 39, 0.08);
    text-align: center;
}

.atlasshop-lc__header strong,
.atlasshop-lc__header small {
    display: block;
}

.atlasshop-lc__header strong {
    color: var(--lc-header-title-color);
}

.atlasshop-lc__header small {
    margin-top: 3px;
    color: var(--lc-header-title-color);
    opacity: 0.74;
    font-size: 12px;
}

.atlasshop-lc__close {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 999px;
    color: #000;
    background: #fff;
    box-shadow: 0 8px 20px rgba(82, 61, 39, 0.12);
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
}

.atlasshop-lc__messages {
    flex: 1;
    overflow-y: auto;
    padding: 22px 20px 42px;
    background: transparent;
    overscroll-behavior: contain;
    perspective: 900px;
    scroll-behavior: smooth;
    scroll-padding-block: 34px;
    scrollbar-width: thin;
    scrollbar-color: rgba(139, 104, 70, 0.28) transparent;
}

.atlasshop-lc__messages::-webkit-scrollbar {
    width: 6px;
}

.atlasshop-lc__messages::-webkit-scrollbar-track {
    background: transparent;
}

.atlasshop-lc__messages::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(139, 104, 70, 0.24);
}

.atlasshop-lc__empty {
    margin: 100px auto 0;
    padding: 18px;
    border-radius: 24px;
    color: var(--lc-muted);
    background: rgba(255, 255, 255, 0.42);
    text-align: center;
}

.atlasshop-lc__message {
    display: flex;
    position: relative;
    margin-bottom: 0;
    scroll-snap-align: end;
    transform-origin: center bottom;
    transition: transform 0.28s ease, filter 0.28s ease, opacity 0.28s ease;
}

.atlasshop-lc__message + .atlasshop-lc__message {
    margin-top: -26px;
}

.atlasshop-lc__message:hover,
.atlasshop-lc__message:focus-within {
    z-index: 20;
    transform: translateY(-8px) scale(1.015);
}

.atlasshop-lc__message.is-user {
    justify-content: flex-end;
}

.atlasshop-lc__message.is-admin {
    justify-content: flex-start;
}

.atlasshop-lc__bubble {
    max-width: 88%;
    min-width: 62%;
    padding: 15px 16px 12px;
    border: 1px solid var(--lc-line);
    border-radius: 24px;
    color: var(--lc-brown);
    background: rgba(255, 253, 248, 0.9);
    box-shadow: 0 16px 34px rgba(82, 61, 39, 0.12);
    backdrop-filter: blur(8px);
    transition: box-shadow 0.28s ease, transform 0.28s ease;
}

.atlasshop-lc__message.is-user .atlasshop-lc__bubble {
    color: var(--lc-brown);
    background: linear-gradient(135deg, #fff3dc 0%, #ead1af 100%);
    border-bottom-left-radius: 24px;
    border-bottom-right-radius: 10px;
    box-shadow: 0 18px 38px rgba(139, 104, 70, 0.2);
}

.atlasshop-lc__message.is-admin .atlasshop-lc__bubble {
    border-bottom-left-radius: 10px;
    background: rgba(255, 255, 255, 0.86);
}

.atlasshop-lc__message:hover .atlasshop-lc__bubble,
.atlasshop-lc__message:focus-within .atlasshop-lc__bubble {
    box-shadow: 0 22px 44px rgba(82, 61, 39, 0.18);
}

.atlasshop-lc__text p {
    margin: 0 0 6px;
}

.atlasshop-lc__text p:last-child {
    margin-bottom: 0;
}

.atlasshop-lc__attachment {
    display: inline-flex;
    margin-top: 6px;
    padding: 7px 10px;
    border-radius: 999px;
    color: inherit;
    background: rgba(139, 104, 70, 0.1);
    text-decoration: none;
    font-size: 12px;
}

.atlasshop-lc__message.is-admin .atlasshop-lc__attachment {
    background: rgba(139, 104, 70, 0.09);
}

.atlasshop-lc__bubble time {
    display: block;
    margin-top: 6px;
    opacity: 0.68;
    font-size: 11px;
}

.atlasshop-lc__message + .atlasshop-lc__message .atlasshop-lc__bubble {
    transform: translateZ(0);
}

.atlasshop-lc__form {
    display: grid;
    grid-template-columns: 40px 1fr 40px 44px;
    gap: 8px;
    margin: 0 18px 18px;
    padding: 10px;
    border: 1px solid rgba(139, 104, 70, 0.14);
    border-radius: 22px;
    background: rgba(255, 253, 248, 0.78);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 10px 26px rgba(82, 61, 39, 0.08);
    backdrop-filter: blur(10px);
    position: relative;
}

.atlasshop-lc__file {
    display: none !important;
}

.atlasshop-lc__attach,
.atlasshop-lc__emoji-toggle,
.atlasshop-lc__send {
    border: 0;
    border-radius: 16px;
    cursor: pointer;
}

.atlasshop-lc__attach {
    background: rgba(139, 104, 70, 0.1);
    color: var(--lc-brown);
    font-size: 18px;
}

.atlasshop-lc__emoji-toggle {
    background: rgba(139, 104, 70, 0.1);
    color: var(--lc-brown);
    font-size: 22px;
    line-height: 1;
}

.atlasshop-lc__emoji-toggle[aria-expanded="true"] {
    background: var(--lc-brown);
    color: #fff9ef;
}

.atlasshop-lc__emoji-panel {
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: calc(100% + 10px);
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 6px;
    max-height: 178px;
    overflow-y: auto;
    padding: 12px;
    border: 1px solid rgba(139, 104, 70, 0.16);
    border-radius: 22px;
    background: rgba(255, 253, 248, 0.96);
    box-shadow: 0 20px 42px rgba(82, 61, 39, 0.18);
    backdrop-filter: blur(14px);
    z-index: 5;
}

.atlasshop-lc__emoji-panel[hidden] {
    display: none !important;
}

.atlasshop-lc__emoji-item {
    width: 100%;
    aspect-ratio: 1;
    border: 0;
    border-radius: 12px;
    background: transparent;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
    transition: background 0.16s ease, transform 0.16s ease;
}

.atlasshop-lc__emoji-item:hover,
.atlasshop-lc__emoji-item:focus {
    background: rgba(139, 104, 70, 0.1);
    transform: translateY(-2px) scale(1.08);
    outline: none;
}

.atlasshop-lc__input {
    width: 100%;
    min-height: 40px;
    max-height: 90px;
    resize: vertical;
    border: 0;
    border-radius: 16px;
    padding: 10px 6px;
    color: var(--lc-brown);
    background: transparent;
    box-sizing: border-box;
    font-family: "Yekan Bakh", yekanbakh, Tahoma, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    outline: none;
}

.atlasshop-lc__input::placeholder {
    font-family: "Yekan Bakh", yekanbakh, Tahoma, Arial, sans-serif;
}

.atlasshop-lc__send {
    width: 40px;
    min-width: 40px;
    padding: 0;
    overflow: hidden;
    color: transparent;
    background: var(--lc-brown);
    font-weight: 700;
    position: relative;
}

.atlasshop-lc__send::before {
    content: "";
    position: absolute;
    inset: 0;
    margin: auto;
    width: 0;
    height: 0;
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
    border-right: 12px solid #fff9ef;
    transform: translateX(-1px);
}

.atlasshop-lc__form.is-sending {
    opacity: 0.65;
    pointer-events: none;
}

.atlasshop-lc__file-name {
    margin: -10px 24px 14px;
    color: var(--lc-muted);
    background: transparent;
    font-size: 12px;
}

@media (max-width: 640px) {
    #atlasshop-live-chat.atlasshop-lc--vis-desktop {
        display: none;
    }

    #atlasshop-live-chat.atlasshop-lc--vis-mobile {
        display: block;
    }

    #atlasshop-live-chat.atlasshop-lc {
        right: 12px;
        bottom: var(--lc-offset-bottom-mobile, 74px);
        left: auto;
        top: auto;
    }

    #atlasshop-live-chat.atlasshop-lc--pos-bottom-left {
        right: auto;
        left: 12px;
    }

    #atlasshop-live-chat.atlasshop-lc--pos-top-right {
        top: 12px;
        right: 12px;
        bottom: auto;
    }

    #atlasshop-live-chat.atlasshop-lc--pos-top-left {
        top: 12px;
        right: auto;
        bottom: auto;
        left: 12px;
    }

    #atlasshop-live-chat.atlasshop-lc[data-open="1"] {
        inset: 0;
        right: 0;
        bottom: 0;
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        z-index: 999999;
    }

    #atlasshop-live-chat.atlasshop-lc[data-open="1"] .atlasshop-lc__toggle {
        display: none;
    }

    .atlasshop-lc__panel {
        right: -4px;
        height: 500px;
    }

    #atlasshop-live-chat.atlasshop-lc[data-open="1"] .atlasshop-lc__panel {
        position: fixed;
        inset: 0;
        right: 0;
        bottom: 0;
        display: flex;
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        max-height: none;
        border: 0;
        border-radius: 0;
    }

    #atlasshop-live-chat.atlasshop-lc[data-open="1"] .atlasshop-lc__header {
        padding-top: max(18px, env(safe-area-inset-top));
    }

    #atlasshop-live-chat.atlasshop-lc[data-open="1"] .atlasshop-lc__messages {
        padding-inline: 16px;
    }

    #atlasshop-live-chat.atlasshop-lc[data-open="1"] .atlasshop-lc__form {
        margin: 0 12px max(12px, env(safe-area-inset-bottom));
        grid-template-columns: 38px minmax(0, 1fr) 38px 42px;
    }

    #atlasshop-live-chat.atlasshop-lc[data-open="1"] .atlasshop-lc__input,
    #atlasshop-live-chat.atlasshop-lc[data-open="1"] .atlasshop-lc__input::placeholder,
    #atlasshop-live-chat.atlasshop-lc[data-open="1"] .atlasshop-lc__attach,
    #atlasshop-live-chat.atlasshop-lc[data-open="1"] .atlasshop-lc__emoji-toggle,
    #atlasshop-live-chat.atlasshop-lc[data-open="1"] .atlasshop-lc__send {
        font-size: 16px;
    }

    #atlasshop-live-chat.atlasshop-lc[data-open="1"] .atlasshop-lc__emoji-panel {
        left: 0;
        right: 0;
        grid-template-columns: repeat(7, 1fr);
        max-height: 220px;
    }
}
