/* —— CSS Custom Properties —— */
:root {
  --loreal-red: #ff003b;
  --loreal-gold: #e3a535;
  --text-dark: #333;
  --border-dark: #000;
}

/* —— basic reset —— */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* —— body + fonts —— */
body {
  font-family: "Source Sans Pro", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: #333;
  display: flex;
  justify-content: center;
  font-weight: 400;
  letter-spacing: 0.3px;
}

.page-wrapper {
  width: 90%;
  max-width: 900px;
}

/* header */
.site-header {
  text-align: center;
  padding-top: 50px;
  padding-bottom: 10px;
}

.logo {
  width: 250px;
  margin-bottom: 15px;
}

.site-title {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--loreal-red);
  letter-spacing: 0.5px;
}

/* category filter */
.search-section {
  margin: 30px 0;
  display: flex;
}

.search-section select {
  width: 100%;
  padding: 16px;
  font-size: 16px;
  font-weight: 500;
  border: 2px solid #000;
  border-radius: 8px;
  cursor: pointer;
  background-color: white;
  letter-spacing: 0.3px;
}

.search-section select:focus {
  outline: none;
  border-color: var(--loreal-gold);
}

/* chat section */
.chatbox {
  margin: 40px 0;
  border: 2px solid var(--loreal-red);
  border-radius: 8px;
  padding: 26px;
}

.chatbox h2 {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--loreal-red);
  letter-spacing: 0.3px;
}

.chat-window {
  padding: 20px;
  font-size: 18px;
  line-height: 1.5;
  height: 250px;
  overflow-y: auto;
  background: #fafafa;
  margin-bottom: 20px;
}

/* Chat message styles */
.chat-message {
  margin-bottom: 15px;
  padding: 12px 16px;
  border-radius: 8px;
  animation: fadeIn 0.3s ease;
}

.chat-message.user {
  background-color: rgba(227, 165, 53, 0.1);
  border-left: 4px solid var(--loreal-gold);
  margin-left: 20px;
}

.chat-message.assistant {
  background-color: rgba(255, 0, 59, 0.1);
  border-left: 4px solid var(--loreal-red);
  margin-right: 20px;
}

.chat-message strong {
  color: var(--loreal-red);
  font-weight: 600;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* placeholder message */
.placeholder-message {
  width: 100%;
  text-align: center;
  padding: 40px;
  color: #666;
  font-size: 18px;
}

/* input row */
.chat-form {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.chat-form input {
  flex: 1;
  padding: 12px;
  font-size: 18px;
  border: none;
  border-bottom: 2px solid #ccc;
  background: transparent;
}

.chat-form input:focus {
  outline: none;
  border-bottom-color: var(--loreal-gold);
}

.chat-form button {
  font-size: 18px;
  background: var(--loreal-red);
  color: #fff;
  border: none;
  padding: 12px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.3s;
}

.chat-form button:hover {
  background: var(--loreal-gold);
}

.chat-form button:focus {
  outline: 2px solid #000;
  outline-offset: 2px;
}

/* visually hidden */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* footer */
.site-footer {
  margin: 60px 0 40px;
  text-align: center;
  font-size: 14px;
  color: #666;
}

.site-footer nav {
  margin-top: 12px;
}

.site-footer a {
  margin: 0 8px;
  color: #000;
  text-decoration: none;
}

.site-footer a:hover {
  color: #666666;
}

/* products grid */
.products-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin: 30px 0;
}

.product-card {
  flex: 0 1 calc(33.333% - 14px);
  border: 1px solid #ccc;
  padding: 15px;
  border-radius: 4px;
  display: flex;
  gap: 15px;
  min-height: 160px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.product-card:hover {
  border-color: var(--loreal-gold);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.product-card.selected {
  border: 3px solid var(--loreal-red);
  background-color: rgba(255, 0, 59, 0.05);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(255, 0, 59, 0.2);
}

.product-card.selected:hover {
  border-color: var(--loreal-red);
}

/* Tooltip styles */
.product-tooltip {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%) translateY(-100%);
  background-color: rgba(0, 0, 0, 0.95);
  color: white;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.4;
  max-width: 280px;
  width: max-content;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  font-weight: 400;
  letter-spacing: 0.2px;
}

.product-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid rgba(0, 0, 0, 0.95);
}

.product-card:hover .product-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(-100%) translateY(-8px);
}

.product-card img {
  width: 110px;
  height: 110px;
  object-fit: contain;
  flex-shrink: 0;
}

.product-card .product-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 110px;
}

.product-card h3 {
  font-size: 16px;
  margin-bottom: 8px;
}

.product-card p {
  font-size: 14px;
  color: #666;
}

/* selected products */
.selected-products {
  margin: 40px 0;
  padding: 20px;
  border: 2px solid var(--loreal-red);
  border-radius: 8px;
}

.selected-products h2 {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--loreal-red);
  letter-spacing: 0.3px;
}

#selectedProductsList {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.selected-product-item {
  display: flex;
  align-items: center;
  background-color: rgba(255, 0, 59, 0.1);
  border: 1px solid var(--loreal-red);
  border-radius: 20px;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--loreal-red);
}

.selected-product-item .remove-btn {
  background: none;
  border: none;
  color: var(--loreal-red);
  font-size: 16px;
  margin-left: 8px;
  cursor: pointer;
  padding: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}

.selected-product-item .remove-btn:hover {
  background-color: var(--loreal-red);
  color: white;
}

.clear-all-container {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: 15px;
}

.clear-all-btn {
  background-color: transparent;
  border: 2px solid var(--loreal-red);
  color: var(--loreal-red);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.clear-all-btn:hover {
  background-color: var(--loreal-red);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(255, 0, 59, 0.3);
}

.clear-all-btn i {
  font-size: 12px;
}

.generate-btn {
  width: 100%;
  margin-top: 20px;
  padding: 16px;
  font-size: 18px;
  font-weight: 500;
  color: #fff;
  background: var(--loreal-red);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
}

.generate-btn:hover {
  background: var(--loreal-gold);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 0, 59, 0.3);
}

.generate-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.generate-btn:disabled:hover {
  background: #ccc;
  transform: none;
  box-shadow: none;
}

.generate-btn i {
  margin-right: 8px;
}
