/* ── Variables ─────────────────────────────────────────────────── */
:root {
  --blue-header: #0079B8;
  --blue-title:  #065CAB;
  --green:       #238826;
  --green-dark:  #1a6b1d;
  --radius:      4px;
  --shadow:      0 4px 24px rgba(0,0,0,0.14);
  --shadow-sm:   0 2px 8px rgba(0,0,0,0.10);
  --border:      #E0E0E0;
  --bg-page:     #F0F4F8;
  --bg-popup:    #FFFFFF;
  --text:        #1A1A1A;
  --text-muted:  #666;
  --bubble-user: #065CAB;
  --bubble-ai:   #F0F4F8;
}

/* ── Reset & base ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Ensure [hidden] always wins over component display values */
[hidden] { display: none !important; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg-page);
  color: var(--text);
  min-height: 100vh;
}

/* ── Header ────────────────────────────────────────────────────── */
.site-header {
  background: var(--blue-header);
  color: white;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
}
.site-header__inner {
  display: flex;
  align-items: baseline;
  gap: 16px;
}
.site-header__logo {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
}
.site-header__tagline {
  font-size: 13px;
  opacity: 0.85;
}

/* ── Hero ───────────────────────────────────────────────────────── */
.site-main {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 56px);
  padding: 24px;
}
.hero {
  text-align: center;
  max-width: 520px;
}
.hero h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--blue-title);
  margin-bottom: 12px;
  line-height: 1.3;
}
.hero p {
  color: var(--text-muted);
  font-size: 16px;
  margin-bottom: 28px;
  line-height: 1.6;
}

/* ── Buttons ────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.btn:active { transform: scale(0.97); }
.btn--primary {
  background: var(--green);
  color: white;
}
.btn--primary:hover { background: var(--green-dark); }
.btn--outline {
  background: transparent;
  color: var(--blue-title);
  border: 1.5px solid var(--blue-title);
}
.btn--outline:hover { background: rgba(6,92,171,0.06); }
.btn--sm { padding: 7px 14px; font-size: 13px; }

/* ── Floating action button ──────────────────────────────────── */
.fabs {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
}
.fab {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  transition: transform 0.15s, box-shadow 0.15s;
}
.fab:hover { transform: scale(1.07); box-shadow: 0 6px 28px rgba(0,0,0,0.18); }
.fab:active { transform: scale(0.95); }
.fab--chat { background: var(--blue-header); color: white; }

@keyframes fab-ping {
  0%   { transform: scale(1);   opacity: 0.55; }
  100% { transform: scale(1.9); opacity: 0; }
}
.fab--chat::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--blue-header);
  opacity: 0;
  animation: fab-ping 0.9s ease-out 0.5s 3;
  pointer-events: none;
}

/* ── Overlay ────────────────────────────────────────────────────── */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 149;
}

/* ── Sidebar ────────────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 450px;
  background: var(--bg-popup);
  box-shadow: -4px 0 24px rgba(0,0,0,0.12);
  display: flex;
  flex-direction: column;
  z-index: 150;
  transform: translateX(32px);
  opacity: 0;
  transition: transform 0.25s cubic-bezier(0.34,1.2,0.64,1), opacity 0.2s ease;
}
.sidebar:not([hidden]) {
  transform: translateX(0);
  opacity: 1;
}
.sidebar[hidden] { display: none !important; }

/* Sidebar header */
.popup__header {
  background: var(--blue-header);
  color: white;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.popup__title {
  font-weight: 600;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.popup__dot {
  width: 8px;
  height: 8px;
  background: #4CAF50;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(76,175,80,0.3);
}
.popup__close {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 2px 4px;
  border-radius: var(--radius);
  opacity: 0.85;
  transition: opacity 0.15s, background 0.15s;
}
.popup__close:hover { opacity: 1; background: rgba(255,255,255,0.15); }

.popup__new-chat {
  display: flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: 1px solid rgba(255,255,255,0.45);
  color: white;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius);
  opacity: 0.85;
  transition: opacity 0.15s, background 0.15s;
}
.popup__new-chat:hover { opacity: 1; background: rgba(255,255,255,0.15); }


/* Sidebar sections */
.sidebar__section {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}
.sidebar__section[hidden] { display: none !important; }

/* ── Sidebar tab bar ────────────────────────────────────────────── */
.sidebar__tabs {
  display: flex;
  flex-direction: row;
  border-top: 1.5px solid var(--border);
  background: var(--bg-popup);
  flex-shrink: 0;
}

.sidebar__tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 8px;
  border: none;
  border-top: 2px solid transparent;
  background: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  transition: color 0.15s, background 0.15s;
  margin-top: -1.5px;
}
.sidebar__tab:hover {
  background: var(--bg-page);
  color: var(--text);
}
.sidebar__tab--active {
  color: var(--blue-header);
  border-top-color: var(--blue-header);
}

.sidebar__tab-icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tab__badge {
  position: absolute;
  top: -4px;
  right: -8px;
  background: #E53935;
  color: white;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  pointer-events: none;
}
.tab__badge[hidden] { display: none !important; }

/* ── Messages area ──────────────────────────────────────────────── */
.messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}
.messages::-webkit-scrollbar { width: 4px; }
.messages::-webkit-scrollbar-track { background: transparent; }
.messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ── Message bubbles ────────────────────────────────────────────── */
.message {
  display: flex;
  flex-direction: column;
  max-width: 88%;
  min-width: 0;
}
.message--user {
  align-self: flex-end;
  align-items: flex-end;
}
.message--ai {
  align-self: flex-start;
  align-items: flex-start;
}
.message--error {
  align-self: center;
}

.message__bubble {
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.55;
  word-wrap: break-word;
}
.message--user .message__bubble {
  background: var(--bubble-user);
  color: white;
  border-bottom-right-radius: var(--radius);
}
.message--ai .message__bubble {
  background: var(--bubble-ai);
  color: var(--text);
  border-bottom-left-radius: var(--radius);
  overflow: hidden;
  max-width: 100%;
}
.message--error .message__bubble {
  background: #FFEBEE;
  color: #C62828;
  font-size: 13px;
  border-radius: var(--radius);
}

/* ── Quick reply buttons ────────────────────────────────────────── */
.quick-replies {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.quick-reply {
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 16px;
  border: 1.5px solid var(--blue-title);
  background: transparent;
  color: var(--blue-title);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  line-height: 1.4;
}

.quick-reply:hover {
  background: var(--blue-title);
  color: white;
}

.quick-reply:active {
  transform: scale(0.96);
}

/* bold text in AI messages */
.message__bubble strong { font-weight: 600; }
.message__bubble a { color: var(--blue-title); text-decoration: underline; }
.message__bubble a:hover { color: var(--blue-header); }

/* ── Markdown prose in AI bubbles ───────────────────────────────── */
.message--ai .message__bubble p { line-height: 1.55; }
.message--ai .message__bubble p + p { margin-top: 8px; }
.message--ai .message__bubble ul,
.message--ai .message__bubble ol { padding-left: 20px; margin-top: 6px; }
.message--ai .message__bubble li { margin-top: 4px; line-height: 1.5; }
.message--ai .message__bubble h2,
.message--ai .message__bubble h3 {
  font-weight: 700;
  color: var(--blue-title);
  margin-top: 12px;
  margin-bottom: 4px;
  font-size: 14px;
}
.message--ai .message__bubble h2 { font-size: 15px; }
.message--ai .message__bubble code {
  background: rgba(0,0,0,0.07);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 12px;
}
.message--ai .message__bubble pre {
  background: rgba(0,0,0,0.07);
  padding: 10px 12px;
  border-radius: 4px;
  overflow-x: auto;
  margin-top: 8px;
}
.message--ai .message__bubble pre code {
  background: none;
  padding: 0;
  font-size: 12px;
}
.message--ai .message__bubble blockquote {
  border-left: 3px solid var(--border);
  padding-left: 10px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* ── Product cards ──────────────────────────────────────────────── */
.message__bubble .product-cards {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.product-cards {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 8px;
  width: 100%;
  scroll-snap-type: x mandatory;
}
.product-cards::-webkit-scrollbar { height: 3px; }
.product-cards::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.product-card {
  min-width: 170px;
  max-width: 170px;
  background: white;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 10px 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  scroll-snap-align: start;
  flex-shrink: 0;
  transition: border-color 0.15s, box-shadow 0.15s;
  cursor: pointer;
}
.product-card:hover {
  border-color: var(--blue-title);
  box-shadow: var(--shadow-sm);
}

.product-card__name {
  font-size: 12px;
  font-weight: 600;
  color: var(--blue-title);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-decoration: none;
}
a.product-card__name:hover { text-decoration: underline; }
.product-card__brand {
  font-size: 11px;
  color: var(--text-muted);
}
.product-card__meta {
  display: flex;
  align-items: center;
  gap: 6px;
}
.product-card__price {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.badge--stock   { background: #E8F5E9; color: #2E7D32; }
.badge--nostock { background: #FFEBEE; color: #C62828; }

.product-card__add {
  margin-top: auto;
  padding: 6px 10px;
  background: var(--green);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  width: 100%;
}
.product-card__add:hover { background: var(--green-dark); }
.product-card__add:disabled {
  background: #ccc;
  cursor: not-allowed;
}

/* ── Thinking indicator ─────────────────────────────────────────── */
.thinking-bubble {
  display: flex;
  align-items: center;
  gap: 8px;
}
.thinking__dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  background: var(--blue-header);
  border-radius: 50%;
  animation: pulse 1.2s infinite ease-in-out;
}
.thinking__status {
  font-size: 1.4rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@keyframes pulse {
  0%, 100% { opacity: 0.25; }
  50%       { opacity: 1; }
}

/* ── Input area ─────────────────────────────────────────────────── */
.input-area {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  background: white;
  flex-shrink: 0;
}
.input-area__input {
  flex: 1;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
  background: var(--bg-page);
}
.input-area__input:focus { border-color: var(--blue-header); background: white; }
.input-area__btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.1s;
  flex-shrink: 0;
}
.input-area__btn:active { transform: scale(0.9); }
.input-area__btn--send {
  background: var(--blue-header);
  color: white;
}
.input-area__btn--send:hover  { background: var(--blue-title); }
.input-area__btn--send:disabled { background: #ccc; cursor: not-allowed; }
.input-area__btn--mic {
  background: var(--bg-page);
  color: var(--text-muted);
}
.input-area__btn--mic:hover:not(:disabled) { background: var(--border); }
.input-area__btn--mic:disabled { opacity: 0.5; cursor: not-allowed; }
.input-area__btn--mic.recording {
  background: #FFEBEE;
  color: #E53935;
  animation: mic-pulse 1.2s infinite ease-in-out;
}
@keyframes mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(229,57,53,0.4); }
  50%       { box-shadow: 0 0 0 6px rgba(229,57,53,0); }
}
.input-area__btn--mic.mic--voice-mode {
  background: #E3F2FD;
  color: var(--blue-header);
  position: relative;
}
.input-area__btn--mic.mic--voice-mode::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  background: var(--blue-header);
  border-radius: 50%;
  top: 4px;
  right: 4px;
}
.input-area__btn--mic.mic--preparing-audio {
  position: relative;
}
.input-area__btn--mic.mic--preparing-audio::before {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--blue-header);
  animation: mic-spin 0.8s linear infinite;
  pointer-events: none;
}
@keyframes mic-spin {
  to { transform: rotate(360deg); }
}

/* ── Basket section ─────────────────────────────────────────────── */
.basket-items {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.basket-empty {
  color: var(--text-muted);
  font-size: 14px;
  text-align: center;
  padding: 32px 0;
}

.basket-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-page);
  border-radius: var(--radius);
  font-size: 13px;
}
.basket-item__name {
  flex: 1;
  font-weight: 500;
  color: var(--text);
  line-height: 1.3;
  font-size: 13px;
}
.basket-item__controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.basket-item__qty-btn {
  width: 24px;
  height: 24px;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  background: white;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  padding: 0;
  transition: background 0.12s, border-color 0.12s;
}
.basket-item__qty-btn:hover {
  background: var(--bg-page);
  border-color: var(--blue-header);
  color: var(--blue-header);
}
.basket-item__qty {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  min-width: 18px;
  text-align: center;
}
.basket-item__price {
  font-weight: 600;
  color: var(--blue-title);
  white-space: nowrap;
  font-size: 13px;
}
.basket-item__remove {
  width: 26px;
  height: 26px;
  border-radius: var(--radius);
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: color 0.12s, background 0.12s;
  padding: 0;
}
.basket-item__remove:hover {
  color: #E53935;
  background: #FFEBEE;
}

.basket-footer {
  padding: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.basket-total {
  font-size: 15px;
  color: var(--text);
}
.basket-total strong {
  color: var(--blue-title);
  font-size: 17px;
}

/* ── Connection status ───────────────────────────────────────────── */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.status-dot--connecting { background: #FFC107; }
.status-dot--error      { background: #E53935; }

/* ── Product detail modal ────────────────────────────────────────── */
.product-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.product-modal[hidden] { display: none !important; }

.product-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
}

.product-modal__panel {
  position: relative;
  background: white;
  border-radius: 16px 16px 0 0;
  width: 100%;
  max-width: 560px;
  max-height: 82vh;
  overflow: hidden;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: slideUp 0.22s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.product-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
  padding: 4px 6px;
  border-radius: var(--radius);
  transition: background 0.15s;
}
.product-modal__close:hover { background: var(--bg-page); color: var(--text); }

.product-modal__image {
  width: 100%;
  max-height: 200px;
  object-fit: contain;
  border-radius: 8px;
  /* background: var(--bg-page); */
  padding: 8px;
}

.product-modal__name {
  font-size: 15px;
  font-weight: 700;
  color: var(--blue-title);
  line-height: 1.4;
  text-decoration: none;
  display: block;
  padding-right: 28px;
}
a.product-modal__name:hover { text-decoration: underline; }

.product-modal__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.product-modal__brand { font-size: 13px; color: var(--text-muted); }
.product-modal__price { font-size: 18px; font-weight: 700; color: var(--text); }

.product-modal__specs {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 5px 14px;
  font-size: 13px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.product-modal__spec { display: contents; }
.product-modal__spec dt { color: var(--text-muted); font-weight: 500; white-space: nowrap; }
.product-modal__spec dd { color: var(--text); }

.product-modal__desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.55;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

/* Scrollable content area */
.product-modal__body {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.product-modal__add {
  width: 100%;
  justify-content: center;
  border-top: 1px solid var(--border);
}
.product-modal__add:disabled { background: #ccc; cursor: not-allowed; }

/* ── Events section ─────────────────────────────────────────────── */
.events-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.events-empty {
  color: var(--text-muted);
  font-size: 14px;
  text-align: center;
  padding: 32px 0;
}

.event-item {
  padding: 12px;
  background: var(--bg-page);
  border-radius: var(--radius);
  border-left: 3px solid #5B3E9E;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.event-item__date {
  font-size: 11px;
  font-weight: 600;
  color: #5B3E9E;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.event-item__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}
.event-item__detail {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}
.event-item__detail--contact::before { content: "👤 "; }
.event-item__detail--notes  { font-style: italic; }
.event-item__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  background: none;
  border: none;
  padding: 0;
  margin-top: 6px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  color: #5B3E9E;
  width: 100%;
  text-align: left;
}
.event-item__toggle:hover { opacity: 0.75; }

.event-item__chevron {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.event-item__chevron--open { transform: rotate(180deg); }

.event-item__items {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  border-top: 1px solid rgba(91,62,158,0.15);
  padding-top: 8px;
}
.event-item__item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.event-item__item-name {
  flex: 1;
  color: var(--text);
  font-weight: 500;
  line-height: 1.3;
}
.event-item__item-qty {
  color: var(--text-muted);
  white-space: nowrap;
}
.event-item__item-price {
  font-weight: 600;
  color: var(--blue-title);
  white-space: nowrap;
}

/* ── Branch cards ───────────────────────────────────────────────── */
.message__bubble .branch-cards {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.branch-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.branch-card {
  background: white;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.branch-card:hover {
  border-color: var(--blue-title);
  box-shadow: var(--shadow-sm);
}

.branch-card__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.branch-card__name {
  font-size: 13px;
  font-weight: 700;
  color: var(--blue-title);
  line-height: 1.3;
}
.branch-card__distance {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.branch-card__address {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}
.branch-card__hours {
  font-size: 11px;
  color: var(--text-muted);
}
.branch-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}
.branch-card__badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 3px;
  background: #E8F5E9;
  color: #2E7D32;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* ── Basket branch display ──────────────────────────────────────── */
.basket-branch {
  margin: 0 12px 8px;
  padding: 10px 12px;
  background: #EEF6FF;
  border: 1.5px solid #BBDEFB;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.basket-branch__label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--blue-header);
}
.basket-branch__name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.basket-branch__meta {
  font-size: 11px;
  color: var(--text-muted);
}
.basket-branch__change {
  margin-top: 6px;
  align-self: flex-start;
  background: none;
  border: 1px solid var(--blue-header);
  color: var(--blue-header);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.12s;
}
.basket-branch__change:hover { background: rgba(0,121,184,0.08); }

/* ── Toast notification ─────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 96px;
  right: 24px;
  background: #333;
  color: white;
  padding: 10px 18px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  z-index: 300;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}
.toast--visible {
  opacity: 1;
  transform: translateY(0);
}

/* Prevent background scroll while sidebar is open */
body.sidebar-open { overflow: hidden; touch-action: none; }

/* ── Mobile ─────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .sidebar {
    top: auto;
    right: 0;
    left: 0;
    width: 100%;
    height: 90vh;
    border-radius: 16px 16px 0 0;
    overflow: hidden;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.12);
    transform: translateY(32px);
    opacity: 0;
  }
  .sidebar:not([hidden]) {
    transform: translateY(0);
    opacity: 1;
  }
  .fabs {
    bottom: 20px;
    right: 20px;
  }
  .hero h1 { font-size: 22px; }
}
