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

/* —— body + fonts —— */
body {
  font-family: "Montserrat", Arial, Helvetica, sans-serif;
  color: #333;
  display: flex;
  justify-content: center;
}

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

/* Brand color variables (L'Oréal yellow accents) */
:root {
  --loreal-yellow: #c7a008; /* primary yellow/gold */
  --loreal-yellow-100: #f7ecd0; /* light background */
  --loreal-yellow-dark: #8f6e00;
}

/* Brand strip used between major sections */
.brand-strip {
  background: linear-gradient(90deg, var(--loreal-yellow-100), #fff);
  border-left: 6px solid var(--loreal-yellow);
  color: #111;
  padding: 12px 14px;
  margin: 18px 0;
  border-radius: 6px;
  text-align: center;
  font-weight: 600;
}

.brand-strip--inverted {
  background: linear-gradient(90deg, var(--loreal-yellow), #f9eab0);
  color: #080808;
  border-left-color: transparent;
}

/* Top navigation */
.main-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  gap: 12px;
  border-bottom: 1px solid #e9e9e9;
}

.main-nav .nav-left {
  display: flex;
  gap: 16px;
  align-items: center;
}

.main-nav a {
  color: #111;
  text-decoration: none;
  font-weight: 500;
  padding: 6px 8px;
}

.main-nav a:hover {
  color: #666;
}

.main-nav .nav-right {
  display: flex;
  gap: 12px;
  align-items: center;
}

.main-nav .nav-home {
  font-size: 18px;
}

/* header */
.site-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-top: 50px;
  padding-bottom: 10px;
}

.logo {
  display: block;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 15px;
  width: 250px;
  max-width: 100%;
}

.site-title {
  font-size: 22px;
  font-weight: 500;
  margin-bottom: 10px;
}

/* Hero container that groups logo + short explanation */
.hero-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 28px 12px 22px;
  border-bottom: 2px solid #eee;
  background: linear-gradient(180deg, #ffffff 0%, #fbfbfb 100%);
}

.hero-copy.container {
  max-width: 820px;
  text-align: center;
}

.hero-description {
  font-size: 16px;
  color: #555;
  margin-top: 6px;
  line-height: 1.4;
}

.content-container {
  padding: 28px 0;
}

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

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

.search-section select:focus {
  outline: none;
  border-color: #666;
}

.search-section input#productSearch {
  padding: 16px;
  font-size: 18px;
  border: 2px solid #000;
  border-radius: 8px;
  background-color: white;
  font-weight: 500;
  width: 100%;
  margin-bottom: 0;
}

.search-section input#productSearch:focus {
  outline: none;
  border-color: #666;
}

/* chat section */
.chatbox {
  margin: 40px 0;
  border: 2px solid #000;
  border-radius: 8px;
  padding: 26px;
}

.chatbox h2 {
  font-size: 20px;
  margin-bottom: 20px;
}

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

/* 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: #000;
}

.chat-form button {
  font-size: 18px;
  background: #000;
  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: #666666;
}

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

/* Highlight selected product card */
.product-card.selected {
  border: 2px solid #007bff;
  background: #eaf4ff;
}

/* Selected products list styling */
#selectedProductsList {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Selected product item */
.selected-product-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f5f5f5;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 8px 12px;
}

/* Remove button for selected products */
.remove-selected-btn {
  background: #ff4d4d;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.remove-selected-btn:hover {
  background: #d11a1a;
}

/* 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: 40px 0 0;
  padding: 56px 18px; /* increased vertical padding for more breathing room */
  background: #f6f6f6;
  color: #444;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 20px;
  align-items: start;
  max-width: 1100px;
  margin: 0 auto;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-logo {
  width: 180px;
  max-width: 100%;
}

.footer-inner h4 {
  margin-bottom: 8px;
  font-size: 16px;
  color: #111;
}

.footer-inner nav {
  display: flex;
  flex-direction: column;
  gap: 10px; /* increased vertical gap for footer links */
}

.footer-inner a {
  color: #000;
  text-decoration: none;
  font-size: 14px;
}

.footer-inner a:hover {
  color: #666;
}

/* small yellow accent before footer headings */
.footer-inner h4::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  background: var(--loreal-yellow);
  margin-right: 8px;
  vertical-align: middle;
}

@media (max-width: 900px) {
  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .footer-inner {
    grid-template-columns: 1fr;
    text-align: left;
  }
  .hero-copy.container {
    padding: 0 12px;
  }
}

/* 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;
}

.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 #000;
  border-radius: 8px;
}

.selected-products h2 {
  font-size: 20px;
  margin-bottom: 20px;
}

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

.generate-btn {
  width: 100%;
  margin-top: 20px;
  padding: 16px;
  font-size: 18px;
  font-weight: 500;
  color: #fff;
  background: #000;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s;
}

.generate-btn:hover {
  background: #666;
}

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

/* Collapsible product description */
.product-description {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  background: #f9f9f9;
  color: #333;
  font-size: 15px;
  margin-top: 8px;
  padding: 0 8px;
  border-radius: 4px;
}

/* When expanded, show the description */
.product-description.expanded {
  max-height: 300px; /* enough for most descriptions */
  padding: 12px 8px;
}

/* Toggle button for description */
.toggle-description-btn {
  margin-top: 8px;
  background: #007bff;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.2s;
}

.toggle-description-btn:hover,
.toggle-description-btn:focus {
  background: #0056b3;
  outline: none;
}

/* RTL Toggle Button */
.rtl-toggle-btn {
  background: #007bff;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 16px;
  cursor: pointer;
  margin-bottom: 10px;
  transition: background 0.2s;
}
.rtl-toggle-btn:hover,
.rtl-toggle-btn:focus {
  background: #0056b3;
  outline: none;
}

/* Button hover effect: gold background, black text */
button:hover,
button:focus,
.generate-btn:hover,
.toggle-description-btn:hover,
.remove-selected-btn:hover,
.rtl-toggle-btn:hover {
  background: #c7a008;
  color: #000;
  outline: none;
  transition: background 0.2s, color 0.2s;
}

/* RTL Layout Styles */
body.rtl,
.page-wrapper.rtl {
  direction: rtl;
}

body.rtl .products-grid,
.page-wrapper.rtl .products-grid {
  flex-direction: row-reverse;
}

body.rtl .selected-products,
.page-wrapper.rtl .selected-products {
  text-align: right;
}

body.rtl .selected-product-item,
.page-wrapper.rtl .selected-product-item {
  flex-direction: row-reverse;
}

body.rtl .chatbox,
.page-wrapper.rtl .chatbox {
  text-align: right;
}

body.rtl .chat-form,
.page-wrapper.rtl .chat-form {
  flex-direction: row-reverse;
}

body.rtl .site-header,
.page-wrapper.rtl .site-header {
  text-align: right;
}
