:root {
  --orange: #ff6a2b;
  --blue: #2563eb;
  --light: #f9fafb;
  --border: #e5e7eb;
  --text: #111827;
  --muted: #6b7280;
  --radius: 16px;
  --green-cashback: #2DDB6D;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Arial, sans-serif;
  color: var(--text);
  background: #fff;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

/* HEADER */
header { border-bottom: 1px solid var(--border); background: #fff; }
.topline {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 24px; font-size: 13px; color: var(--muted);
}
.topline nav { display: flex; gap: 16px; }
.topbar { display: flex; align-items: center; gap: 16px; padding: 14px 24px; }
.logo { max-width: 136px; width: 100%; }
.catalog-btn { background: #f3f4f6; border-radius: 12px; padding: 10px 14px; font-weight: 600; cursor: pointer; }
.search { flex: 1; position: relative; }
.search input {
  width: 100%; padding: 12px 16px; border-radius: 14px;
  border: 2px solid var(--blue); outline: none;
}
.icons { display: flex; gap: 20px; font-size: 13px; color: var(--muted); }

/* HERO */
.hero { margin: 24px; border-radius: 24px; overflow: hidden; }
.hero img { width: 100%; height: auto; min-height: 280px; object-fit: cover; }

/* SECTIONS GENERAL */
section { padding: 32px 24px; max-width: 1240px; margin: 0 auto; }
h2 { font-size: 24px; font-weight: 700; margin: 0 0 25px; text-align: center; }

/* GRID & CARDS */
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
}
.labels-top {
  position: absolute;
  top: 8px; right: 8px;
  z-index: 5; display: flex; flex-direction: column; align-items: flex-end; gap: 4px;
}
.label { font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 4px; }
.label-yellow { background: #E6FF00; color: #000; }
.label-orange { background: #FF5C35; color: #fff; }

.discount-tag {
  position: absolute; top: 180px; left: 0;
  background: #E6FF00; font-weight: bold; padding: 2px 6px; border-radius: 4px; font-size: 12px;
  z-index: 5;
}

.image-wrapper { position: relative; width: 100%; aspect-ratio: 1/1; margin-bottom: 12px; background: #fff; }
.image-wrapper img { width: 100%; height: 100%; object-fit: contain; }

.similar-btn {
  position: absolute; bottom: 5px; right: 5px;
  background: rgba(240, 242, 245, 0.9); font-size: 11px; padding: 4px 8px; border-radius: 6px;
  display: flex; align-items: center; gap: 4px; color: #111827;
}

.product-name { font-size: 14px; height: 38px; overflow: hidden; margin-bottom: 8px; display: block; line-height: 1.3; }
.price-row { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.current-price { font-size: 20px; font-weight: 700; }
.old-price { font-size: 13px; color: #999; text-decoration: line-through; }

.cashback-badge {
  background: var(--green-cashback); color: #fff; font-size: 12px; font-weight: 600;
  padding: 6px 12px; border-radius: 20px; width: fit-content; margin-bottom: 12px;
}

.actions { display: flex; gap: 8px; }
.btn-cart { flex: 1; background: var(--orange); color: #fff; border: none; padding: 12px; border-radius: 10px; font-weight: 600; cursor: pointer; }
.btn-wish { border: 1px solid var(--border); background: #fff; width: 44px; border-radius: 10px; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 20px; color: #7B828A; }
.stock { font-size: 11px; color: #9ca3af; margin-top: 8px; }

/* PROMOS (BANNERS) */
.promos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.promo-banner { border-radius: 20px; overflow: hidden; transition: transform 0.2s; display: block; }
.promo-banner:hover { transform: translateY(-4px); }
.promo-banner img { width: 100%; height: auto; display: block; }

/* FOOTER */
footer { background: #111827; color: #9ca3af; padding: 48px 24px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; max-width: 1240px; margin: 0 auto; }

/* AI WIDGET STYLES */
    #chat-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999;
    width: 60px;
    height: 60px;
    background-color: #499bdf!important;
    border-radius: 25px 25px 5px 25px;
    background-image: url(https://matesai.ru/assets/images/ai-icon.png)!important;
    background-size: 40px 40px;
    background-position: center;
    background-repeat: no-repeat;
    text-indent: -9999px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}
/* 💫 Постоянный перелив */
#chat-toggle::before {
  content: "";
  position: absolute;
  top: 0;
  left: -75%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    115deg,
    rgba(255, 255, 255, 0.15) 0%,
    rgba(255, 255, 255, 0.6) 50%,
    rgba(255, 255, 255, 0.15) 100%
  );
  transform: skewX(-20deg);
  animation: shineLoop 3s linear infinite;
  pointer-events: none;
  mix-blend-mode: overlay; /* делает перелив мягким */
}

/* 🔁 Анимация плавного движения света */
@keyframes shineLoop {
  0% {
    left: -80%;
  }
  50% {
    left: 120%;
  }
  100% {
    left: -80%;
  }
}

/* ✨ Светящееся дыхание */
@keyframes aiGlow {
  0% {
    box-shadow: 0 4px 12px rgba(0,0,0,0.3),
                0 0 0 0 rgba(0, 204, 255, 0);
  }
  50% {
    box-shadow: 0 4px 12px rgba(0,0,0,0.3),
                0 0 15px 5px rgba(255, 255, 255, 0.7),
                0 0 30px 10px rgba(255, 255, 255, 0.4);
  }
  100% {
    box-shadow: 0 4px 12px rgba(0,0,0,0.3),
                0 0 0 0 rgba(0, 204, 255, 0);
  }
}


#chat-toggle:hover {
    transform: scale(1.05);
}

#chat-header {
    background: #499bdf!important;
    color: white;
    padding: 15px;
    font-family: "Plus Jakarta Sans", sans-serif;
    font-weight: 700;
    font-size: 18px;
    text-align: center;
}
#send-btn {
    background-color: #bdd919!important;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    margin-left: 10px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ai-widget-user {
    background-color: #47525e!important;
    color: #fff!important;
    border-bottom-right-radius: 4px;
    align-self: flex-end;
/* Скрываем виджет по умолчанию (логика открытия обычно в JS) */
#chat-widget {
    display: none; 
    /* Здесь можно добавить стили для окна чата */
}

/* RESPONSIVE */
@media(max-width: 1024px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .promos { grid-template-columns: 1fr; }
}
.ai-widget-bot р2 a {
    color: #007bff;
    text-decoration: underline;
    font-size:14px !important;
}