* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

body {
    font-family: "Segoe UI", sans-serif;
    background: #ffffff;
    padding: 25px 0 0;
    margin: 0;
    color: #0f172a;
}

.container {
    max-width: 100%;
    margin: 0;
    background: #ffffff;
    border-radius: 0;
    padding: 0;
    min-height: calc(100dvh - 134px);
    display: flex;
    flex-direction: column;
}

h2 {
    margin: 0 0 16px 0;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.chat-box {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    border: 1px solid #ffffff;
    padding: 0 0 100px;
    background-color: #ffffff;
    margin-bottom: 0;
    border-radius: 12px;
}

.chat-static-intro {
    margin-bottom: 14px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    background: #ffffff;
}

.chat-static-intro img {
    width: 100%;
    display: block;
}

.chat-static-copy {
    padding: 12px;
    text-align: center;
}

.chat-static-copy h2 {
    margin: 0 0 8px;
    font-size: 18px;
    line-height: 1.35;
}

.chat-static-copy p {
    margin: 0;
    color: #4b5563;
    line-height: 1.45;
}

.catalog-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 10px;
    border-top: 1px solid #f1f5f9;
}

.catalog-card {
    width: 100%;
    border: 0;
    border-radius: 0;
    background: #ffffff;
    padding: 0;
    color: #111827;
    text-align: center;
}

.catalog-card img {
    width: 100%;
    display: block;
    border: 0;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.catalog-card span {
    display: block;
    margin-top: 6px;
    font-size: 14px;
    font-weight: 500;
}

.catalog-card:hover {
    background: #ffffff;
    transform: translateY(-1px);
}

.input-area {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1300;
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.98);
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 -4px 12px rgba(15, 23, 42, 0.08);
}

input[type="text"] {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    font-size: 16px;
    border-radius: 10px;
    border: 1px solid #979797;
}

button {
    padding: 12px 20px;
    font-size: 16px;
    background-color: #111827;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.1s ease;
}

button:hover {
    background-color: #0f172a;
    transform: translateY(-1px);
}

.send-btn {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #000000;
    border: none;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.1s ease;
}

.send-btn:hover {
    background-color: #ff7b0f;
    transform: translateY(-1px);
}

.send-btn svg {
    pointer-events: none;
}

.chat-row {
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
}

.chat-bubble {
    background-color: #f1f5f9;
    border-radius: 12px;
    padding: 10px 14px;
    margin: 3px 0;
    display: inline-block;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.chat-bubble.user {
    background-color: #eeeeee;
    align-self: flex-end;
    max-width: 75%;
    text-align: right;
}

.chat-bubble.bot {
    background-color: #ffffff;
    border: 0;
    border-radius: 0;
    padding: 0;
    max-width: 100%;
    width: 100%;
}

.menu-gallery-title {
    margin: 0 0 6px;
    font-size: 18px;
}

.menu-gallery-empty {
    margin: 0;
    color: #6b7280;
}

.loading-icon {
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.gallery {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    margin-top: 12px;
    width: 100%;
    max-width: 100%;
}

.gallery .item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    border: 0;
    border-radius: 0px;
    padding: 0;
    background: #ffffff;
}

.gallery .item .item-title {
    margin: 0;
    font-size: 14px;
    font-weight: 400;
    text-align: left;
    width: 100%;
    padding-left: 5px;
    padding-right: 5px;
}

.gallery img {
    width: 100%;
    border-radius: 0;
    display: block;
    object-fit: cover;
}

.gallery .item p {
    margin: 4px 0 0 0;
    text-align: left;
}

.gallery .item .price {
    padding-left: 5px;
    padding-right: 5px;
}

.gallery .item p.links-row {
    margin: 6px 0 0 0;
    text-align: center;
    width: 100%;
}

.gallery .item p.links-row a {
    display: inline-block;
    font-size: 8px;
    font-weight: 600;
}

.gallery .item p h5 {
    margin: 0;
    display: inline;
    line-height: 1.3;
}

.chat-bubble.bot .typing-text,
.chat-bubble.bot #typing-text,
.chat-bubble.bot > p:first-of-type {
    display: block;
    padding-left: 10px;
    padding-right: 10px;
}

.gallery .item .link-separator {
    display: inline-block;
    padding: 0 4px;
    line-height: 1.2;
}

img.fade-in {
    opacity: 0;
    transition: opacity 0.9s ease-in-out;
}

img.fade-in.show {
    opacity: 1;
}

@media (max-width: 768px) {
    body {
        padding: 0;
    }

    .container {
        max-width: 100%;
        margin: 0;
        padding: 0;
        border-radius: 0;
        min-height: calc(100dvh - 134px);
    }

    .chat-box {
        padding-bottom: 112px;
    }

    .chat-static-copy h2 {
        font-size: 16px;
    }
}

@media (min-width: 769px) {
    .container {
        max-width: 980px;
        margin: 0 auto;
    }

    .input-area {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        width: min(980px, calc(100% - 24px));
    }
}
