/* ==========================================================================
   Dr. Farzane Ghasemi — Elementor & WoodMart Template Hub
   Light, Crisp Blue, Minimal & Tactile RTL Design System
   ========================================================================== */

@font-face {
  font-family: "Dana";
  src: url("./fonts/Dana-Medium.ttf") format("truetype");
  font-weight: 400 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Dana";
  src: url("./fonts/Dana-Bold.ttf") format("truetype");
  font-weight: 600 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Dana";
  src: url("./fonts/Dana-Black.ttf") format("truetype");
  font-weight: 800 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Kalameh";
  src: url("./fonts/Kalameh-Bold.ttf") format("truetype");
  font-weight: 600 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Kalameh";
  src: url("./fonts/Kalameh-Black.ttf") format("truetype");
  font-weight: 800 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Peyda";
  src: url("./fonts/Peyda-Medium.ttf") format("truetype");
  font-weight: 400 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Peyda";
  src: url("./fonts/Peyda-Bold.ttf") format("truetype");
  font-weight: 600 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --font-sans: "Dana", system-ui, -apple-system, sans-serif;
  --font-display: "Kalameh", "Dana", system-ui, sans-serif;
  --font-num: "Peyda", "Dana", system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Crisp Light & Sapphire Blue Palette */
  --bg-canvas: #f6f9fc;
  --bg-surface: #ffffff;
  --bg-muted: #f0f5fb;
  --bg-blue-soft: #eff5ff;
  --bg-blue-tint: #dbeafe;

  --blue-500: #2563eb;
  --blue-600: #1d63ed;
  --blue-700: #154ec1;
  --blue-ring: rgba(29, 99, 237, 0.2);

  --ink-950: #0b192c;
  --ink-800: #1e2f47;
  --ink-600: #47586e;
  --ink-400: #7c8ea6;

  --line: #e2eaf4;
  --line-strong: #cbd9ec;

  --emerald-600: #059669;
  --emerald-soft: #ecfdf5;

  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 22px;

  --shadow-xs: 0 1px 2px rgba(11, 25, 44, 0.04);
  --shadow-card: 0 4px 20px rgba(15, 41, 77, 0.045), 0 1px 2px rgba(15, 41, 77, 0.03);
  --shadow-card-hover: 0 14px 36px rgba(21, 78, 193, 0.09), 0 2px 6px rgba(15, 41, 77, 0.04);
  --shadow-float: 0 24px 60px rgba(11, 25, 44, 0.16);

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--bg-canvas);
  background-image: radial-gradient(ellipse 80% 420px at 50% -120px, rgba(29, 99, 237, 0.075), transparent);
  color: var(--ink-950);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  margin: 0;
  color: var(--ink-950);
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

button,
input,
a {
  font-family: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.num {
  font-family: var(--font-num);
  font-feature-settings: "ss01";
}

:focus-visible {
  outline: 2px solid var(--blue-600);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

::selection {
  background: var(--bg-blue-tint);
  color: var(--ink-950);
}

.container {
  width: 100%;
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: 16px;
}

@media (min-width: 768px) {
  .container {
    padding-inline: 28px;
  }
}

/* ==================== STICKY TOPBAR ==================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
  padding-block: 10px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand__mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--blue-600), var(--blue-700));
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(29, 99, 237, 0.25);
  flex-shrink: 0;
}

.brand__text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.brand__title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
  line-height: 1.3;
  color: var(--ink-950);
}

.brand__sub {
  font-size: 12px;
  color: var(--ink-400);
  font-weight: 600;
}

.topbar__meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pill-stack {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--bg-blue-soft);
  border: 1px solid var(--bg-blue-tint);
  color: var(--blue-700);
  font-size: 12px;
  font-weight: 700;
}

.pill-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--bg-surface);
  border: 1px solid var(--line);
  color: var(--ink-800);
  font-size: 12px;
  font-weight: 700;
}

.pill-count__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blue-600);
  box-shadow: 0 0 0 3px var(--bg-blue-tint);
}

/* ==================== HERO & TOOLBAR ==================== */
.hero {
  padding-top: 32px;
  padding-bottom: 22px;
}

.hero__row {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

@media (min-width: 900px) {
  .hero__row {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }
}

.hero__title {
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 900;
  line-height: 1.35;
}

.hero__desc {
  margin-top: 6px;
  color: var(--ink-600);
  font-size: 14px;
  max-width: 620px;
}

.search-box {
  position: relative;
  width: 100%;
  max-width: 370px;
}

.search-box__icon {
  position: absolute;
  inset-inline-start: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-400);
  pointer-events: none;
  display: inline-flex;
}

.search-box__input {
  width: 100%;
  height: 44px;
  padding-inline-start: 42px;
  padding-inline-end: 42px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--bg-surface);
  color: var(--ink-950);
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow-xs);
  transition: border-color 180ms var(--ease-out), box-shadow 180ms var(--ease-out);
}

.search-box__input::placeholder {
  color: var(--ink-400);
}

.search-box__input:focus {
  outline: none;
  border-color: var(--blue-600);
  box-shadow: 0 0 0 4px var(--blue-ring);
}

.search-box__kbd {
  position: absolute;
  inset-inline-end: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-400);
  background: var(--bg-muted);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 6px;
  pointer-events: none;
}

/* Filter Tabs */
.filters {
  margin-top: 22px;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.filters::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding-inline: 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-surface);
  color: var(--ink-600);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 180ms var(--ease-out);
}

.filter-chip:hover {
  border-color: var(--line-strong);
  color: var(--ink-950);
  background: #ffffff;
}

.filter-chip.is-active {
  background: var(--blue-600);
  border-color: var(--blue-600);
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(29, 99, 237, 0.22);
}

.filter-chip__badge {
  font-family: var(--font-num);
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--bg-muted);
  color: var(--ink-600);
}

.filter-chip.is-active .filter-chip__badge {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

/* ==================== TEMPLATE CARDS LIST ==================== */
.catalog-main {
  flex: 1;
  padding-bottom: 64px;
}

.cards-stack {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.tpl-card {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: box-shadow 240ms var(--ease-out), border-color 240ms var(--ease-out);
}

.tpl-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-card-hover);
}

/* Preview Stage inside Card */
.preview-stage {
  background: linear-gradient(180deg, #eef4fb 0%, #f5f8fc 100%);
  border-bottom: 1px solid var(--line);
  padding: 16px;
}

@media (min-width: 768px) {
  .preview-stage {
    padding: 20px 24px 24px;
  }
}

.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.browser-dots {
  display: flex;
  align-items: center;
  gap: 10px;
}

.browser-dots__lights {
  display: inline-flex;
  gap: 6px;
}

.browser-dots__lights span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--line-strong);
}

.browser-dots__label {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-600);
}

.viewport-Controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.seg-group {
  display: inline-flex;
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 3px;
}

.seg-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding-inline: 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-600);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 160ms var(--ease-out);
}

.seg-btn:hover {
  color: var(--ink-950);
}

.seg-btn.is-active {
  background: var(--bg-blue-soft);
  color: var(--blue-600);
}

.expand-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 36px;
  padding-inline: 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-surface);
  color: var(--ink-600);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 160ms var(--ease-out);
}

.expand-btn:hover {
  border-color: var(--blue-500);
  color: var(--blue-600);
}

.preview-viewport {
  margin-inline: auto;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #f8fafc;
  box-shadow: 0 8px 24px rgba(15, 41, 77, 0.06);
  overflow: hidden;
  transition: max-width 280ms var(--ease-out);
  max-width: 100%;
}

.preview-viewport.is-mobile {
  max-width: 390px;
}

/* Card Body & Actions */
.tpl-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

@media (min-width: 900px) {
  .tpl-body {
    padding: 22px 26px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
  }
}

.tpl-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.tpl-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.badge-step {
  font-family: var(--font-num);
  font-size: 11.5px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--bg-blue-soft);
  color: var(--blue-600);
}

.badge-format {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 7px;
  background: var(--ink-950);
  color: #ffffff;
  direction: ltr;
}

.badge-nocode {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--emerald-soft);
  color: var(--emerald-600);
}

.badge-meta {
  font-size: 12px;
  color: var(--ink-400);
  font-weight: 600;
}

.tpl-title {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.4;
}

.tpl-desc {
  color: var(--ink-600);
  font-size: 13.5px;
  line-height: 1.8;
}

.tpl-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.tpl-chip {
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--bg-muted);
  color: var(--ink-800);
  border: 1px solid var(--line);
}

.tpl-file-pill {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-600);
  background: var(--bg-canvas);
  border: 1px dashed var(--line-strong);
  padding: 4px 10px;
  border-radius: 8px;
  direction: ltr;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
}

/* Action Buttons */
.tpl-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding-inline: 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 180ms var(--ease-out);
  white-space: nowrap;
}

.btn-primary {
  background: var(--blue-600);
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(29, 99, 237, 0.24);
  padding-inline: 22px;
}

.btn-primary:hover {
  background: var(--blue-700);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(21, 78, 193, 0.3);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary.is-done {
  background: var(--emerald-600);
  box-shadow: 0 8px 20px rgba(5, 150, 105, 0.24);
}

.btn-secondary {
  background: var(--bg-surface);
  border-color: var(--line-strong);
  color: var(--ink-800);
}

.btn-secondary:hover {
  border-color: var(--blue-500);
  color: var(--blue-600);
  background: var(--bg-blue-soft);
}

.btn-icon {
  width: 44px;
  padding-inline: 0;
}

@media (max-width: 640px) {
  .tpl-actions {
    width: 100%;
  }
  .tpl-actions .btn-primary {
    flex: 1 1 100%;
  }
  .tpl-actions .btn-secondary {
    flex: 1 1 auto;
  }
}

/* Empty State */
.empty-state {
  background: var(--bg-surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  padding: 56px 24px;
  text-align: center;
}

.empty-state__icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--bg-blue-soft);
  color: var(--blue-600);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

/* ==================== SLIDE-OVER DRAWER & FULL MODAL ==================== */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(11, 25, 44, 0.38);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms var(--ease-out);
}

.backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  inset-inline-end: 0;
  z-index: 100;
  width: min(92vw, 460px);
  background: var(--bg-surface);
  border-inline-start: 1px solid var(--line);
  box-shadow: var(--shadow-float);
  display: flex;
  flex-direction: column;
  transform: translateX(-105%);
  transition: transform 260ms var(--ease-out);
}

.drawer.is-open {
  transform: translateX(0);
}

.drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 22px;
}

.drawer__foot {
  padding: 16px 22px;
  border-top: 1px solid var(--line);
  background: var(--bg-canvas);
  display: flex;
  gap: 10px;
}

.guide-step {
  display: flex;
  gap: 14px;
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.guide-step:last-child {
  border-bottom: 0;
  margin-bottom: 0;
  padding-bottom: 0;
}

.guide-step__num {
  font-family: var(--font-num);
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: var(--bg-blue-soft);
  color: var(--blue-600);
  font-weight: 800;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.guide-step__title {
  font-weight: 800;
  font-size: 14.5px;
  color: var(--ink-950);
  margin-bottom: 4px;
}

.guide-step__desc {
  font-size: 13px;
  color: var(--ink-600);
  line-height: 1.85;
}

.guide-tip {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--bg-blue-soft);
  border: 1px solid var(--bg-blue-tint);
  font-size: 12.5px;
  color: var(--ink-800);
  line-height: 1.85;
}

/* Fullscreen Preview Modal */
.modal {
  position: fixed;
  inset: 20px;
  z-index: 110;
  background: var(--bg-canvas);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-float);
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: scale(0.97);
  pointer-events: none;
  transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out);
  overflow: hidden;
}

.modal.is-open {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.modal__head {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--line);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.modal__body {
  flex: 1;
  overflow: auto;
  padding: 24px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.modal__stage {
  width: 100%;
  max-width: 1360px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #f4f7f9;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: max-width 260ms var(--ease-out);
}
.modal__stage.is-tablet {
  max-width: 780px;
}
.modal__stage.is-mobile {
  max-width: 390px;
}

@media (max-width: 640px) {
  .modal {
    inset: 8px;
  }
  .modal__body {
    padding: 12px;
  }
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translate(-50%, 16px);
  z-index: 130;
  background: var(--ink-950);
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 12px 30px rgba(11, 25, 44, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out);
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-surface);
  padding-block: 20px;
  color: var(--ink-400);
  font-size: 12.5px;
}

.site-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* ==================== AUTHENTIC SECTION PREVIEW STYLES ==================== */
.prv-header-wrap {
  font-family: var(--font-sans);
  direction: rtl;
  user-select: none;
}

.prv-topstrip {
  background: #14212e;
  color: #e2e8f0;
  padding: 7px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  font-weight: 600;
}

.prv-topstrip__group {
  display: flex;
  align-items: center;
  gap: 16px;
}

.prv-topstrip__item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.prv-mainbar {
  background: #ffffff;
  padding: 13px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #e6ecf1;
}

.prv-logo {
  display: inline-flex;
  flex-direction: column;
  line-height: 1.1;
  flex-shrink: 0;
}

.prv-logo__fa {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 900;
  color: #14212e;
}

.prv-logo__fa em {
  font-style: normal;
  color: #068462;
}

.prv-logo__dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: #0fa47a;
  margin-inline-start: 3px;
  vertical-align: top;
}

.prv-logo__en {
  font-size: 9px;
  letter-spacing: 0.22em;
  color: #9aabbb;
  font-weight: 700;
  margin-top: 3px;
}

.prv-search {
  flex: 1;
  display: flex;
  align-items: center;
  background: #f4f7f9;
  border: 1px solid #e6ecf1;
  border-radius: 11px;
  height: 42px;
  padding: 4px 12px 4px 4px;
  gap: 8px;
}

.prv-search__text {
  flex: 1;
  font-size: 12px;
  color: #7c8ea6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.prv-search__btn {
  background: #0fa47a;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 8px;
  flex-shrink: 0;
}

.prv-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}

.prv-btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding-inline: 12px;
  border: 1px solid #e6ecf1;
  border-radius: 11px;
  background: #ffffff;
  color: #14212e;
  font-size: 12px;
  font-weight: 700;
}

.prv-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid #e6ecf1;
  border-radius: 11px;
  background: #ffffff;
  color: #35485c;
}

.prv-btn-cart {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 40px;
  padding-inline: 13px;
  border-radius: 11px;
  background: #0fa47a;
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
}

.prv-cart-badge {
  font-family: var(--font-num);
  background: #14212e;
  color: #ffffff;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 999px;
}

.prv-navbar {
  background: #ffffff;
  padding: 8px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #e6ecf1;
  font-size: 12.5px;
  font-weight: 700;
}

.prv-cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #eafaf4;
  color: #066a50;
  padding: 6px 12px;
  border-radius: 9px;
  font-weight: 800;
}

.prv-navlinks {
  display: flex;
  align-items: center;
  gap: 18px;
  flex: 1;
  color: #14212e;
}

.prv-navlinks span:first-child {
  color: #068462;
  position: relative;
}

.prv-sale-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #fef2f2;
  color: #e5322d;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 800;
}

.prv-burger {
  display: none;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #f4f7f9;
  border: 1px solid #e6ecf1;
  color: #35485c;
  align-items: center;
  justify-content: center;
}

.prv-page-hint {
  padding: 18px 20px;
  background: #f4f7f9;
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 12px;
}

.prv-skeleton-hero {
  height: 74px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(15, 164, 122, 0.12), rgba(29, 99, 237, 0.08));
  border: 1px dashed #cbd9ec;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64798e;
  font-size: 12px;
  font-weight: 700;
}

.prv-skeleton-side {
  height: 74px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #e6ecf1;
}

/* Mobile state inside preview */
.is-mobile .prv-topstrip,
.is-mobile .prv-navbar,
.is-mobile .prv-btn-outline,
.is-mobile .prv-btn-icon,
.is-mobile .prv-cart-price,
.is-mobile .prv-skeleton-side {
  display: none;
}

.is-mobile .prv-burger {
  display: inline-flex;
}

.is-mobile .prv-mainbar {
  flex-wrap: wrap;
  padding: 10px 12px;
  gap: 10px;
}

.is-mobile .prv-search {
  order: 4;
  flex: 1 1 100%;
  height: 40px;
}

.is-mobile .prv-page-hint {
  grid-template-columns: 1fr;
  padding: 12px;
}

@media (max-width: 720px) {
  .prv-topstrip,
  .prv-navbar,
  .prv-btn-outline,
  .prv-btn-icon,
  .prv-cart-price,
  .prv-skeleton-side {
    display: none;
  }
  .prv-burger {
    display: inline-flex;
  }
  .prv-mainbar {
    flex-wrap: wrap;
    padding: 10px 12px;
    gap: 10px;
  }
  .prv-search {
    order: 4;
    flex: 1 1 100%;
  }
  .prv-page-hint {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==================== ARENA DIRECT CHATBOT WIDGET ==================== */
.topbar-chat-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding-inline: 13px;
  border-radius: 999px;
  border: 1px solid var(--bg-blue-tint);
  background: var(--bg-surface);
  color: var(--blue-600);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: all 180ms var(--ease-out);
}

.topbar-chat-btn:hover {
  background: var(--blue-600);
  border-color: var(--blue-600);
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(29, 99, 237, 0.22);
}

.topbar-chat-btn__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--emerald-600);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.18);
}

.topbar-chat-btn__dot.is-static {
  background: var(--blue-600);
  box-shadow: 0 0 0 3px var(--bg-blue-tint);
}

/* Floating Action Launcher */
.chat-fab {
  position: fixed;
  bottom: 24px;
  inset-inline-end: 24px;
  z-index: 84;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding-inline: 18px 20px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: linear-gradient(135deg, var(--blue-600) 0%, var(--blue-700) 100%);
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 14px 34px rgba(21, 78, 193, 0.34), 0 2px 6px rgba(11, 25, 44, 0.12);
  transition: transform 200ms var(--ease-out), box-shadow 200ms var(--ease-out), opacity 180ms var(--ease-out);
}

.chat-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 38px rgba(21, 78, 193, 0.42);
}

.chat-fab.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px) scale(0.94);
}

.chat-fab__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
}

.chat-fab__badge {
  font-family: var(--font-num);
  min-width: 21px;
  height: 21px;
  padding-inline: 6px;
  border-radius: 999px;
  background: #ffffff;
  color: var(--blue-700);
  font-size: 11.5px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.chat-fab__badge[hidden] {
  display: none;
}

/* Floating Chat Window */
.chat-panel {
  position: fixed;
  bottom: 24px;
  inset-inline-end: 24px;
  z-index: 120;
  width: min(94vw, 416px);
  height: min(80vh, 620px);
  background: var(--bg-surface);
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  box-shadow: 0 26px 70px rgba(11, 25, 44, 0.2), 0 4px 16px rgba(29, 99, 237, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px) scale(0.96);
  transform-origin: bottom left;
  transition: opacity 220ms var(--ease-out), transform 220ms var(--ease-out);
}

.chat-panel.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

@media (max-width: 600px) {
  .chat-fab {
    bottom: 16px;
    inset-inline-end: 16px;
    height: 48px;
    padding-inline: 15px 17px;
  }
  .chat-panel {
    inset-inline: 10px;
    bottom: 10px;
    width: auto;
    height: min(85vh, 640px);
    border-radius: 20px;
  }
}

/* Chat Header */
.chat-head {
  background: linear-gradient(180deg, #ffffff 0%, #f7faff 100%);
  border-bottom: 1px solid var(--line);
  padding: 13px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.chat-head__identity {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.chat-head__avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--blue-600), var(--blue-700));
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 14px rgba(29, 99, 237, 0.24);
  flex-shrink: 0;
}

.chat-head__titles {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.chat-head__title {
  font-family: var(--font-display);
  font-size: 14.5px;
  font-weight: 800;
  color: var(--ink-950);
  line-height: 1.25;
}

.chat-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  color: var(--emerald-600);
}

.chat-status-pill.is-static {
  color: var(--blue-600);
}

.chat-status-pill__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.chat-status-pill.is-listening .chat-status-pill__dot {
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.22);
  animation: chatPulseDot 1.6s ease-in-out infinite;
}

@keyframes chatPulseDot {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.35);
    opacity: 0.7;
  }
}

.chat-typing {
  align-self: flex-end;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  border-radius: 14px;
  border-top-left-radius: 4px;
  background: #ffffff;
  border: 1px solid var(--bg-blue-tint);
  border-inline-end: 3px solid var(--blue-600);
  color: var(--blue-700);
  font-size: 12px;
  font-weight: 700;
  box-shadow: var(--shadow-xs);
  animation: chatFadeIn 180ms var(--ease-out);
}

.chat-typing__dots {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.chat-typing__dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--blue-600);
  animation: chatTypingBounce 1.1s infinite ease-in-out;
}
.chat-typing__dots span:nth-child(2) {
  animation-delay: 0.16s;
}
.chat-typing__dots span:nth-child(3) {
  animation-delay: 0.32s;
}

@keyframes chatTypingBounce {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.45;
  }
  40% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

.chat-head__actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.chat-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-600);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 150ms var(--ease-out);
}

.chat-icon-btn:hover,
.chat-icon-btn.is-active {
  background: var(--bg-blue-soft);
  border-color: var(--bg-blue-tint);
  color: var(--blue-600);
}

/* Collapsible Bridge Settings */
.chat-settings {
  background: var(--bg-blue-soft);
  border-bottom: 1px solid var(--bg-blue-tint);
  padding: 12px 15px;
  font-size: 12px;
  color: var(--ink-800);
}

.chat-settings[hidden] {
  display: none;
}

.chat-settings__label {
  display: block;
  font-weight: 800;
  margin-bottom: 6px;
  color: var(--ink-950);
}

.chat-settings__row {
  display: flex;
  gap: 6px;
}

.chat-settings__input {
  flex: 1;
  height: 34px;
  padding-inline: 10px;
  border-radius: 9px;
  border: 1px solid var(--line-strong);
  background: #ffffff;
  font-family: var(--font-mono);
  font-size: 11.5px;
  direction: ltr;
  color: var(--ink-950);
}

.chat-settings__input:focus {
  outline: none;
  border-color: var(--blue-600);
}

.chat-settings__btn {
  height: 34px;
  padding-inline: 12px;
  border-radius: 9px;
  border: 0;
  background: var(--blue-600);
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.chat-settings__hint {
  margin-top: 7px;
  font-size: 11px;
  color: var(--ink-600);
  line-height: 1.65;
}

.chat-settings__divider {
  height: 1px;
  background: var(--bg-blue-tint);
  margin-block: 10px;
}

.chat-settings__tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chat-tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 31px;
  padding-inline: 10px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: #ffffff;
  color: var(--ink-800);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: all 150ms var(--ease-out);
}

.chat-tool-btn[hidden] {
  display: none;
}

.chat-tool-btn:hover {
  border-color: var(--blue-600);
  color: var(--blue-600);
}

.chat-tool-btn.is-primary {
  background: var(--blue-600);
  border-color: var(--blue-600);
  color: #ffffff;
}

.chat-tool-btn.is-primary:hover {
  background: var(--blue-700);
  color: #ffffff;
}

/* Messages Stream */
.chat-stream {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  background: var(--bg-canvas);
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

.chat-msg {
  display: flex;
  flex-direction: column;
  max-width: 88%;
  animation: chatFadeIn 180ms var(--ease-out);
}

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

.chat-msg--user {
  align-self: flex-start;
}

.chat-msg--agent,
.chat-msg--assistant {
  align-self: flex-end;
}

.chat-msg__sender {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-400);
  margin-bottom: 4px;
  padding-inline: 4px;
}

.chat-msg--agent .chat-msg__sender {
  color: var(--blue-700);
}

.chat-msg__verified {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--bg-blue-soft);
  border: 1px solid var(--bg-blue-tint);
  color: var(--blue-600);
  font-size: 10px;
  font-weight: 800;
}

.chat-msg__bubble {
  padding: 10px 13px;
  border-radius: 15px;
  font-size: 13px;
  line-height: 1.75;
  word-break: break-word;
}

.chat-msg--user .chat-msg__bubble {
  background: linear-gradient(135deg, var(--blue-600), var(--blue-700));
  color: #ffffff;
  border-top-right-radius: 5px;
  box-shadow: 0 6px 16px rgba(29, 99, 237, 0.2);
}

.chat-msg--agent .chat-msg__bubble {
  background: #ffffff;
  color: var(--ink-950);
  border: 1px solid var(--bg-blue-tint);
  border-inline-end: 3px solid var(--blue-600);
  border-top-left-radius: 5px;
  box-shadow: var(--shadow-xs);
}

.chat-msg--assistant .chat-msg__bubble {
  background: var(--bg-blue-soft);
  color: var(--ink-800);
  border: 1px solid var(--bg-blue-tint);
  border-top-left-radius: 5px;
}

.chat-msg__section-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  margin-bottom: 6px;
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.chat-msg--agent .chat-msg__section-tag,
.chat-msg--assistant .chat-msg__section-tag {
  background: var(--bg-muted);
  color: var(--blue-700);
}

.chat-msg__code {
  font-family: var(--font-mono);
  font-size: 11.5px;
  padding: 1px 5px;
  border-radius: 5px;
  background: rgba(11, 25, 44, 0.07);
  direction: ltr;
  display: inline-block;
}

.chat-code-card {
  margin-top: 9px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: #f8fafd;
  overflow: hidden;
  direction: ltr;
  text-align: left;
}

.chat-code-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 10px;
  background: var(--bg-muted);
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ink-600);
}

.chat-code-card__pre {
  margin: 0;
  padding: 8px 10px;
  max-height: 120px;
  overflow: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.5;
  color: var(--ink-950);
  white-space: pre;
}

.chat-msg--user .chat-msg__code {
  background: rgba(255, 255, 255, 0.2);
}

.chat-msg__action-btn {
  margin-top: 9px;
  width: 100%;
  height: 34px;
  padding-inline: 12px;
  border-radius: 9px;
  border: 1px solid var(--blue-600);
  background: var(--blue-600);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 150ms var(--ease-out);
}

.chat-msg__action-btn:hover {
  background: var(--blue-700);
}

.chat-msg__bridge-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.chat-mini-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  padding-inline: 9px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.chat-mini-link:hover {
  background: rgba(255, 255, 255, 0.25);
}

.chat-msg__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  padding-inline: 4px;
  font-size: 10.5px;
  color: var(--ink-400);
}

.chat-msg__ticks {
  font-weight: 700;
  color: var(--blue-600);
}

.chat-msg__ticks.is-replied {
  color: var(--emerald-600);
}

/* Pending Wakeup Strip */
.chat-wakeup {
  background: var(--bg-blue-soft);
  border-top: 1px solid var(--bg-blue-tint);
  padding: 7px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
  color: var(--ink-800);
}

.chat-wakeup[hidden] {
  display: none;
}

.chat-wakeup__btn {
  height: 26px;
  padding-inline: 9px;
  border-radius: 7px;
  border: 1px solid var(--blue-600);
  background: #ffffff;
  color: var(--blue-600);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.chat-wakeup__btn:hover {
  background: var(--blue-600);
  color: #ffffff;
}

/* Quick Chips + Context Pill + Composer */
.chat-quick-row {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding: 8px 12px 6px;
  background: var(--bg-surface);
  border-top: 1px solid var(--line);
  scrollbar-width: none;
}
.chat-quick-row::-webkit-scrollbar {
  display: none;
}

.chat-quick-chip {
  height: 28px;
  padding-inline: 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-muted);
  color: var(--ink-800);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: all 150ms var(--ease-out);
}

.chat-quick-chip:hover {
  background: var(--bg-blue-soft);
  border-color: var(--bg-blue-tint);
  color: var(--blue-600);
}

.chat-context-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 12px;
  background: var(--bg-muted);
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--blue-700);
}

.chat-context-bar[hidden] {
  display: none;
}

.chat-context-bar__remove {
  border: 0;
  background: transparent;
  color: var(--ink-600);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 2px 5px;
}

.chat-composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px 12px;
  background: var(--bg-surface);
  border-top: 1px solid var(--line);
}

.chat-composer__input {
  flex: 1;
  min-height: 40px;
  max-height: 112px;
  resize: none;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--bg-canvas);
  color: var(--ink-950);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.6;
  transition: border-color 160ms var(--ease-out), box-shadow 160ms var(--ease-out), background 160ms var(--ease-out);
}

.chat-composer__input:focus {
  outline: none;
  background: #ffffff;
  border-color: var(--blue-600);
  box-shadow: 0 0 0 3px var(--blue-ring);
}

.chat-composer__send {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 0;
  background: var(--blue-600);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 6px 14px rgba(29, 99, 237, 0.24);
  transition: all 160ms var(--ease-out);
}

.chat-composer__send:hover:not(:disabled) {
  background: var(--blue-700);
  transform: translateY(-1px);
}

.chat-composer__send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}
