/* ─── SAATHI ✦ — the Shivaa store assistant (v50) ───
   Mobile-first: bottom sheet on phones, docked sidebar on laptops. */

/* v56: Saathi opens from the sidebar menu — no floating action button.
   A soft scrim sits behind the panel so the shop dims while you chat. */
#saathiScrim {
  position: fixed; inset: 0; z-index: 9350;
  background: rgba(20, 5, 9, .45); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none; transition: opacity .3s var(--ease);
}
body.saathi-open #saathiScrim { opacity: 1; pointer-events: auto; }

/* sidebar entry point (the #navSaathi row rendered in index.html) */
.dw-saathi {
  display: flex; align-items: center; gap: 12px; width: calc(100% - 24px);
  margin: 8px 12px 4px; padding: 12px 14px; text-align: left;
  border: 1px solid rgba(194,154,69,.55); border-radius: 16px; cursor: pointer;
  background: linear-gradient(135deg, rgba(194,154,69,.18), rgba(94,21,32,.10));
  color: var(--maroon-deep); font-family: inherit;
  transition: transform .18s var(--ease), box-shadow .18s, border-color .18s;
}
.dw-saathi:hover { transform: translateY(-1px); border-color: var(--gold); box-shadow: 0 8px 22px rgba(138,100,32,.22); }
.dw-saathi .dw-gi {
  flex: 0 0 38px; width: 38px; height: 38px; display: grid; place-items: center;
  border-radius: 50%; font-size: 17px; color: #241503;
  background: radial-gradient(circle at 32% 30%, var(--gold-2), var(--gold) 62%, #8a6420);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.35);
}
.dw-saathi .dw-tx { flex: 1; min-width: 0; }
.dw-saathi .dw-tx b { display: block; font-size: 14.5px; color: var(--maroon-deep); }
.dw-saathi .dw-tx small { display: block; font-size: 11px; color: var(--ink-3); margin-top: 2px; line-height: 1.35; }
.dw-saathi .dw-arx { color: var(--gold); font-size: 18px; flex: 0 0 auto; }

#saathiPanel {
  position: fixed; z-index: 9500; display: flex; flex-direction: column;
  left: 0; right: 0; bottom: 0; top: auto; height: min(92dvh, 780px);
  background: var(--ivory); border-radius: 22px 22px 0 0;
  box-shadow: 0 -18px 60px rgba(29,5,9,.35);
  transform: translateY(105%); transition: transform .38s var(--ease);
  overflow: hidden;
}
body.saathi-open #saathiPanel { transform: translateY(0); }
@media (min-width: 1024px) {
  #saathiPanel {
    left: auto; right: 18px; top: 18px; bottom: 18px; height: auto;
    width: 396px; border-radius: 20px; transform: translateX(120%);
    box-shadow: var(--sh-3); border: 1px solid var(--line);
  }
  body.saathi-open #saathiPanel { transform: translateX(0); }
}

.sa-head {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  background: linear-gradient(135deg, var(--maroon-deep), var(--maroon) 70%);
  color: var(--gold-soft);
}
.sa-ava {
  width: 42px; height: 42px; border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center; font-size: 19px; color: #201409;
  background: radial-gradient(circle at 32% 30%, var(--gold-2), var(--gold) 60%, #8a6420);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.35), 0 3px 10px rgba(0,0,0,.35);
}
.sa-head b { display: block; font: 600 16px/1.2 var(--ff-body); color: #f6e7c6; }
.sa-head small { display: block; font-size: 11.5px; color: #d9bd8d; margin-top: 2px; }
.sa-head .sp { flex: 1; }
.sa-ico {
  border: 0; background: rgba(255,255,255,.08); color: #e9d5ab; width: 34px; height: 34px;
  border-radius: 10px; cursor: pointer; font-size: 15px;
}
.sa-ico:hover { background: rgba(255,255,255,.16); }

.sa-msgs {
  flex: 1; overflow-y: auto; padding: 16px 14px 8px; scroll-behavior: smooth;
  background:
    radial-gradient(1200px 300px at 80% -50px, rgba(185,138,47,.10), transparent 60%),
    var(--cream);
  display: flex; flex-direction: column; gap: 10px;
}
.sa-m { max-width: 86%; padding: 10px 13px; border-radius: 15px; font-size: 13.8px; line-height: 1.5; animation: saIn .28s var(--ease); }
@keyframes saIn { from { opacity: 0; transform: translateY(8px);} to { opacity: 1; transform: none;} }
.sa-m.bot {
  align-self: flex-start; background: var(--white); border: 1px solid var(--line);
  border-bottom-left-radius: 5px; color: var(--ink); box-shadow: var(--sh-1);
}
.sa-m.user {
  align-self: flex-end; background: linear-gradient(135deg, var(--maroon), var(--maroon-2));
  color: #f7ead2; border-bottom-right-radius: 5px;
}
.sa-m b.g { color: var(--gold); }
.sa-m .rate-line { display: flex; justify-content: space-between; gap: 14px; padding: 3px 0; border-bottom: 1px dashed var(--line); }
.sa-m .rate-line:last-of-type { border-bottom: 0; }
.sa-m.typing span { display: inline-block; width: 6px; height: 6px; margin-right: 4px; border-radius: 50%; background: var(--gold); animation: saTy 1s infinite; }
.sa-m.typing span:nth-child(2) { animation-delay: .18s; } .sa-m.typing span:nth-child(3) { animation-delay: .36s; }
@keyframes saTy { 0%,100% { opacity: .25; transform: translateY(0);} 50% { opacity: 1; transform: translateY(-3px);} }

/* product cards row */
.sa-row { display: flex; gap: 9px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: thin; }
.sa-card {
  flex: 0 0 138px; background: var(--white); border: 1px solid var(--line); border-radius: 14px;
  overflow: hidden; cursor: pointer; transition: transform .2s var(--ease), box-shadow .2s;
  text-align: left; padding: 0; font: inherit;
}
.sa-card:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }
.sa-card img { width: 100%; height: 118px; object-fit: cover; background: var(--cream-2); }
.sa-card .b { padding: 7px 9px 9px; }
.sa-card .n { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 11.8px; font-weight: 600; color: var(--ink); min-height: 30px; }
.sa-card .p { font-size: 12.5px; color: var(--maroon); font-weight: 700; margin-top: 3px; }
.sa-card .t { font-size: 10px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }
.sa-more { border: 0; background: none; color: var(--gold); font: 600 12.5px var(--ff-body); cursor: pointer; padding: 2px 4px 6px; }

/* chips */
.sa-chips { display: flex; gap: 7px; overflow-x: auto; padding: 8px 12px; background: var(--cream); border-top: 1px solid var(--line); scrollbar-width: none; }
.sa-chips::-webkit-scrollbar { display: none; }
.sa-chip {
  flex: 0 0 auto; border: 1px solid var(--gold-soft); background: var(--white); color: var(--maroon);
  border-radius: 999px; padding: 7px 13px; font: 500 12.5px var(--ff-body); cursor: pointer;
}
.sa-chip:hover { background: var(--gold-faint); border-color: var(--gold); }

/* input row */
.sa-in { display: flex; gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: var(--white); border-top: 1px solid var(--line); }
.sa-in input {
  flex: 1; border: 1px solid var(--line); border-radius: 999px; padding: 11px 16px;
  font: 400 14px var(--ff-body); color: var(--ink); background: var(--cream); outline: none;
}
.sa-in input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(185,138,47,.15); }
.sa-in button {
  border: 0; border-radius: 999px; width: 44px; height: 44px; cursor: pointer; font-size: 17px;
  background: linear-gradient(135deg, var(--gold-2), var(--gold)); color: #201409;
}
.sa-foot { font-size: 10.5px; color: var(--ink-3); text-align: center; padding: 0 12px 8px; background: var(--white); }

/* ─── Saathi v56 additions ─── */
/* head badge */
.sa-badge {
  display: inline-block; font: 700 8.5px/1 var(--ff-body); letter-spacing: .12em;
  text-transform: uppercase; color: #241503; background: linear-gradient(135deg, var(--gold-2), var(--gold));
  border-radius: 999px; padding: 3px 7px; margin-left: 5px; vertical-align: 1px;
}
/* always-visible tool dock */
.sa-tools {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px;
  padding: 9px 10px; background: var(--white); border-bottom: 1px solid var(--line);
}
.sa-tool {
  border: 1px solid var(--line); background: var(--cream); border-radius: 11px;
  padding: 8px 2px; cursor: pointer; font-family: inherit; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  transition: transform .15s var(--ease), border-color .15s, background .15s;
}
.sa-tool:hover { transform: translateY(-2px); border-color: var(--gold); background: var(--gold-faint); }
.sa-tool span { font-size: 16px; line-height: 1; }
.sa-tool b { font: 600 9.5px/1.15 var(--ff-body); color: var(--maroon); }
@media (max-width: 420px) { .sa-tools { grid-template-columns: repeat(6, 1fr); gap: 3px; padding: 8px 6px; } .sa-tool b { font-size: 8.5px; } }
@keyframes saathiTwinkle { 0%,100% { opacity: 1; transform: scale(1);} 50% { opacity: .55; transform: scale(.85) rotate(20deg);} }
.sa-ava { position: relative; }
.sa-ava::after { content: ''; position: absolute; right: 1px; bottom: 1px; width: 9px; height: 9px; border-radius: 50%; background: #35c46f; border: 2px solid var(--maroon-deep); }
.sa-ava span { animation: saathiTwinkle 2.6s infinite; }
#saathiTick b { color: #ffe9b8; }

/* action tiles */
.sa-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 2px; }
.sa-tile {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 8px;
  background: linear-gradient(160deg, var(--white), var(--cream-2)); border: 1px solid var(--line);
  border-radius: 14px; cursor: pointer; font: 600 12px var(--ff-body); color: var(--maroon);
  transition: transform .18s var(--ease), box-shadow .18s;
}
.sa-tile span { font-size: 19px; }
.sa-tile:hover { transform: translateY(-2px); box-shadow: var(--sh-2); border-color: var(--gold-soft); }

/* cards with actions */
.sa-cardwrap { flex: 0 0 138px; display: flex; flex-direction: column; gap: 5px; }
.sa-card { width: 100%; }
.sa-card .st { color: var(--ink-3); font-weight: 500; font-size: 10.5px; }
.sa-acts { display: flex; gap: 6px; align-items: center; padding: 0 2px; }
.sa-act {
  border: 1px solid var(--line); background: var(--white); border-radius: 9px; cursor: pointer;
  width: 30px; height: 26px; font-size: 13px; line-height: 1;
}
.sa-act:hover { border-color: var(--gold); background: var(--gold-faint); }
.sa-idx { margin-left: auto; font-size: 10px; color: var(--ink-3); }

/* feedback row */
.sa-fbrow { display: flex; align-items: center; gap: 8px; padding: 0 4px 6px; font-size: 11px; color: var(--ink-3); }
.sa-fb { border: 0; background: none; cursor: pointer; font-size: 13px; filter: grayscale(1); opacity: .7; }
.sa-fb:hover { filter: none; opacity: 1; }

/* ─── Saathi v52: voice input ─── */
#saathiMic {
  border: 1px solid var(--line); background: var(--white); border-radius: 11px;
  width: 38px; height: 38px; font-size: 16px; cursor: pointer; flex: 0 0 38px;
  transition: border-color .2s, background .2s, transform .15s;
}
#saathiMic:hover { border-color: var(--gold); background: var(--gold-faint); }
#saathiMic.live { border-color: var(--maroon); background: var(--gold-faint); animation: saMic 1s infinite; }
@keyframes saMic { 0%,100% { transform: scale(1); } 50% { transform: scale(1.12); } }

/* v59 — honest fallback note inside recommendations */
.sa-honest{display:block;margin-top:6px;font-size:11.5px;color:#8a6d2f}
