:root {
    --chat-header-height: 72px;
    --chat-side-padding: 48px;
    --chat-bottom-padding: 5px;

    --chat-content-width: 700px;
    --chat-assistant-width: 300px;
    --chat-assistant-gap: 48px;
}

@font-face {
    font-family: "Futura";
    src: url("./static/fonts/FuturaPTBook.otf");
    font-style: normal;
    line-height: 24;
}

@font-face {
    font-family: "FuturaBold";
    src: url("./static/fonts/FuturaPTBold.otf");
    font-style: normal;
}

body {
    background-color: #f4f4f4;
}

.site-header {
    background-color: white;
    font-family: "Futura";
}

.site-header a {
    color: black;
    text-decoration: none;
}

.header-top {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 32px;
    margin-bottom: 8px;
}

.header-left {
    display: flex;
    gap: 24px;
    align-items: center;
    justify-content: start;
}

.header-bottom {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-logo {
    justify-self: center;
}

.nav-menu {
    display: flex;
    gap: 20px;
    align-items: center;
    justify-self: end;
}

.menu-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 8px;
    padding: 8px 16px;
    height: 40px;
    min-width: 64px;
    background-color: #4db027;
    color: white;
}

.menu-button span {
    color: white;
}

.search-button {
    flex-grow: 1;
    background-color: #f4f4f4;
    border-radius: 8px;
    padding: 8px 16px;
    height: 40px;
}

.search-button span {
    color: #a4a4a5;
}

.icon-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    padding: 5px;
}

.icon-button span {
    font-size: 12px;
}

.profile-button {
    border: 1px solid #4db027;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 8px;
    padding: 8px 16px;
    height: 40px;
}

.profile-button span {
    color: #4db027;
}

.banner-carousel {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
}

.banner-scroll {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: none;
    scrollbar-width: none;
    cursor: grab;
    gap: 12px;
}

.banner-scroll-mobile {
    gap: 8px;
}

.banner-scroll.is-dragging {
    cursor: grabbing;
    user-select: none;
}

.banner-scroll.is-dragging img {
    pointer-events: none;
}

.banner-slide {
    position: relative;
    flex: 0 0 97%;
    min-width: 0;
    scroll-snap-align: start;
    scroll-snap-stop: always;

    border-radius: 24px;
    overflow: hidden;
    position: relative;
}

.banner-scroll-indicators {
    position: absolute;
    left: 50%;
    bottom: 16px;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 8px;
    transform: translate(-50%);
    pointer-events: none;
}

.banner-scroll-indicator {
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
    background-color: transparent;
    background-image: url("static/images/icons/24/carousel_indicator.svg");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

.banner-scroll-indicator:first-child:not(.active),
.banner-scroll-indicator.last:not(.active) {
    width: 8px;
    height: 8px;
    background-image: url("static/images/icons/24/last_carousel_indicator.svg");
    background-position: center;
    background-repeat: no-repeat;
    background-size: 6px 6px;
}

.banner-scroll-indicator.active,
.banner-scroll-indicator.last.active {
    width: 16px;
    height: 8px;
    background-image: url("static/images/icons/24/active_carousel_indicator.svg");
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
}

.banner-scroll-indicators:empty {
    display: none;
}

.slide-button, .slide-button-mobile {
    position: absolute;
    left: 32px;
    bottom: 32px;
    z-index: 2;

    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 8px;
    padding: 8px 16px;
    height: 40px;
    min-width: 64px;
    background-color: #f4f4f4;
    color: white;
    text-decoration: none;
}

.slide-button-mobile {
    right: 32px;
    justify-content: center;
}

.slide-button span, .slide-button-mobile span {
    color: black;
    text-decoration: none;
}

.modal-content {
    height: 100dvh;
    overflow-y: auto;
}

.chat-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;

    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    background-color: white;
}

.chat-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.chat-action {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: black;
    text-decoration: none;
    font-size: 12px;
}

.chat-close {
    border-radius: 8px;
    padding: 6px 12px;
    color: black;
    text-decoration: none;
    background-color: #f4f4f4;
}

.chat-body {
    position: relative;
    min-height: 100dvh;
    padding: calc(var(--chat-header-height) + 40px) var(--chat-side-padding) 0;
    overflow: visible;
}

.chat-assistant {
    position: fixed;
    left: max(var(--chat-side-padding), calc(50% - var(--chat-content-width) / 2 
        - var(--chat-assistant-gap) 
        - var(--chat-assistant-width)));
    bottom: 40px;
    width: var(--chat-assistant-width);
    z-index: 10;
}

.chat-assistant img {
    width: 100%;
}

.chat-content {
    width: min(var(--chat-content-width), 100%);
    max-width: var(--chat-content-width);
    margin-left: auto;
    margin-right: auto;
}

.chat-content.chat-empty {
    min-height: calc(100dvh - var(--chat-header-height) - 40px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-bottom: 8vh;
}

.chat-content.chat-empty .chat-messages {
    display: none;
}

.chat-content.chat-empty .chat-form {
    position: relative;
}

.chat-content.chat-started {
    min-height: calc(100dvh - var(--chat-header-height) - 40px);
    display: flex;
    flex-direction: column;
}

.chat-content.chat-started .chat-messages {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 0;
    padding-bottom: 24px;
}

.chat-content.chat-started .chat-form {
    position: sticky;
    bottom: 0;
    margin-top: auto;
    flex-shrink: 0;
}

.chat-title {
    margin-bottom: 24px;
    text-align: center;
    font-family: "FuturaBold";
    font-size: 24px;
    flex-shrink: 0;
}

.chat-form {
    width: 100%;
    z-index: 20;
    padding: 8px 0 var(--chat-bottom-padding);
    background-color: white;
    will-change: transform;
}

.chat-messages {
    width: 100%;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: visible;
    flex-grow: 0;
    min-height: auto;
    padding-right: 0;
}

.chat-message {
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 16px;
    line-height: 1.5;
    word-break: break-word;
}

.chat-message.user {
    width: 70%;
    align-self: flex-end;
    text-align: left;
    background-color: #f4f4f4;
}

.chat-message.bot {
    max-width: 100%;
    align-items: flex-start;
    text-align: left;
    background-color: transparent;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-input-box {
    width: 100%;
    border-radius: 12px;
    padding: 8px;
    min-height: 84px;
    background-color: #f4f4f4;
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.chat-input {
    flex: 1 1 auto;
    width: 100%;
    min-height: 72px;
    max-height: 160px;
    border: none;
    outline: none;
    resize: none;
    overflow-y: auto;
    background-color: transparent;
    font-family: "Futura";
    font-size: 16px;
    line-height: 24px;
}

.chat-send, .chat-send-active {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border: none;
    border-radius: 8px;
}

.chat-send {
    background-color: #e4e4e4;
}

.chat-send-active {
    background-color: #4db027;
}

.chat-prompts {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.chat-prompt {
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    background-color: #f6fbf4;
    color: #4db027;
    font-size: 14px;
    font-weight: 400;
}

.assistant-floating-button {
    position: fixed;
    left: 32px;
    bottom: 32px;
    z-index: 10;
    width: 96px;
    height: 96px;

    border: 1px solid #e4e4e4;
    border-radius: 50%;
    background-color: white;
    padding: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.assistant-floating-button.visible {
    opacity: 1;
    visibility: visible;
}

.assistant-floating-button img {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
}

.prompt-loading {
    display: flex;
    gap: 8px;
}

.prompt-loading > img {
    width: 24px;
    height: 24px;
}

.add-button {
    color: white;
    background-color: #4db027;
    justify-content: center;
}

.add-button-counter {
    color: #4db027;
    background-color: #f1f9ee;
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    font-weight: 400;
}

.add-button, .add-button-counter {
    box-sizing: border-box;
    width: 140px;
    height: 40px;
    min-height: 40px;
    border-radius: 8px;
    font-size: 16px;
    border: none;
    padding: 8px 16px;
    display: inline-flex;
    align-items: center;
}

.counter-button {
    border: none;
    color: #4db027;
    background-color: #f1f9ee;
}

.description-button {
    font-size: 16px;
    border-radius: 8px;
    padding: 8px 16px;
    color: #1c1c1e;
    background-color: #f4f4f4;
    border: none;
    text-decoration: none;
}

.dropdown-button {
    border-radius: 8px;
    padding: 8px 16px;
    color: #1c1c1e;
    background-color: #f4f4f4;
    border: none;
    display: flex;
    gap: 12px;
}

.dropdown-button img {
    width: 14px;
}

.card-button-panel {
    display: flex;
    gap: 8px;
}

.product-price {
    font-weight: 650;
    font-size: 24px;
}

.card-bottom-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    grid-column: 1 / 3;
    grid-row: 2;
}

.product-description {
    color: #777778;
}

.product-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px;
    border: 1px solid #ededed;
    border-radius: 16px;
    width: 100%;
}

.card-body {
    display: flex;
    gap: 16px;
    position: relative;
}

.product-name {
    font-weight: 600;
    font-size: 16px;
    text-decoration: none;
    color: #1c1c1e;
}

.product-image-wrapper {
    width: 140px;
    aspect-ratio: 1 / 1;
    flex-shrink: 0;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.product-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.busket-icon {
    position: relative;
    display: inline-block;
}

.busket-icon-counter {
    position: absolute;
    top: -6px;
    right: -6px;
    background-color: #f03434;
    color: white;
    text-align: center;
    border-radius: 50%;
    box-sizing: border-box;
    width: 20px;
    height: 20px;
    line-height: 20px;
}

.favourite-icon {
    position: absolute;
    top: 4px;
    right: 4px;
}

.page-spacer {
    min-height: 150vh;
}

.mobile-version {
    display: none;
}

.desktop-version {
    display: block;
}

.mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-left: 16px;
    padding-right: 16px;
}

.header-button {
    border-radius: 8px;
    padding: 6px;
    background-color: #f4f4f4;
    border: none;
}

.mobile-nav-bar {
    display: flex;
    align-items: center;
    gap: 15px;
    justify-content: space-around;
    background-color: white;
    padding-top: 15px;
    padding-bottom: 15px;

    position: fixed;
    z-index: 1000;
    left: 0;
    right: 0;
    bottom: 0;
}

.nav-bar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    border: none;
    background-color: transparent;
}

.nav-bar-item span {
    font-weight: 600;
    font-size: 12px;
}

.nav-bar-item.selected span {
    color: #478c25;
}

.chat-form::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 100%;
    height: 40px;
    pointer-events: none;

    background: linear-gradient(
        to top,
        rgba(255, 255, 255, 1) 0%,
        rgba(255, 255, 255, 0) 100%
    );
}

.chat-scroll-button {
    position: absolute;
    left: 50%;
    bottom: 100%;
    transform: translate(-50%, 0%);
}

#chatModal.fade .modal-dialog {
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
}

#chatModal.show .modal-dialog {
    transform: translateY(0);
}

@media (max-width: 1240px) {
    .chat-assistant {
        display: none;
    }
}

@media (max-width: 1200px) {
    .container {
        max-width: none;
        width: 100%;
        padding-left: 16px;
        padding-right: 16px;
    }

    .header-top {
        gap: 16px;
    }

    .header-left {
        gap: 16px;
    }

    .nav-menu {
        gap: 12px;
    }

    .profile-button,
    .menu-button,
    .search-button {
        padding-left: 12px;
        padding-right: 12px;
    }
}

@media (max-width: 920px) {
    .container {
        max-width: none;
        width: 100%;
        padding-left: 5px;
        padding-right: 5px;
    }

    .header-top {
        gap: 5px;
    }

    .header-left {
        gap: 5px;
    }

    .nav-menu {
        gap: 5px;
    }

    .profile-button,
    .menu-button,
    .search-button {
        padding-left: 5px;
        padding-right: 5px;
    }
}

@media (max-width: 820px) {
    .desktop-version {
        display: none;
    }

    .mobile-version {
        display: block;
    }

    .site-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
    }

    body {
        padding-top: 64px;
        padding-bottom: 72px;
    }

    .card-body {
        flex-direction: column-reverse;
    }

    .card-bottom-panel {
        flex-direction: column-reverse;
        align-items: start;
        gap: 10px;
    }

    .chat-prompts {
        display: flex;
        flex-wrap: nowrap;
        gap: 6px;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x proximity;
        padding-bottom: 8px;
        scrollbar-width: none;
        width: calc(100% + 2 * var(--chat-side-padding));
        margin-left: calc(-1 * var(--chat-side-padding));
        padding-left: var(--chat-side-padding);
        padding-right: var(--chat-side-padding);
        box-sizing: border-box;
        scroll-padding-inline: var(--chat-side-padding);
    }

    .chat-prompts::-webkit-scrollbar {
        display: none;
    }

    .chat-prompt {
        flex: 0 0 auto;
        white-space: nowrap;
        scroll-snap-align: start;
    }

    .prompts-scroll-indicators {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 4px;
        min-height: 8px;
    }

    .prompts-scroll-indicator {
        width: 8px;
        height: 8px;
        flex: 0 0 auto;
        background-color: #e4e4e4;
        mask-image: url("static/images/icons/24/carousel_indicator.svg");
        mask-position: center;
        mask-size: contain;
        mask-repeat: no-repeat;
    }

    .prompts-scroll-indicator.active {
        width: 16px;
        background-color: #a9a9a9;
        mask-image: url("static/images/icons/24/active_carousel_indicator.svg");
    }

    .prompts-scroll-indicator.last {
        width: 8px;
        height: 8px;
        background-color: #e4e4e4;
        mask-image: url("static/images/icons/24/last_carousel_indicator.svg");
        mask-position: center;
        mask-size: 6px 6px;
        mask-repeat: no-repeat;
    }

    .prompts-scroll-indicator:first-child:not(.active) {
        width: 8px;
        height: 8px;
        background-color: #e4e4e4;
        mask-image: url("static/images/icons/24/last_carousel_indicator.svg");
        mask-position: center;
        mask-size: 6px 6px;
        mask-repeat: no-repeat;
    }

    .prompts-scroll-indicator.last.active {
        width: 16px;
        background-color: #a9a9a9;
        mask-image: url("static/images/icons/24/active_carousel_indicator.svg");
        mask-position: center;
        mask-size: contain;
        mask-repeat: no-repeat;
    }

    .prompts-scroll-indicators:empty {
        display: none;
    }

    .add-button, .add-button-counter {
        width: 130px;
    }

    .chat-message.bot {
        padding-left: 0;
        padding-right: 0;
    }

    .dropdown-button {
        padding: 8px 10px;
    }

    .description-button {
        padding: 8px 10px;
    }

    :root {
        --chat-side-padding: 16px;
    }
}

@media (max-width: 400px) {
    .card-bottom-panel {
        width: 100%;
        align-items: stretch;
    }

    .card-bottom-panel {
        width: 100%;
        display: flex;
        gap: 8px;
    }

    .dropdown-button {
        flex: 1 1 auto;
        min-width: 0;
        justify-content: space-between;
        align-items: center;
    }

    .add-button, 
    .add-button-counter, 
    .description-button {
        flex: 0 0 auto;
    }
}