* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --red: #ff003b;
  --gold: #e3a535;
  --ink: #171717;
  --cream: #fbfaf7;
  --line: #dedbd3;
}

body {
  min-height: 100vh;
  font-family: "Montserrat", Arial, Helvetica, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 4%, rgba(227, 165, 53, 0.12), transparent 24rem),
    linear-gradient(135deg, #fff 0%, var(--cream) 100%);
}

.page-wrapper { width: min(1180px, calc(100% - 48px)); margin: 0 auto; }

.site-header {
  height: 126px;
  display: flex;
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.site-header::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 72px;
  height: 3px;
  background: var(--red);
}
.logo { width: 184px; height: auto; }
.site-title {
  margin-left: auto;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(18px, 2vw, 25px);
  font-weight: 400;
  letter-spacing: -0.02em;
}

main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 36px;
  align-items: start;
  padding: 42px 0 24px;
}

.browse-section { min-width: 0; }
.section-heading, .selected-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}
.eyebrow {
  margin-bottom: 5px;
  color: var(--red);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.section-heading h2, .selected-heading h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 31px;
  font-weight: 400;
  letter-spacing: -0.03em;
}

.search-section { width: 210px; }
.search-section select {
  width: 100%;
  height: 46px;
  padding: 0 38px 0 14px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #fff;
  color: var(--ink);
  font: 600 12px "Montserrat", sans-serif;
  cursor: pointer;
}
.search-section select:focus { outline: 2px solid rgba(255, 0, 59, 0.18); border-color: var(--red); }

.products-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  min-height: 220px;
}
.placeholder-message {
  grid-column: 1 / -1;
  min-height: 220px;
  display: grid;
  place-items: center;
  border: 1px dashed #cbc7bd;
  color: #77736a;
  background: rgba(255,255,255,0.55);
}
.product-card {
  position: relative;
  min-height: 290px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #fff;
  overflow: hidden;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}
.product-card:hover {
  transform: translateY(-3px);
  border-color: #bcb6aa;
  box-shadow: 0 12px 28px rgba(38, 31, 20, 0.09);
}
.product-card.selected {
  border: 2px solid var(--red);
  box-shadow: 0 8px 24px rgba(255, 0, 59, 0.10);
}
.product-card.selected::after {
  content: "\f00c";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-size: 11px;
}
.product-card img {
  width: 100%;
  height: 190px;
  object-fit: contain;
  padding: 18px;
  background: #f8f7f3;
}
.product-card .product-info {
  min-height: 98px;
  padding: 14px 16px;
}
.product-card .brand-name {
  color: var(--gold);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.product-card h3 {
  margin-top: 5px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.25;
}

.selected-products {
  position: sticky;
  top: 24px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(38, 31, 20, 0.07);
}
.selected-heading { align-items: center; margin-bottom: 16px; }
.selected-heading h2 { font-size: 23px; }
.selected-count {
  min-width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.selected-products-list {
  min-height: 110px;
  max-height: 300px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 2px;
}
.empty-selection {
  margin: 25px 0;
  text-align: center;
  color: #99958c;
  font-size: 12px;
}
.selected-chip {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 9px;
  padding: 7px;
  border: 1px solid #eeeae2;
  background: #fbfaf7;
}
.selected-chip img { width: 42px; height: 42px; object-fit: contain; }
.selected-chip-name { font-size: 11px; line-height: 1.35; }
.remove-product {
  border: 0;
  background: transparent;
  color: #99958c;
  cursor: pointer;
}
.remove-product:hover { color: var(--red); }
.generate-btn {
  width: 100%;
  height: 48px;
  margin-top: 16px;
  border: 0;
  border-radius: 2px;
  background: var(--red);
  color: #fff;
  font: 700 12px "Montserrat", sans-serif;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 180ms ease, transform 180ms ease;
}
.generate-btn:not(:disabled):hover { background: #d90034; transform: translateY(-1px); }
.generate-btn:disabled { background: #dcd8cf; color: #99958c; cursor: not-allowed; }
.generate-btn i { margin-right: 8px; }

.chatbox {
  margin: 24px 0 48px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 26px 0;
}
.chatbox h2 { font-family: Georgia, "Times New Roman", serif; font-size: 24px; font-weight: 400; }
.chat-window {
  height: 220px;
  margin: 18px 0;
  padding: 18px;
  overflow-y: auto;
  background: rgba(255,255,255,0.7);
  border: 1px solid #eeebe4;
  font-size: 14px;
  line-height: 1.7;
}
.chat-message { max-width: 78%; margin-bottom: 10px; padding: 10px 13px; }
.chat-message.user { margin-left: auto; background: var(--ink); color: #fff; }
.chat-message.assistant { background: #f2eee5; }
.chat-form { display: flex; gap: 10px; }
.chat-form input {
  flex: 1;
  height: 48px;
  padding: 0 16px;
  border: 1px solid var(--line);
  background: #fff;
  font: 500 14px "Montserrat", sans-serif;
}
.chat-form input:focus { outline: 2px solid rgba(227, 165, 53, 0.22); border-color: var(--gold); }
.chat-form button {
  width: 48px;
  height: 48px;
  border: 0;
  background: var(--ink);
  color: #fff;
  cursor: pointer;
}
.chat-form button:hover { background: var(--gold); color: var(--ink); }

.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;
}
.site-footer {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  color: #77736a;
  font-size: 11px;
}
.site-footer a { margin-left: 18px; color: var(--ink); text-decoration: none; }
.site-footer a:hover { color: var(--red); }

@media (max-width: 960px) {
  main { grid-template-columns: 1fr; }
  .selected-products { position: static; }
  .products-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .page-wrapper { width: min(100% - 28px, 1180px); }
  .site-header { height: 100px; }
  .logo { width: 130px; }
  .site-title { max-width: 150px; text-align: right; }
  main { padding-top: 28px; }
  .section-heading { align-items: end; }
  .section-heading h2 { font-size: 25px; }
  .search-section { width: 165px; }
  .products-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .product-card { min-height: 250px; }
  .product-card img { height: 160px; }
  .product-card .product-info { min-height: 88px; padding: 11px; }
  .product-card h3 { font-size: 14px; }
  .site-footer { align-items: flex-start; flex-direction: column; justify-content: center; gap: 8px; }
  .site-footer nav a:first-child { margin-left: 0; }
}
