* { margin: 0; padding: 0; box-sizing: border-box; font-family: system-ui, sans-serif; }
body { background: #f8f9fa; }
header { background: #fff; padding: 16px 24px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.logo a { font-size: 24px; font-weight: 700; color: #1a73e8; text-decoration: none; }

.chat-hero { max-width: 800px; margin: 40px auto; padding: 20px; background: #fff; border-radius: 16px; box-shadow: 0 4px 20px rgba(0,0,0,0.05); }
.chat-hero h1 { text-align: center; margin-bottom: 20px; font-size: 28px; }
.chat-container { display: flex; flex-direction: column; gap: 10px; }
#chat-messages { max-height: 400px; overflow-y: auto; padding: 10px; }
#chat-messages .message { padding: 10px 14px; margin-bottom: 8px; border-radius: 12px; max-width: 85%; }
#chat-messages .message.user { background: #e3f2fd; margin-left: auto; }
#chat-messages .message.bot { background: #f1f3f4; margin-right: auto; }
#chat-form { display: flex; gap: 10px; }
#chat-input { flex: 1; padding: 12px 16px; border: 1px solid #ddd; border-radius: 30px; font-size: 16px; }
#chat-input:focus { border-color: #1a73e8; outline: none; }
#chat-form button { padding: 12px 24px; background: #1a73e8; color: #fff; border: none; border-radius: 30px; cursor: pointer; font-size: 16px; }

.categories { padding: 40px 20px; max-width: 1200px; margin: 0 auto; }
.categories h2 { margin-bottom: 20px; }
.category-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; }
.category-card { background: #fff; padding: 20px; border-radius: 12px; text-align: center; text-decoration: none; color: #333; font-weight: 500; box-shadow: 0 2px 8px rgba(0,0,0,0.06); transition: transform 0.2s; }
.category-card:hover { transform: translateY(-2px); }

.popular-products { padding: 40px 20px; max-width: 1200px; margin: 0 auto; }
.popular-products h2 { margin-bottom: 20px; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; }
.product-card { background: #fff; border-radius: 12px; padding: 16px; text-decoration: none; color: #333; box-shadow: 0 2px 8px rgba(0,0,0,0.06); transition: transform 0.2s; border: 1px solid #eee; }
.product-card:hover { transform: translateY(-4px); border-color: #1a73e8; }
.product-card img { width: 100%; height: 160px; object-fit: contain; }
.product-card h3 { font-size: 14px; margin: 10px 0 6px; }
.product-card .price { font-weight: 700; color: #1a73e8; }

footer { text-align: center; padding: 24px; color: #999; font-size: 14px; }

/* Стили для сообщений и карточек */
.message {
    padding: 10px 14px;
    margin-bottom: 8px;
    border-radius: 12px;
    max-width: 85%;
    word-wrap: break-word;
}
.message.user {
    background: #e3f2fd;
    margin-left: auto;
}
.message.bot {
    background: #f1f3f4;
    margin-right: auto;
}
.product-card.inline {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 12px 16px;
    margin: 8px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}
.product-card.inline .price {
    color: #1a73e8;
    font-weight: bold;
}
.btn-link {
    background: #1a73e8;
    color: #fff;
    padding: 6px 16px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 14px;
}
.btn-link:hover {
    background: #1557b0;
}
#chat-messages {
    max-height: 500px;
    overflow-y: auto;
    padding: 10px;
    scroll-behavior: smooth;
}

/* ===== ЧАТ-ВИДЖЕТ ===== */
.chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999;
    max-width: 400px;
    width: 100%;
}
.chat-toggle {
    background: #1a73e8;
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    float: right;
}
.chat-container {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    padding: 16px;
    margin-top: 8px;
    max-height: 400px;
    display: flex;
    flex-direction: column;
}
#chat-messages {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 8px;
}
#chat-messages .message {
    margin-bottom: 6px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
}
#chat-messages .message.user {
    background: #e3f2fd;
    margin-left: auto;
}
#chat-messages .message.bot {
    background: #f1f3f4;
    margin-right: auto;
}
#chat-form {
    display: flex;
    gap: 8px;
}
#chat-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 14px;
}
#chat-form button {
    background: #1a73e8;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
}

/* ===== СТРАНИЦА ПОИСКА ===== */
.search-results {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
}
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}
.product-card {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.2s;
    border: 1px solid #eee;
}
.product-card:hover {
    transform: translateY(-4px);
    border-color: #1a73e8;
}
.product-card a {
    text-decoration: none;
    color: #333;
}
.product-card h3 {
    font-size: 14px;
    margin: 8px 0;
}
.product-card .price {
    font-weight: 700;
    color: #1a73e8;
    font-size: 18px;
}
.product-card .category {
    font-size: 12px;
    color: #888;
}

/* ===== СТРАНИЦА ТОВАРА ===== */
.product-detail {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px;
}
.product-detail h1 {
    font-size: 28px;
}
.product-detail .price {
    font-size: 32px;
    font-weight: 700;
    color: #1a73e8;
}
.product-detail .btn-back {
    display: inline-block;
    margin-top: 20px;
    padding: 10px 20px;
    background: #1a73e8;
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
}

/* ===== СПИСОК ТОВАРОВ (ДЛЯ КАТЕГОРИЙ) ===== */
.product-list {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
}
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}
.product-card {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.2s;
    border: 1px solid #eee;
}
.product-card:hover {
    transform: translateY(-4px);
    border-color: #1a73e8;
}
.product-card a {
    text-decoration: none;
    color: #333;
}
.product-card h3 {
    font-size: 14px;
    margin: 8px 0;
}
.product-card .price {
    font-weight: 700;
    color: #1a73e8;
    font-size: 18px;
}
