/* —— basic reset —— */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Brand color variables */
:root {
  --bg-off-white: #f4f2ee; /* Background Off-White */
  --plum: #5e2750; /* Primary brand accent */
  --black: #0b0b0c; /* Primary text / interface */
  --silver: #c7c7c7; /* Borders / dividers */
  --white: #ffffff; /* Highlights / text on dark */
}

/* —— body + fonts —— */
body {
  /* Body font: Montserrat (already loaded in index.html). */
  font-family: "Montserrat", Arial, Helvetica, sans-serif;
  color: var(--black);
  background: var(--bg-off-white);
  display: flex;
  justify-content: center;
}

/* Headings font: Bauer Bodoni (use fallbacks if the exact font isn't installed).
   If you have the Bauer Bodoni webfont, consider loading it with @font-face
   or linking to a hosted font provider. */
h1,
h2,
.site-title,
.assistant-intro,
.msg.ai {
  font-family: "Bauer Bodoni", "Bodoni MT", "Didot", Georgia, serif;
  /* Bodoni-style headings often look best at a heavier weight */
  font-weight: 600;
}

.page-wrapper {
  width: 90%;
  max-width: 900px;
}

/* header */
.site-header {
  text-align: center;
  padding-top: 50px;
}

.site-title {
  font-size: 22px;
  font-weight: 500;
  margin-bottom: 10px;
  color: var(--plum);
}

/* chat window */
.chatbox {
  margin: 40px 0;
}

/* action panels (stacked cards) */
.action-panels {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

.action-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--silver);
  background: linear-gradient(180deg, #ffffff 0%, #fbfafb 100%);
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(11,11,12,0.03);
}

.action-title {
  font-family: "Bauer Bodoni", "Bodoni MT", "Didot", Georgia, serif;
  font-size: 18px;
  margin: 0;
  color: var(--plum);
}

.action-copy {
  font-family: "Montserrat", Arial, Helvetica, sans-serif;
  font-size: 14px;
  color: #333;
  margin: 0;
}

.action-btn {
  align-self: flex-start;
  margin-top: 6px;
  background: var(--plum);
  color: var(--white);
  border: none;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
}

.action-btn:hover {
  background: #46183a;
}

@media (min-width: 680px) {
  .action-panels {
    grid-template-columns: repeat(3, 1fr);
  }
  .action-card {
    padding: 18px;
  }
}

.chat-window {
  height: 360px;
  border: 1px solid var(--silver);
  padding: 20px;
  font-size: 18px;
  line-height: 1.5;
  overflow-y: auto;
  background: var(--white);
  color: var(--black);
  white-space: pre-line;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

/* messages */
.msg {
  margin-bottom: 14px;
  line-height: 1.5;
}

.msg.user {
  color: var(--black);
}

.msg.ai {
  color: var(--plum);
}

/* typing indicator style */
.msg.typing {
  font-style: italic;
  color: var(--plum);
  opacity: 0.9;
}

/* input row */
.chat-form {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.chat-form input {
  flex: 1;
  padding: 12px;
  border: 1px solid var(--silver);
  font-size: 18px;
}

.chat-form button {
  font-size: 18px;
  background: var(--plum);
  color: var(--white);
  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 .material-icons {
  font-size: 24px;
}

.chat-form button:hover {
  background: #46183a; /* slightly darker plum */
}

.chat-form button:focus {
  outline: 2px solid var(--plum);
  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: var(--black);
}

.site-footer nav {
  margin-top: 12px;
}

.site-footer a {
  margin: 0 8px;
  color: var(--plum);
  text-decoration: none;
}

.site-footer a:hover {
  color: #46183a;
}

/* small disclaimer style appended for the Routine Builder product list */
.site-footer .disclaimer {
  margin-top: 10px;
  font-size: 12px;
  color: #666;
}

/* ---- Routine Builder product grid (scoped, minimal impact) ---- */
.routine-builder {
  margin: 28px 0 40px;
}
.routine-inner {
  border: 1px solid transparent; /* keeps layout flow, no visual change */
  padding: 12px 0;
}
.routine-title {
  font-family: "Bauer Bodoni", "Bodoni MT", "Didot", Georgia, serif;
  font-size: 20px;
  color: var(--plum);
  margin: 0 0 8px 0;
}
.routine-sub {
  font-family: "Montserrat", Arial, Helvetica, sans-serif;
  font-size: 13px;
  color: #333;
  margin: 0 0 14px 0;
}

/* Routine Builder product grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  align-items: start;
}
.product-card {
  background: var(--white);
  border: 1px solid var(--silver);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: box-shadow 160ms ease, transform 160ms ease;
  cursor: pointer;
  width: 100vw;
  box-sizing: border-box;
}
.product-card:hover {
  box-shadow: 0 6px 18px rgba(11,11,12,0.08);
  transform: translateY(-4px);
}
.product-image {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: contain;
  background: #fafafa;
  border-radius: 6px;
}
.product-brand {
  font-size: 12px;
  color: var(--plum);
  font-weight: 600;
  line-height: 1;
}
.product-name {
  font-size: 13px;
  color: var(--black);
  line-height: 1.2;
}
.product-card.selected {
  outline: 3px solid rgba(94,39,80,0.14);
  box-shadow: 0 10px 30px rgba(94,39,80,0.06);
}

/* Pagination styles */
.product-pagination {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  margin-top: 12px;
}
.product-pagination .pagination-status {
  font-size: 13px;
  color: #333;
  margin-right: 8px;
}
.product-pagination .pagination-btn,
.product-pagination .pagination-page {
  background: var(--white);
  border: 1px solid var(--silver);
  color: var(--plum);
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.product-pagination .pagination-btn:disabled {
  opacity: 0.46;
  cursor: default;
}
.product-pagination .pagination-page.active {
  background: var(--plum);
  color: var(--white);
  border-color: transparent;
}

/* Modal styles */
.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--white);
  border: 1px solid var(--silver);
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(11,11,12,0.08);
  padding: 20px;
  z-index: 1000;
}
.modal-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.modal-close {
  align-self: flex-end;
  background: transparent;
  border: none;
  font-size: 18px;
  cursor: pointer;
}

/* small helper for accessibility/visually-hidden notices if needed */
.product-grid-notice {
  margin-top: 10px;
  font-size: 13px;
  color: #333;
}

@media (min-width: 900px) {
  .product-grid {
    gap: 14px;
  }
}

/* small flash when search jumps to grid */
.product-grid.flash {
  box-shadow: 0 8px 26px rgba(94,39,80,0.06);
  transform: translateY(-2px);
}
