* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: "Montserrat", sans-serif;
}

body,
html {
    height: 100%;
}

body {
    background-color: #ffffff;
    color: #333;
}


.chat-container {
    display: flex;
    margin-left: 16px;
    height: 100dvh;
    background-color: #ffffff;
}


.chat-section {
    width: 35%;
    height: 95%;
    border-right: 1px solid #eee;
    display: flex;
    flex-direction: column;
    padding: 20px;
    background-color: #f8f9fa;
    margin-top: 1.2%;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    border-radius: 10px;
}

.profile-image {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 15px;
}

.profile-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.welcome-message h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 5px;
    text-align: center;
}

.welcome-message p {
    font-size: 16px;
    text-align: center;
}

.messages-container {
    flex: 1;
    overflow-y: auto;
    padding-right: 10px;
    margin-bottom: 15px;
}

.messages-container::-webkit-scrollbar {
    width: 5px;
}

.messages-container::-webkit-scrollbar-track {
    background: transparent;
}

.messages-container::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.messages-container::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

.messages-container {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

.messages-container ol {
    padding-left: 25px;
}

.messages-container li {
    margin-bottom: 10px;
}

.user-message,
.assistant-message {
    max-width: 85%;
    padding: 10px 15px;
    border-radius: 18px;
    margin-bottom: 15px;
    line-height: 1.4;
}

.user-message {
    background-color: #4a7dff;
    color: white;
    align-self: flex-end;
    margin-left: auto;
}

.assistant-message {
    background-color: #f0f0f0;
    color: #040404;
}


.message-input-container {
    display: flex;
    background: #fff;
    border-radius: 24px;
    padding: 8px 15px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
}

.message-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
    padding: 8px;
}

.send-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px 10px;
}


.action-buttons {
    display: flex;
    gap: 20px;
    margin-top: 0px;
    align-self: center;
    width: 80%;
}

.results {
    width: 65%;
    height: 100%;
    padding: 30px;
    overflow-y: auto;
    position: relative;
    display: block;
}


.signIn-container {
    display: none;
    position: absolute;
    top: 0;
    right: 0;
}

.signIn-container.show {
    display: block;
}

.button-in-corner {
    margin-right: 10px;
    margin-top: 30px;
    background-color: #fafafa;
    border-radius: 8px;
    border: #AAAAAA solid 1px;
    box-shadow: 0 0px 4px rgba(0, 0, 0, 0.25);
    font-size: 16px;
    font-weight: 500;
    padding: 8px 12px;
}

.button-in-corner:hover {
    background-color: #f7f7f7;
    box-shadow: 0 0px 8px rgba(0, 0, 0, 0.25);
}


.button-in-corner-mobil {
    background-color: #fafafa;
    border-radius: 8px;
    border: #AAAAAA solid 1px;
    box-shadow: 0 0px 4px rgba(0, 0, 0, 0.25);
    font-size: 12px;
    font-weight: 500;
    padding: 4px 8px;
    display: none;
}

.button-in-corner-mobil:hover {
    background-color: #f7f7f7;
    box-shadow: 0 0px 8px rgba(0, 0, 0, 0.25);
}

.button-in-corner-mobil.show {
    display: none;
}

.tooltip-container {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.tooltip-text {
    visibility: hidden;
    width: 220px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px;
    position: absolute;
    z-index: 100;
    bottom: -80%;
    /* над кнопкою */
    left: 48%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.85rem;
}

.tooltip-container:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

.results-section {
    width: 100%;
    height: 100%;
    display: none;
}

.results-block {
    margin-bottom: 40px;
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0px 0px 0px 20px;
    color: #333;
}

/* Filters */
.applied-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.filter-tag {
    background-color: #f0f0f0;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 14px;
    color: #333;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    padding: 20px 0;
}

.product-card {
    display: flex;
    flex-direction: column;
    justify-content: start;
    height: auto;
    width: 200px;
    box-sizing: border-box;
    border-radius: 12px;
    background-color: #fdfdfd;
    overflow: hidden;
    cursor: pointer;
    /* position: relative; */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0px 0px 6px 2px rgba(0, 0, 0, 0.2);
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0px 0px 10px 2px rgba(0, 0, 0, 0.3);
}

.product-image {
    width: 200px;
    height: 200px;
    aspect-ratio: 1 / 1;
    background-color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
}

.product-info {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 96px;
    padding: 4px 12px;
}

.product-head {
    display: flex;
    flex-direction: column;
    justify-content: start;
    align-items: start;
}

.product-down {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

.product-info p {
    cursor: text;
}

.product-title {
    font-size: 16px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-rating {
    /* text-align: center; */
    display: flex;
    /* justify-content: center; */
    align-items: center;
    /* position: absolute; */
}

.rating,
.number-reviews {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    cursor: text;
}

.ic--outline-star {
    display: inline-block;
    width: 24px;
    height: 24px;
    background-repeat: no-repeat;
    background-size: 100% 100%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23F7BA06' d='M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2L9.19 8.63L2 9.24l5.46 4.73L5.82 21z'/%3E%3C/svg%3E");
    margin-bottom: 2px;
}

.brand {
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: normal;
}


.price {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.shop-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.shop-button:hover {
    background-color: #333;
}

.show-more-container {
    text-align: center;
    margin-top: 30px;
}

.show-more-button {
    background: none;
    border: none;
    color: #4a7dff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.show-more-button img {
    margin-left: 8px;
    width: 16px;
    height: 16px;
}

.modal-block {
    position: relative;
    width: 100%;
}

.modal-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 5000;
    min-width: 246px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.modal-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-container {
    position: relative;
    display: inline-block;
}

.modal-content {
    position: relative;
    background-color: white;
    margin: 10% auto;
    padding: 0;
    border-radius: 12px;
    width: 50%;
    max-width: 600px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.3s;
}

.modal-screen {
    display: none;
}

.modal-screen.active {
    display: block;
}



@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header-sreeen-1 {
    padding: 20px 20px;
    display: flex;
    justify-content: end;
    align-items: center;
    border-bottom: 1px solid #eee;
}

.modal-header-sreeen-2 {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
}

.modal-header-sreeen-2 h2 {
    font-size: 18px;
    font-weight: 600;
}

.close-button {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #777;
}

.modal-body {
    padding: 14px 6px;
    max-height: 200px;
    overflow-y: auto;
}

.modal-buttons {
    width: 100%;
    display: flex;
    justify-content: start;
    align-items: center;
    flex-direction: column;
    padding: 10px 0px;
    margin-bottom: 10px;
}

.modal-btn {
    margin-top: 10px;
    border: none;
    width: 90%;
    padding: 10px 0px;
    font-size: 18px;
    font: 600;
    border-radius: 8px;
    transition: transform 0.5s ease, box-shadow 0.5s ease;
    box-shadow: 0px 0px 4px 0px rgba(0, 0, 0, 0.2);
}

.dropdown-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-size: 14px;
    color: #333;
}

.dropdown-item:hover {
    background-color: #f5f5f5;
}

.modal-btn:hover {
    scale: 1.05;
    box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.3);
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 999;
    display: none;
}

.modal-overlay.show {
    display: block;
}

.curations-list {
    list-style: none;
}

.curation-item {
    padding: 10px 4px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.curation-item:hover {
    background-color: #f9f9f9;
}

.curation-date {
    font-size: 12px;
    color: #999;
    margin-bottom: 5px;
}

.curation-title {
    font-size: 16px;
    font-weight: 500;
}

.hidden {
    display: none;
}

.disabled {
    display: none;
}

.product-search-not-yet-perfected {
    position: fixed;
    top: 50%;
    left: 65%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    width: 40%;
    min-width: 300px;
    text-align: center;
    opacity: 1;
    pointer-events: auto;
    transition: opacity 3.5s ease;
}

.product-search-not-yet-perfected.hide {
    opacity: 0;
    display: none;
}

.button-controls {
    display: flex;
    justify-content: start;
}


@media (max-width: 1400px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1100px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .chat-section {
        width: 43%;
    }

    .results {
        width: 57%;
    }

    .product-image {
        width: 180px;
        height: 180px;
    }

    .product-card {
        width: 190px;
    }
}


@media (max-width: 768px) {
    .product-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 90%;
    }

    .modal-dropdown {
        min-width: 220px;
        right: -10px;
    }

    .modal-header-sreeen-1 {
        padding: 4px 10px;
        display: flex;
        justify-content: end;
        align-items: center;
        border-bottom: 1px solid #eee;
    }

    .product-search-not-yet-perfected {
        display: none;
    }


    body {
        margin: 0;
        padding: 0;
        overflow: hidden;
    }

    .chat-container {
        flex-direction: column;
        margin: 0;
        overflow: hidden;
        display: flex;
    }

    /* Results section - top half */
    .results {
        width: 100%;
        height: auto;
        min-height: 40%;
        overflow-y: auto;
        padding: 10px 0;
        position: relative;
        display: none;
    }
    .results.show{
        display: block;
    }

    .results-block {
        margin-bottom: 10px;
    }

    .results-section .results-block {
        display: none;
    }

    .results-section .results-block:first-child {
        display: block;
    }

    .signIn-container.show {
        display: none;
    }

    .button-in-corner-mobil.show {
        display: block;
    }

    .section-title {
        font-size: 18px;
        margin: 10px 8px;
        font-weight: 600;
    }

    .section-title.disabled {
        display: none;
    }

    /* Mobile product grid - horizontal scroll */
    .product-grid {
        display: flex;
        overflow-x: auto;
        gap: 12px;
        padding: 8px 15px;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 15px;
        max-height: 400px;
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

    .product-grid::-webkit-scrollbar {
        display: none;
    }

    .product-image {
        width: 140px;
        height: 140px;
    }

    /* Mobile product cards */
    .product-card {
        width: 140px;
        flex-shrink: 0;
        scroll-snap-align: start;
        border-radius: 8px;
        overflow: hidden;
    }

    .product-info {
        height: 76px;
        padding: 4px 6px;
    }

    .product-title {
        font-size: 12px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        /* font-weight: normal; */
    }

    .curation-title {
        font-size: 12px;
    }

    .brand {
        font-size: 12px;
        margin-bottom: 4px;
    }

    .price {
        font-size: 10px;
    }

    .shop-button {
        font-size: 7px;
        padding: 5px 12px;
        border-radius: 15px;
        position: absolute;
        bottom: 0px;
        right: 8px;
        width: 60px;
    }

    /* Mobile filters */
    .applied-filters {
        padding: 0 15px;
        margin-bottom: 10px;
        display: flex;
        overflow-x: auto;
        gap: 8px;
    }

    .filter-tag {
        font-size: 12px;
        padding: 5px 12px;
        border-radius: 15px;
        white-space: nowrap;
    }

    /* Chat section - bottom half */
    .chat-section {
        flex: 1;
        overflow-y: auto;
        position: relative;
        width: 100%;
        height: 30%;
        padding: 10px 10px 10px;
        background-color: #f8f9fa;
        border-radius: 10px 10px 0 0;
        box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.1);
        margin-top: 0;
    }


    .chat-section.open-products {
        padding: 10px;
    }

    /* Mobile profile */
    .profile-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 10px 0px;
    }

    .profile-image {
        width: 50px;
        height: 50px;
        margin-right: 10px;
        border-radius: 50%;
    }

    .rating,
    .number-reviews {
        margin-left: 2px;
        font-size: 10px;
        font-weight: 500;
        color: #333;
    }

    .ic--outline-star {
        display: inline-block;
        width: 16px;
        height: 16px;
        background-repeat: no-repeat;
        background-size: 100% 100%;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23F7BA06' d='M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2L9.19 8.63L2 9.24l5.46 4.73L5.82 21z'/%3E%3C/svg%3E");
        margin-bottom: 2px;
    }

    .welcome-message {
        margin-left: 8px;
        margin-right: 8px;
        text-align: left;
    }

    .welcome-message h2 {
        font-size: 12px;
        margin-bottom: 2px;
    }

    /* Mobile messages */
    .messages-container {
        flex: 1;
        overflow-y: auto;
        padding: 10px 15px;
    }

    .user-message,
    .assistant-message {
        padding: 10px 12px;
        font-size: 14px;
        max-width: 85%;
        margin-bottom: 8px;
        border-radius: 18px;
    }

    .user-message {
        margin-left: auto;
    }

    .assistant-message {
        margin-right: auto;
    }

    /* Mobile input */
    .message-input-container {
        padding: 3px 7px;
        display: flex;
        align-items: center;
    }

    .message-input {
        flex: 1;
        padding: 8px 12px;
        border-radius: 20px;
        font-size: 14px;
    }

    .send-button {
        padding: 8px;
        border-radius: 50%;
    }

    .button-send-message {
        display: flex;
        align-items: center;
        justify-content: center;
        margin-left: 8px;
    }

    .send-button svg {
        width: 20px;
        height: 20px;
    }

    /* Mobile controls */
    .top-controls {
        width: auto;
        display: flex;
        flex-direction: row;
        justify-content: start;
        padding: 15px 0px;
        position: static;
    }

    /* Hide empty elements */
    .results-block:empty,
    .results-block .product-grid:empty {
        display: none;
    }

    .modal-header-sreeen-2 {
        padding: 10px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px solid #eee;
    }
}

@media (max-width: 480px) {
    .modal-dropdown {
        min-width: 200px;
        right: -20px;
    }

    .welcome-message h2 {
        font-size: 12px;
        margin-bottom: 2px;
    }
}