:root {
  --bg: #0d0f13;
  --card: #1a1d25;
  --bubble-user: #2962ff;
  --bubble-bot: #2a2f3a;
  --text: #e6e9ef;
  --accent: #7aa2f7;
  --input-bg: #1d2027;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #fff;
  font-family: sans-serif;
  color: var(--text);
  height: 100vh;
  overflow: hidden;
}

.header-logo {
  position: fixed;
  top: 10px;
  left: 16px;
  z-index: 999;
}

.header-logo img {
  height: 46px;
  opacity: 0.95;
  transition: opacity 0.2s ease;
}

.header-logo img:hover {
  opacity: 1;
}

.app {
  display: flex;
  justify-content: center;
  height: 100vh;
  padding: 16px 0 96px;
}

.chat {
  width: 100%;
  max-width: 1100px;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#chatLog {
  flex: 1;
  overflow-y: auto;
  padding-right: 6px;
  padding-bottom: 40px;
}

#chatLog::-webkit-scrollbar {
  width: 6px;
}

#chatLog::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 3px;
}

.bubble {
  padding: 10px 14px;
  margin: 6px 0;
  border-radius: 12px;
  font-size: 15px;
  line-height: 1.5;
  word-wrap: break-word;
}

.bubble.user {
  background: #131313;
  color: #fff;
  width: fit-content;
  max-width: 80%;
  text-align: right;
  margin-left: auto;
  border-bottom-right-radius: 4px;
}

.bubble.bot {
  background: #fff;
  color: #131313;
  max-width: 100%;
  margin-right: auto;
  border-bottom-left-radius: 4px;
}

.bottom {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px 16px 16px;
  display: flex;
  justify-content: center;
  z-index: 100;
}

.input-wrapper {
  width: 100%;
  max-width: 900px;
}

.input-box {
  display: flex;
  align-items: flex-end;
  background: var(--input-bg);
  padding: 10px 12px;
  border-radius: 18px;
  gap: 8px;
  border: 1px solid #333;
}


.input-box textarea {
  flex: 1;
  background: none;
  border: none;
  color: #fff;
  font-size: 15px;
  outline: none;
  resize: none;
  line-height: 28px;
  min-height: 28px;
  max-height: 140px;
  overflow-y: hidden;
  padding: 6px 0;
  white-space: pre-wrap;
  word-break: break-word;
  display: block;
}





.send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  color: #111;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 16px;
  font-weight: bold;
}

.send-btn:hover {
  transform: translateY(-1px);
}

.shuffle-btn {
  padding: 6px 12px;
  background: transparent;
  color: var(--accent);
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid var(--accent);
  cursor: pointer;
  font-size: 12px;
  white-space: nowrap;
}

.shuffle-btn:hover {
  background: rgba(122, 162, 247, 0.1);
}

.products-inline {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 5px;
}

.cardp {
  position: relative;
  background: #fff;
  overflow: hidden;
  border-radius: 10px;
}

.cardp img {
  width: 100%;
  height: 600px;
  object-fit: cover;
  display: block;
  transform: scale(1.05);
  transition: transform 0.4s ease-in-out;
  z-index: 1;
}

.cardp:hover img {
  transform: scale(1);
}

.meta {
  padding: 10px;
}

.meta .title {
  font-size: 14px;
  font-weight: 600;
  color: #131313;
}

.meta .sku {
  font-size: 12px;
  opacity: .9;
  margin: 4px 0;
  color: #2b2b2b;
}

.meta .size {
  font-size: 13px;
  margin: 4px 0;
  opacity: .9;
  color: #2b2b2b;
}

.meta .price {
  font-size: 14px;
  color: #131313;
  margin: 6px 0 8px;
}

.meta a {
  display: block;
  padding: 6px 8px;
  background: #131313;
  text-align: center;
  color: #ffffff;
  font-weight: 700;
  text-decoration: none;
  font-size: 13px;
  border-radius: 6px;
}

#preloader {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.preloader-box {
  width: 260px;
  height: 160px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 240px;
  height: 360px;
  margin-bottom: 20px;
  overflow: hidden;
  background: transparent !important;
}

.image-grid img {
  width: 100%;
  height: 80px;
  object-fit: cover;
  border: 2px solid #890202;
  border-radius: 0px;
  transition: transform 0.2s ease-out, opacity 0.2s ease-out, border-color 0.2s;
}

.image-grid img.active {
  transform: scale(1.05);
  opacity: 1;
  border-color: #131313;
}

#counterFloat {
  position: absolute;
  bottom: 20px;
  padding: 10px 24px;
  background: rgb(95, 3, 3);
  color: #fffefe;
  font-weight: bold;
  white-space: nowrap;
  border-radius: 0px;
  font-size: 13px;
}

#viewModal {
  position: fixed;
  inset: 0;
  background: #0009;
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 99999;
}

.modal-content {
  background: #1a1d23;
  width: 90%;
  max-width: 1200px;
  padding: 20px;
}

.modal-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.close-modal {
  padding: 8px 16px;
  background: white;
  border: none;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 12px;
}

.hidden-meta {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.81);
  color: white;
  padding: 10px;
  display: none;
  z-index: 2;
}

.cardp:hover .hidden-meta,
.cardp.selected .hidden-meta {
  display: block;
}

.cardp .top-icons {
  position: absolute;
  top: 20px;
  left: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 5;
}

.cardp .top-icons a {
  width: 24px;
  height: 24px;
  display: block;
}

.cardp .top-icons a img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 4px;
  transition: transform 0.2s ease;
}

.cardp .top-icons a:hover img {
  transform: scale(1.15);
}

.feedback-icons {
  position: absolute;
  top: 20px;
  right: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 4;
}

.feedback-icons img {
  width: 26px;
  height: 26px;
  cursor: pointer;
  transition: transform 0.2s, opacity 0.2s;
}

.feedback-icons img:hover {
  transform: scale(1.1);
  opacity: 1;
}

.feedback-icons img.selected,
.feedback-icons img.disliked {
  transform: scale(1.25);
  border: 2px solid #000;
  border-radius: 50%;
  background: #fff;
}

@media (max-width: 768px) {
  .bubble.bot {
    margin-top: 20px;
  }
}

#textareaMirror{
  position: fixed;
  left: -9999px;
  top: -9999px;
  visibility: hidden;
  white-space: pre-wrap;
  word-break: break-word;
}

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