:root {
  --bg: #f8fafc;
  --panel: #ffffff;
  --accent: #0f172a;
  --text: #0f172a;
  --muted: #475569;
  --card: #ffffff;
  --border: #e2e8f0;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  --glass: rgba(255,255,255,0.8);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.hidden { display: none !important; }

/* Buttons */
.btn, button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 12px;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.2s ease, background 0.2s ease;
  text-decoration: none;
}
.btn-primary, button {
  background: linear-gradient(135deg, #fb923c, #ea580c);
  color: #fff;
  border-color: #c2410c;
  box-shadow: 0 8px 20px rgba(234, 88, 12, 0.3);
}
.btn-primary:hover, button:hover { transform: translateY(-1px); }
.btn-ghost {
  background: #fff;
  color: var(--accent);
  border-color: var(--border);
}
.btn-ghost:hover { box-shadow: var(--shadow); }
.btn-eye {
  padding: 8px 10px;
  font-size: 13px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 10;
}
.glass {
  background: var(--glass);
  backdrop-filter: blur(12px);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-link { display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-link:hover { text-decoration: none; }
.logo { height: 40px; }
.logo-text { font-weight: 700; font-size: 20px; }
.brand-name { font-weight: 800; letter-spacing: 0.5px; }
.tagline { color: var(--muted); font-size: 14px; }
.nav-menu { display: flex; align-items: center; gap: 12px; }
.nav-menu .btn, .nav-menu .pill { margin-left: 0; }
.pill {
  padding: 10px 14px;
  border-radius: 999px;
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fed7aa;
  font-weight: 700;
}
.pill:hover { background: #ffedd5; }
.admin-pill { border-color: #fecdd3; background: #fff1f2; color: #be123c; }
.nav-user { color: var(--muted); font-weight: 600; }
.menu-toggle {
  display: none;
  background: none;
  border: 1px solid rgba(0,0,0,0.08);
  color: inherit;
  font-size: 22px;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  padding: 2px 6px;
  margin-left: 6px;
  border-radius: 999px;
  background: #f97316;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}
.badge[hidden] {
  display: none !important;
}
.badge-bump {
  animation: badgeBump 0.22s ease;
}
@keyframes badgeBump {
  0% { transform: scale(1); }
  50% { transform: scale(1.14); }
  100% { transform: scale(1); }
}

.page { padding: 32px 24px; max-width: 1200px; margin: 0 auto; }
.page.page-cart { max-width: 1440px; }
.flash-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}
.flash {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
}
.flash-success {
  background: #ecfdf3;
  border-color: #bbf7d0;
  color: #166534;
}
.flash-error {
  background: #fff1f2;
  border-color: #fecdd3;
  color: #be123c;
}
.flash-warning {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #9a3412;
}
.toast-stack {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(420px, calc(100vw - 24px));
  pointer-events: none;
}
.toast {
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.18);
  border-radius: 12px;
  pointer-events: auto;
  animation: toastIn 0.22s ease-out;
  background: linear-gradient(135deg, #fb923c, #f97316);
  border-color: #ea580c;
  color: #fff;
}
.toast.flash-success,
.toast.flash-error,
.toast.flash-warning,
.toast.flash-info {
  background: linear-gradient(135deg, #fb923c, #f97316);
  border-color: #ea580c;
  color: #fff;
}
.toast-hide {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.24s ease, transform 0.24s ease;
}
.toast-live-notification {
  border-width: 1px;
  animation: toastIn 0.22s ease-out, toastNotifyBlink 0.95s ease-in-out 5;
}
.toast-live-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.toast-live-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.toast-live-title {
  font-weight: 800;
  margin: 0;
}
.toast-live-text {
  font-size: 13px;
  line-height: 1.4;
  margin: 0;
}
.toast-live-actions {
  display: flex;
  justify-content: flex-end;
  flex: 0 0 auto;
  margin-left: auto;
}
.toast-live-open {
  background: #fff;
  color: #9a3412;
  border-color: #fed7aa;
  box-shadow: none;
  padding: 7px 12px;
  font-size: 13px;
}
.toast-live-open:hover {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}
@keyframes toastNotifyBlink {
  0%, 100% {
    filter: brightness(1);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.18);
  }
  50% {
    filter: brightness(1.08);
    box-shadow: 0 18px 36px rgba(249, 115, 22, 0.45);
  }
}
@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.hero h1 { margin: 0 0 8px; }
.hero p { color: var(--muted); margin-top: 0; }
.search { margin-top: 12px; display: flex; gap: 8px; }
.search input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}
.search button {
  border-radius: 10px;
}

.cart-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.cart-table th, .cart-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.cart-table tr:last-child td { border-bottom: none; }
.cart-table thead th {
  background: #f8fafc;
  font-weight: 700;
}
.cart-table tbody tr:nth-child(every) {}
.cart-table tbody tr:nth-child(odd) { background: #fbfdff; }
.cart-table select,
.cart-table input[type="number"],
.cart-table input[type="text"],
.cart-table input[type="checkbox"] {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 8px;
}
.cart-table textarea {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  width: 100%;
}
.cart-summary {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--panel);
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.checkout-body {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 16px;
}
.order-form, .order-summary {
  background: var(--panel);
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.order-summary {
  margin-top: 0;
  display: block;
}
.order-summary ul { padding-left: 18px; }
.add-cart {
  margin-top: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}
.product-qty-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.product-qty-label {
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}
.product-qty-input {
  width: 96px;
  height: 38px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #0f172a;
  font-size: 16px;
  font-weight: 700;
}
.product-qty-input:focus {
  outline: none;
  border-color: #fb923c;
  box-shadow: 0 0 0 3px rgba(251, 146, 60, 0.24);
}
.product-qty-row .btn { white-space: nowrap; }
.inline-form { display: inline-flex; gap: 8px; align-items: center; margin: 0; }
.promo-form .promo-grid p { margin: 8px 0; }
.notes { display: flex; flex-direction: column; gap: 6px; }
.note { background: #f8fafc; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; }
.note-form textarea { width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 8px; margin-top: 8px; }

.manage h1, .manage h2 { margin-top: 0; }
.manage-users-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.manage-users-page__section {
  padding: 16px;
}
.manage-users-page .promo-create-title {
  margin: 0 0 10px;
}
.manage-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.manage-section-head h1,
.manage-section-head h2 {
  margin: 0;
  white-space: nowrap;
}
.manage .status-inline-filter {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-wrap: nowrap;
  white-space: nowrap;
}
.manage .status-inline-filter label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.manage .status-inline-filter select {
  min-width: 168px;
  height: 28px;
  border: 1px solid #f59e0b;
  border-radius: 8px;
  padding: 3px 28px 3px 8px;
  background: #fffaf4;
  color: #7c2d12;
  font-weight: 600;
  font-size: 12px;
  line-height: 1.1;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #9a3412 50%),
    linear-gradient(135deg, #9a3412 50%, transparent 50%);
  background-position:
    calc(100% - 13px) 11px,
    calc(100% - 8px) 11px;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
}
.manage .status-inline-filter select:focus {
  outline: none;
  border-color: #ea580c;
  box-shadow: 0 0 0 3px rgba(251, 146, 60, 0.22);
}
.manage .status-inline-filter .btn-filter {
  padding: 2px 7px !important;
  min-height: 26px !important;
  height: 26px !important;
  border-radius: 7px;
  font-size: 10px !important;
  line-height: 1;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(234, 88, 12, 0.14);
}
.manage .status-inline-filter .btn-filter-reset {
  padding: 2px 7px !important;
  min-height: 26px !important;
  height: 26px !important;
  border-radius: 7px;
  font-size: 10px !important;
  line-height: 1;
  font-weight: 700;
  border-color: #fed7aa;
  color: #9a3412;
  background: #fff7ed;
}
.manage .status-inline-filter .btn-filter-reset:hover {
  background: #ffedd5;
}
.manage-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.manage-orders-table,
.manage-preorders-table {
  min-width: 1200px;
}
.manage-orders-table th,
.manage-orders-table td,
.manage-preorders-table th,
.manage-preorders-table td {
  vertical-align: top;
}
.manage-orders-table th:nth-child(1),
.manage-orders-table td:nth-child(1),
.manage-orders-table th:nth-child(4),
.manage-orders-table td:nth-child(4),
.manage-orders-table th:nth-child(5),
.manage-orders-table td:nth-child(5),
.manage-orders-table th:nth-child(8),
.manage-orders-table td:nth-child(8) {
  white-space: nowrap;
}
.manage-orders-table th:nth-child(6),
.manage-orders-table td:nth-child(6) {
  min-width: 260px;
}
.manage-orders-table th:nth-child(7),
.manage-orders-table td:nth-child(7) {
  min-width: 320px;
}
.manage-orders-table th:nth-child(9),
.manage-orders-table td:nth-child(9) {
  min-width: 290px;
}
.order-action-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.order-action-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: stretch;
  flex: 0 0 150px;
}
.btn-order-chat,
.btn-order-delivery {
  padding: 6px 10px;
  min-height: 30px;
  border-radius: 8px;
  font-size: 12px;
}
.btn-order-chat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-order-chat.has-unread {
  border-color: #f59e0b;
  color: #b45309;
}
.chat-unread-badge {
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  font-size: 11px;
  line-height: 1;
  font-weight: 700;
  color: #fff;
  background: #f97316;
}
.order-id {
  font-weight: 700;
}
.order-cell-main {
  font-weight: 600;
  white-space: nowrap;
}
.order-cell-sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.order-items-list {
  margin: 0;
  padding-left: 18px;
}
.order-items-list li {
  margin: 0 0 4px;
  white-space: nowrap;
}
.order-items-list li:last-child {
  margin-bottom: 0;
}
.compact-note-form {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.compact-note-form textarea {
  margin-top: 0;
  min-height: 62px;
}
.compact-note-form .btn {
  align-self: flex-start;
  white-space: nowrap;
}
.order-date {
  white-space: nowrap;
}
.order-status-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: stretch;
  min-width: 360px;
}
.order-status-main-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.order-status-fields {
  display: flex;
  flex: 1 1 auto;
  min-width: 190px;
  flex-direction: column;
  gap: 6px;
}
.order-status-select {
  width: 100%;
}
.order-status-reason {
  width: 100%;
  min-width: 170px;
}
.order-status-form textarea {
  min-height: 102px;
  max-height: 220px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  resize: vertical;
  font: inherit;
}
.order-comment-box {
  white-space: pre-wrap;
  word-break: break-word;
}
.order-items-inline {
  margin-top: 8px;
}
.order-status-form .btn {
  width: 100%;
  white-space: nowrap;
}
.order-status-reason-view {
  white-space: normal;
  word-break: break-word;
}
.preorder-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 260px;
}
.preorder-form .btn {
  align-self: flex-start;
  white-space: nowrap;
}
.promo-form {
  margin-top: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow);
}
.promo-form .promo-fields { display: flex; flex-direction: column; gap: 12px; }
.promo-form .field label { display: block; margin-bottom: 4px; color: var(--muted); }
.promo-form .field input,
.promo-form .field select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
}
.promo-form .field input[type="checkbox"] {
  width: auto;
  padding: 0;
  margin-right: 8px;
  vertical-align: middle;
}
.promo-form .field-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
}
.promo-form .promo-active-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin-top: 0;
}
.promo-form .promo-active-row label {
  margin: 0;
  color: var(--muted);
  font-weight: 400;
}
.promo-form .promo-active-row .promo-active-check {
  line-height: 1;
}
.promo-form .promo-active-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  margin-right: 0;
  accent-color: #2563eb;
}
.promo-form .promo-create-btn {
  margin-top: 14px;
}
.promo-list {
  margin-top: 18px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow);
}
.promo-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.promo-list-head h2 { margin: 0; }
.promo-list-count {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.promo-code {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1e3a8a;
  font-weight: 700;
}
.promo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.btn-danger {
  background: #fff1f2;
  color: #be123c;
  border-color: #fecdd3;
  box-shadow: none;
}
.btn-danger:hover { box-shadow: var(--shadow); }

@media (max-width: 640px) {
  .topbar {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
  }
  .brand { flex: 1 1 auto; min-width: 0; }
  .brand-link { justify-content: flex-start; }
  .menu-toggle {
    display: inline-block;
    margin-left: auto;
    flex-shrink: 0;
    order: 2;
  }
  .nav-menu {
    display: none !important;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    width: 100%;
    flex-basis: 100%;
    order: 3;
    margin-top: 8px;
  }
  .nav-menu.open { display: flex !important; }
  .nav-menu .btn, .nav-menu .pill, .nav-menu a {
    padding: 8px 12px;
    width: 100%;
    justify-content: flex-start;
    font-size: 16px;
  }
  .page {
    padding: 20px 14px;
  }
  .brand-name { font-size: 18px; }
  .tagline { font-size: 13px; }
  .toast-stack {
    right: 10px;
    left: 10px;
    bottom: 10px;
    width: auto;
  }
  .manage-section-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .manage .status-inline-filter {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }
  .manage-orders-table,
  .manage-preorders-table {
    min-width: 1100px;
  }
}

@media (min-width: 641px) {
  .menu-toggle { display: none !important; }
  .nav-menu { display: flex !important; }
}

.status-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 12px;
  border: 1px solid var(--border);
  background: #eef2ff;
  color: #1e3a8a;
}
.status-new { background: #f0f9ff; color: #0ea5e9; border-color: #bae6fd; }
.status-approval { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
.status-processing { background: #fff7ed; color: #ea580c; border-color: #fed7aa; }
.status-shipped { background: #ecfdf3; color: #16a34a; border-color: #bbf7d0; }
.status-done { background: #f7fee7; color: #65a30d; border-color: #d9f99d; }
.status-canceled { background: #fff1f2; color: #be123c; border-color: #fecdd3; }
.status-rejected { background: #ffe4e6; color: #be123c; border-color: #fecdd3; }

.card-section {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.auth {
  max-width: 420px;
  margin: 20px auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  box-shadow: var(--shadow);
}
.auth h1 { margin-top: 0; }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-priority {
  margin: 0 0 14px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
}
.auth-priority-title {
  font-weight: 800;
  margin-bottom: 8px;
  color: #1e3a8a;
}
.tg-login-priority { margin-bottom: 10px; }
.auth-alert {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 14px;
  line-height: 1.4;
}
.auth-alert-warn {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #9a3412;
}
.auth-alert-success {
  background: #ecfdf3;
  border-color: #bbf7d0;
  color: #166534;
}
.auth-links-inline {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: nowrap;
  margin: 2px 0 0;
}
.auth-link-main,
.auth-links-inline a {
  white-space: nowrap;
  color: var(--accent);
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
}
.auth-link-main:hover,
.auth-links-inline a:hover { text-decoration: underline; }
.field label { display: block; margin-bottom: 6px; color: var(--muted); }
.field input:not([type="checkbox"]),
.field textarea,
.field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  color: inherit;
  background: #fff;
}
.field-checkbox label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.checkout-customer-type {
  margin-bottom: 8px;
  padding: 0;
  border: none;
  background: transparent;
}
.checkout-customer-type-toggle {
  position: relative;
  display: grid;
  grid-template-columns: 82px 40px 82px;
  grid-template-rows: 24px auto;
  justify-content: start;
  align-items: center;
  gap: 6px;
  padding: 7px 9px;
  border: 1px solid #fed7aa;
  border-radius: 10px;
  background: #fffaf4;
  cursor: pointer;
  width: fit-content;
  margin: 0;
  line-height: 1;
}
.checkout-customer-type-toggle input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  pointer-events: none;
}
.checkout-customer-type-slider {
  display: inline-block;
  flex: 0 0 40px;
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
  position: relative;
  width: 40px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid #f59e0b;
  background: #fdba74;
  overflow: hidden;
  transition: background-color 0.2s ease;
}
.checkout-customer-type-slider::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.25);
  transition: transform 0.2s ease;
}
.checkout-customer-type-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  line-height: 24px;
  font-size: 12px;
  font-weight: 700;
  color: #7c2d12;
  text-align: center;
  width: 82px;
  margin: 0;
  padding: 0;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}
.checkout-customer-type-label-left {
  grid-column: 1;
  grid-row: 1;
  text-align: center;
}
.checkout-customer-type-label-right {
  grid-column: 3;
  grid-row: 1;
  text-align: center;
}
.checkout-customer-type-status {
  grid-column: 1 / -1;
  grid-row: 2;
  display: block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  color: #9a3412;
}
.checkout-customer-type.is-individual .checkout-customer-type-slider {
  background: #f59e0b;
}
.checkout-customer-type.is-individual .checkout-customer-type-slider::after {
  transform: translateX(18px);
}
.checkout-customer-type:not(.is-individual) .checkout-customer-type-label-left {
  opacity: 1;
}
.checkout-customer-type.is-individual .checkout-customer-type-label-right {
  opacity: 1;
}
.field textarea {
  min-height: 96px;
  resize: vertical;
}
.card-brand {
  color: #7c2d12;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
}
.product-brand {
  margin: 0 0 6px;
  color: #7c2d12;
  font-weight: 700;
}
.field.is-hidden {
  display: none;
}
.promo-code-inline {
  display: flex;
  align-items: stretch;
  gap: 8px;
  flex-wrap: nowrap;
}
.promo-code-inline > input,
.promo-code-inline input[type="text"] {
  flex: 1 1 auto;
  width: auto !important;
  min-width: 0;
  margin: 0;
}
.promo-apply-btn {
  flex: 0 0 40px;
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid #fdba74;
  background: #fff7ed;
  color: #c2410c;
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
}
.promo-apply-btn:hover {
  transform: none;
  background: #ffedd5;
}
.promo-apply-btn.is-loading {
  opacity: 0.85;
}
.promo-apply-btn.is-success {
  background: #16a34a;
  border-color: #16a34a;
  color: #fff;
  animation: promoPop 0.22s ease;
}
.promo-apply-btn.is-error {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
  animation: promoShake 0.25s linear 2;
}
@keyframes promoPop {
  0% { transform: scale(0.92); }
  70% { transform: scale(1.06); }
  100% { transform: scale(1); }
}
@keyframes promoShake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  50% { transform: translateX(2px); }
  75% { transform: translateX(-2px); }
  100% { transform: translateX(0); }
}
.promo-feedback {
  display: none;
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 600;
}
.promo-feedback:not(:empty) {
  display: block;
}
.promo-feedback.is-success {
  color: #15803d;
  background: #f0fdf4;
  border-color: #bbf7d0;
}
.promo-feedback.is-error {
  color: #b91c1c;
  background: transparent;
  border-color: transparent;
  border-radius: 0;
  padding: 0;
}
.checkout .order-form form .promo-code-field {
}
.checkout .order-form form .promo-code-field .error {
  display: block;
  margin-top: 6px;
  line-height: 1.3;
}
.checkout .order-form form > .btn[type="submit"] {
  margin-top: 8px;
}
.field input[readonly],
.field input[disabled] {
  background: #f8fafc;
  color: #64748b;
}
.error { color: #b91c1c; font-size: 13px; }
.muted { color: var(--muted); }

.profile-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.profile-head h1 {
  margin: 0 0 6px;
}
.profile-head .muted {
  margin: 0;
}
.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.profile-panel {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  background: #fff;
}
.profile-panel h2 {
  margin: 0 0 10px;
}
.profile-subtitle {
  margin: 14px 0 8px;
  font-size: 16px;
}
.profile-inline-alert {
  margin-top: 10px;
}
.profile-tg-widget {
  margin-top: 12px;
}

.layout { display: grid; grid-template-columns: 240px 1fr; gap: 20px; margin-top: 20px; }
.sidebar {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow);
}
.sidebar-filter-single {
  margin-bottom: 14px;
  padding: 10px;
  border: 1px solid #c7d2fe;
  border-radius: 10px;
  background: #f8faff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.85);
}
.sidebar-filter-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
  flex-wrap: nowrap;
}
.sidebar-filter-inline label {
  margin: 0;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.sidebar-filter-form select {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  min-height: 34px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 6px 28px 6px 10px;
  background: #fff;
  color: var(--text);
  font-weight: 600;
  font-size: 12px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #64748b 50%),
    linear-gradient(135deg, #64748b 50%, transparent 50%);
  background-position:
    calc(100% - 13px) 14px,
    calc(100% - 8px) 14px;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
}
.sidebar-filter-form select:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(147, 197, 253, 0.25);
}
.sidebar-title { font-weight: 700; margin-bottom: 10px; }
.nav { list-style: none; padding: 0; margin: 0; }
.nav li { margin-bottom: 8px; }
.nav a { color: var(--accent); padding: 8px 10px; display: block; border-radius: 10px; }
.nav a.active, .nav a:hover { background: #eef2ff; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}
.catalog-card {
  transition: transform 0.16s ease, box-shadow 0.2s ease;
}
.catalog-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.12);
}
.catalog-card-added {
  animation: cardPulse 0.26s ease;
}
.catalog-pager {
  grid-column: 2;
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.catalog-pager-top {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  white-space: nowrap;
}
.catalog-pager-pages {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex-wrap: nowrap;
}
.catalog-pager-arrow {
  width: 34px;
  min-width: 34px;
  height: 34px;
  padding: 0;
  gap: 0;
  line-height: 0;
  font-size: 0;
  border-radius: 8px;
}
.catalog-pager-arrow .pager-arrow-icon {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.catalog-pager-meta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.catalog-pager-page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--accent);
  font-weight: 700;
  font-size: 12px;
  text-decoration: none;
}
a.catalog-pager-page:hover {
  background: #ffedd5;
  text-decoration: none;
}
.catalog-pager-page.is-current {
  background: #ea580c;
  border-color: #ea580c;
  color: #fff;
}
.catalog-pager-dots {
  color: var(--muted);
  font-weight: 700;
  padding: 0 4px;
}
.catalog-pager .pager-info {
  min-width: auto;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
}
.catalog-pager-per-page {
  color: #64748b;
  font-weight: 600;
  font-size: 11px;
  opacity: 0.9;
}
@keyframes cardPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}
.card img { width: 100%; height: 180px; object-fit: cover; background: #f1f5f9; }
.card-body { padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.card-body h3 { margin: 1px 0 0; line-height: 1.22; }
.sku { color: var(--muted); font-size: 12px; line-height: 1.2; margin: 0; }
.price { font-weight: 700; color: var(--accent); font-size: 20px; line-height: 1.2; }
.card-body .price { font-size: 18px; }
.price-old { font-size: 14px; }
.stock { color: var(--muted); }
.price-block { display: flex; flex-direction: column; gap: 2px; }
.card-body .price-block { margin-top: 6px; }
.product-info .price-block { margin-bottom: 14px; }
.price-old {
  color: #94a3b8;
  text-decoration: line-through;
  font-size: 14px;
}
.price-discounted { color: #16a34a; }
.price-unknown {
  color: #64748b;
  font-size: 16px;
  font-weight: 700;
}
.product-info .price-unknown {
  font-size: 18px;
}
.price-discount-note {
  color: #1e3a8a;
  font-size: 12px;
  font-weight: 700;
}
.card-actions {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.card-open-btn { min-width: 90px; }
.card-actions-preorder {
  flex-wrap: nowrap;
  align-items: center;
}
.card-preorder-inline-form {
  margin: 0;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}
.card-actions-preorder .btn {
  white-space: nowrap;
}
.qty-control {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.qty-control-compact { border-radius: 8px; }
.qty-btn {
  min-width: 34px;
  height: 34px;
  border: none;
  border-right: 1px solid var(--border);
  background: #f8fafc;
  color: #0f172a;
  font-size: 18px;
  font-weight: 700;
  padding: 0 10px;
  border-radius: 0;
  box-shadow: none;
}
.qty-btn:last-child { border-right: none; border-left: 1px solid var(--border); }
.qty-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.qty-btn:hover {
  transform: none;
  background: #eef2ff;
}
.qty-value {
  min-width: 38px;
  text-align: center;
  font-weight: 700;
  font-size: 15px;
}
.cart-product-link {
  font-weight: 700;
}
.cart-unavailable-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.cart-unavailable-actions form { margin: 0; }

.product { display: grid; grid-template-columns: 380px 1fr; gap: 24px; }
.product-slider { position: relative; }
.product-slides { position: relative; min-height: 320px; }
.product-slide { display: none; }
.product-slide.is-active {
  display: block;
  animation: productFade 0.2s ease;
}
@keyframes productFade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.product-image-button {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  border-radius: 12px;
  background: transparent;
  cursor: zoom-in;
  box-shadow: none;
}
.product-image-button:hover { transform: none; }
.product-main-image {
  width: 100%;
  min-height: 320px;
  max-height: 460px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  background: #f8fafc;
}
.product-video-frame {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}
.product-video-frame iframe,
.product-video-frame video {
  width: 100%;
  height: 360px;
  border: none;
  border-radius: 10px;
  background: #020617;
}
.video-fallback-link {
  margin-top: 8px;
  display: inline-block;
  font-size: 14px;
}
.product-video-open {
  margin-top: 8px;
  padding: 7px 10px;
  border-radius: 9px;
  font-size: 13px;
}
.product-nav {
  position: absolute;
  top: 48%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  color: #0f172a;
  padding: 0;
  box-shadow: var(--shadow);
  font-size: 22px;
  line-height: 1;
  z-index: 2;
}
.product-nav:hover { transform: translateY(-50%); }
.product-nav-prev { left: 10px; }
.product-nav-next { right: 10px; }
.product-thumbs {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  gap: 8px;
}
.product-thumb {
  display: block;
  width: 100%;
  min-height: 66px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0;
  overflow: hidden;
  background: #f8fafc;
  box-shadow: none;
}
.product-thumb:hover { transform: none; }
.product-thumb.is-active {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}
.product-thumb img {
  width: 100%;
  height: 66px;
  object-fit: cover;
  display: block;
}
.product-thumb-video {
  width: 100%;
  min-height: 66px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: #1e3a8a;
  background: #eff6ff;
}
.product-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(241, 245, 249, 0.96);
  padding: 14px;
  z-index: 70;
}
.product-lightbox[hidden] { display: none; }
.product-lightbox-shell {
  position: relative;
  width: min(1500px, 100%);
  height: min(92vh, 980px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 184px 1fr;
  gap: 14px;
  padding-right: 0;
}
@media (min-width: 901px) {
  .product-lightbox-shell {
    /* On desktop keep a wider shell so the media stage has more room to the right. */
    width: min(1640px, 100%);
    grid-template-columns: 170px 1fr;
    gap: 16px;
    /* Right gutter for the close button outside the media stage. */
    padding-right: 88px;
  }
  .lightbox-close {
    top: 14px;
    right: 20px;
  }
}
.lightbox-sidebar {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #dbe5ef;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 8px;
}
.lightbox-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
  padding: 0 2px 8px;
}
.lightbox-count {
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid #dbe5ef;
  background: #f8fafc;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}
.lightbox-thumb-list {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 2px;
}
.lightbox-thumb {
  width: 100%;
  border: 1px solid #dbe5ef;
  border-radius: 10px;
  overflow: hidden;
  padding: 0;
  background: #f8fafc;
  box-shadow: none;
}
.lightbox-thumb:hover { transform: none; }
.lightbox-thumb.is-active {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}
.lightbox-thumb img {
  width: 100%;
  height: 102px;
  object-fit: cover;
  display: block;
}
.lightbox-thumb-video {
  width: 100%;
  height: 102px;
  display: grid;
  place-items: center;
  background: #e2e8f0;
  color: #334155;
  font-weight: 800;
  font-size: 13px;
}
.lightbox-stage {
  position: relative;
  background: #edf1f5;
  border: 1px solid #dbe5ef;
  border-radius: 14px;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.lightbox-stage img {
  max-width: min(1080px, calc(100vw - 340px));
  max-height: calc(92vh - 46px);
  object-fit: contain;
  object-position: center center;
  display: block;
  margin: 0 auto;
  user-select: none;
  pointer-events: none;
}
.lightbox-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 20px 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
.lightbox-media[hidden] {
  display: none !important;
}
.lightbox-media-video iframe,
.lightbox-media-video video {
  width: min(1080px, calc(100vw - 340px));
  height: min(78vh, 760px);
  margin: 0 auto;
  display: block;
  border: none;
  border-radius: 12px;
  background: #0f172a;
}
.lightbox-media-video iframe[hidden],
.lightbox-media-video video[hidden] {
  display: none !important;
}
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  border: 1px solid #fb923c;
  background: rgba(255, 255, 255, 0.95);
  color: #c2410c;
  font-size: 30px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}
.lightbox-nav:hover { transform: translateY(-50%); }
.lightbox-nav-prev { left: 28px; }
.lightbox-nav-next { right: 18px; }
.lightbox-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  font-size: 26px;
  line-height: 1;
  padding: 0;
  border: 1px solid #fb923c;
  background: rgba(255, 255, 255, 0.96);
  color: #c2410c;
  box-shadow: none;
}
.lightbox-close:hover { transform: none; }
body.no-scroll { overflow: hidden; }
.placeholder {
  height: 320px;
  border-radius: 12px;
  border: 1px dashed var(--border);
  display: grid;
  place-items: center;
  color: var(--muted);
}
.product-info h1 { margin: 0 0 8px; }
.product-purchase-box {
  margin-top: 12px;
  border: 1px solid #fed7aa;
  background: #fff7ed;
  border-radius: 12px;
  padding: 10px 12px;
}
.product-purchase-meta {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
}
.product-purchase-label {
  color: #7c2d12;
  font-size: 13px;
  font-weight: 700;
}
.product-purchase-stock {
  color: #9a3412;
  font-size: 18px;
  font-weight: 800;
}
.desc { color: var(--muted); line-height: 1.5; }
.preorder-box {
  margin-top: 12px;
  border: 1px solid #fed7aa;
  background: #fff7ed;
  border-radius: 10px;
  padding: 10px 12px;
}
.preorder-box .stock {
  margin-bottom: 6px;
}
.preorder-note {
  margin-top: 4px;
  color: #9a3412;
  font-weight: 600;
}
.preorder-login-btn {
  margin-top: 10px;
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 14px;
}
.preorder-form {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.preorder-form label {
  color: #7c2d12;
  font-size: 13px;
  font-weight: 600;
}
.preorder-form input,
.preorder-form textarea {
  width: 100%;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
}
.preorder-form button { align-self: flex-start; }

.notifications-telegram-cta {
  width: 100%;
}
.notifications-telegram-layout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.notifications-telegram-copy {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.notifications-telegram-copy .auth-priority-title {
  margin: 0 0 4px;
}
.notifications-telegram-text {
  margin: 0;
  line-height: 1.4;
}
.notifications-telegram-widget {
  margin: 0 0 0 auto;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}
.notifications-telegram-widget.tg-login-priority {
  margin-bottom: 0;
}
@media (max-width: 640px) {
  .notifications-telegram-layout {
    flex-direction: column;
    align-items: flex-start;
  }
  .notifications-telegram-widget {
    margin-left: 0;
    justify-content: flex-start;
  }
}

.notifications-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.notifications-head h1 { margin: 0; }
.notifications-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.notification-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  padding: 12px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.notification-item.is-unread {
  border-color: #cbd5e1;
}
.notification-title {
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}
.notification-kind-badge {
  display: inline-flex;
  align-items: center;
  padding: 0;
  border-radius: 0;
  font-size: 12px;
  font-weight: 800;
  border: none;
  background: transparent;
}
.notification-info {
  border-color: var(--border);
  background: #fff;
}
.notification-info .notification-kind-badge {
  color: #2563eb;
}
.notification-success {
  border-color: var(--border);
  background: #fff;
}
.notification-success .notification-kind-badge {
  color: #16a34a;
}
.notification-warning {
  border-color: var(--border);
  background: #fff;
}
.notification-warning .notification-kind-badge {
  color: #ea580c;
}
.notification-danger {
  border-color: var(--border);
  background: #fff;
}
.notification-danger .notification-kind-badge {
  color: #ea580c;
}
.notification-message {
  margin-top: 4px;
  color: var(--muted);
}
.notification-meta {
  margin-top: 6px;
  color: #94a3b8;
  font-size: 12px;
}
.notification-link {
  margin-top: 7px;
  display: inline-block;
  font-weight: 700;
}
.pager {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.pager-info {
  min-width: 68px;
  text-align: center;
  color: var(--muted);
  font-weight: 700;
}
.pager-btn {
  min-width: 42px;
  padding: 8px 12px;
}
.pager-btn.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.summary-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
.summary-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8fafc;
}
.summary-item-name { font-weight: 700; }
.summary-item-qty { color: var(--muted); font-size: 13px; margin-top: 2px; }
.summary-item-main {
  flex: 1 1 auto;
  min-width: 0;
}
.summary-item-vertical {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.summary-item-discount-note {
  margin-top: 4px;
  color: #16a34a;
  font-size: 12px;
  font-weight: 700;
}
.summary-item-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}
.summary-item-row span {
  color: var(--muted);
  font-size: 13px;
}
.summary-item-row strong {
  text-align: right;
  white-space: nowrap;
}
.summary-item-row-final span {
  color: var(--text);
  font-weight: 700;
}
.summary-item-table,
.summary-totals-table {
  width: 100%;
  border-collapse: collapse;
}
.summary-item-table th,
.summary-item-table td,
.summary-totals-table th,
.summary-totals-table td {
  padding: 6px 0;
}
.summary-item-table th,
.summary-totals-table th {
  text-align: left;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.summary-item-table td,
.summary-totals-table td {
  text-align: right;
  white-space: nowrap;
  font-weight: 700;
}
.summary-item-table .is-discounted th,
.summary-item-table .is-discounted td,
.summary-totals-table .is-discounted th,
.summary-totals-table .is-discounted td {
  color: #16a34a;
}
.summary-item-total {
  min-width: 120px;
  text-align: right;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}
.summary-totals {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.summary-totals-table {
  margin-top: 12px;
  border-top: 1px solid var(--border);
}
.summary-totals-table tr {
  border-bottom: 1px dashed #e2e8f0;
}
.summary-totals-table tr:last-child {
  border-bottom: none;
}
.summary-total-row th,
.summary-total-row td {
  padding-top: 10px;
  font-size: 15px;
  font-weight: 800;
  color: #1e3a8a;
}
.summary-line {
  margin-top: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}
.summary-line-discount {
  color: #16a34a;
}
.summary-line-muted {
  color: #64748b;
}
.summary-total {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 10px;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
}
.cart-summary-lines {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 260px;
}
.summary-unavailable {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
}
.summary-unavailable h4 {
  margin: 0 0 6px;
  color: #9a3412;
}
.summary-unavailable ul {
  margin: 0;
  padding-left: 18px;
  color: #9a3412;
}

.footer {
  margin-top: 40px;
  padding: 18px 24px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  background: var(--panel);
}
.footer-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.footer-bottom-line {
  max-width: 1200px;
  margin: 12px auto 0;
  padding-top: 10px;
  border-top: 1px solid #e2e8f0;
  text-align: center;
  font-size: 13px;
  white-space: nowrap;
}
.footer-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.footer-left {
  align-items: flex-start;
}
.footer-right {
  align-items: flex-end;
  text-align: right;
}
.footer-line {
  margin: 0;
}
.footer-company {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #0f172a;
  font-weight: 700;
  cursor: default;
}
.footer-company-tooltip {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  min-width: 250px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #fed7aa;
  background: #fff7ed;
  color: #9a3412;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
  text-align: left;
  line-height: 1.35;
  opacity: 0;
  transform: translateY(4px);
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 10;
}
.footer-company:hover .footer-company-tooltip,
.footer-company:focus .footer-company-tooltip,
.footer-company:focus-within .footer-company-tooltip {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}
.footer-company-tooltip-line {
  display: block;
  margin-top: 5px;
}
.footer-company-tooltip-line:first-child {
  margin-top: 0;
}
.footer-company-tooltip-label {
  font-weight: 800;
  color: #7c2d12;
}
.footer-company-tooltip-value {
  color: #7c2d12;
}
.footer-manager-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid #fdba74;
  background: #fff7ed;
  font-weight: 700;
  color: #9a3412;
}
.footer-manager-link:hover {
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(234, 88, 12, 0.2);
}
.footer-manager-icon-img {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
  object-fit: contain;
  display: block;
}
.footer-manager-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.2;
}
.footer-manager-sub {
  font-size: 12px;
  color: #c2410c;
  font-weight: 700;
}

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .profile-grid { grid-template-columns: 1fr; }
  .product { grid-template-columns: 1fr; }
}

/* Mobile layout tweaks (phone) */
@media (max-width: 640px) {
  .page { padding: 20px 14px; }
  .grid { grid-template-columns: 1fr; }
  .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .catalog-grid .card img { height: 150px; }
  .card img { height: 200px; }
  .product { grid-template-columns: 1fr; }
  .product-main-image { min-height: 260px; max-height: 340px; }
  .product-video-frame iframe,
  .product-video-frame video { height: 250px; }
  .product-nav {
    top: 46%;
    width: 34px;
    height: 34px;
  }
  .product-thumbs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .product-qty-row { align-items: stretch; }
  .product-qty-input { width: 100%; }
  .product-qty-row .btn { width: 100%; }
  .product-lightbox {
    padding: 8px;
  }
  .product-lightbox-shell {
    height: calc(100vh - 16px);
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
    gap: 10px;
  }
  .lightbox-stage img {
    max-width: calc(100vw - 34px);
    max-height: calc(100vh - 220px);
  }
  .lightbox-media {
    padding: 10px 52px;
  }
  .lightbox-nav {
    width: 40px;
    height: 40px;
    font-size: 26px;
  }
  .lightbox-nav-prev { left: 18px; }
  .lightbox-nav-next { right: 10px; }
  .lightbox-sidebar {
    padding: 8px;
  }
  .lightbox-sidebar-head {
    padding-bottom: 6px;
  }
  .lightbox-thumb-list {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    padding-right: 0;
    padding-bottom: 2px;
  }
  .lightbox-thumb {
    width: 68px;
    min-width: 68px;
  }
  .lightbox-thumb img {
    height: 68px;
  }
  .lightbox-thumb-video {
    height: 68px;
    font-size: 12px;
  }
  .lightbox-media-video iframe,
  .lightbox-media-video video {
    width: calc(100vw - 34px);
    max-height: calc(100vh - 220px);
  }
  .checkout-body { grid-template-columns: 1fr; }
  .summary-item-table th,
  .summary-item-table td,
  .summary-totals-table th,
  .summary-totals-table td {
    font-size: 13px;
  }
  .summary-item-row { grid-template-columns: 1fr auto; }
  .summary-line { grid-template-columns: 1fr auto; }
  .cart-table { display: block; overflow-x: auto; }
  .cart-summary { flex-direction: column; align-items: flex-start; }
  .card-actions { flex-direction: column; align-items: stretch; }
  .card-open-btn, .card-actions form .btn, .card-actions .btn { width: 100%; }
  .card-actions-preorder {
    flex-direction: column;
    align-items: stretch;
    flex-wrap: nowrap;
    gap: 8px;
  }
  .card-actions-preorder .card-preorder-inline-form {
    display: flex;
    width: 100%;
  }
  .card-actions-preorder .card-open-btn,
  .card-actions-preorder .card-preorder-inline-form,
  .card-actions-preorder form .btn,
  .card-actions-preorder .btn {
    width: 100%;
    white-space: normal;
    text-align: center;
  }
  .qty-control { width: 100%; justify-content: space-between; }
  .qty-value { flex: 1 1 auto; }
  .notification-item { flex-direction: column; }
  .pager { justify-content: center; }
  .catalog-pager {
    grid-column: 1;
    align-items: center;
    width: 100%;
  }
  .catalog-pager-top {
    width: 100%;
    justify-content: center;
    overflow-x: auto;
    max-width: 100%;
    padding-bottom: 2px;
  }
  .catalog-pager-pages { justify-content: center; }
  .catalog-pager-meta {
    margin-left: 0;
    justify-content: center;
    width: 100%;
  }
  .catalog-pager-page {
    min-width: 28px;
    height: 28px;
    padding: 0 6px;
    font-size: 12px;
  }
  .footer-grid {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .footer-right {
    align-items: flex-start;
    text-align: left;
  }
  .footer-company-tooltip {
    right: auto;
    left: 0;
    min-width: 220px;
  }
  .footer-manager-link {
    width: 100%;
    justify-content: flex-start;
  }
  .footer-bottom-line {
    margin-top: 10px;
    font-size: 12px;
  }
  .promo-form .field input, .promo-form .field select { width: 100%; }
  .sidebar-filter-inline {
    flex-wrap: nowrap;
  }
  .sidebar-filter-inline label {
    flex: 0 0 auto;
  }
  .promo-list-head { flex-direction: column; align-items: flex-start; }
}

.order-chat-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.order-chat-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.order-chat-head h1 {
  margin: 0 0 6px;
}
.order-chat-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 14px;
}
.order-chat-info,
.order-chat-main {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}
.order-chat-main {
  display: flex;
  flex-direction: column;
  min-height: 640px;
}
.order-chat-info h2,
.order-chat-main h3 {
  margin: 0 0 10px;
}
.order-chat-items {
  margin: 8px 0 0;
  padding-left: 18px;
}
.order-chat-panel {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 10px;
  background: #fffbf5;
}
.order-decision-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chat-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 4px 0;
}
.chat-pager .pager-info {
  min-width: 72px;
  text-align: center;
}
.order-chat-messages {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  background: #f8fafc;
  min-height: 320px;
  max-height: calc(100vh - 320px);
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.order-chat-message {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  padding: 8px 10px;
}
.order-chat-message[data-repliable="1"] {
  cursor: context-menu;
}
.order-chat-message:target {
  border-color: #fb923c;
  box-shadow: 0 0 0 2px rgba(251, 146, 60, 0.2);
}
.order-chat-message header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.order-chat-message.is-own {
  border-color: #fed7aa;
  background: #fff7ed;
}
.order-chat-message.is-system {
  border-style: dashed;
  background: #f8fafc;
}
.order-chat-message.is-reply-selected {
  border-color: #f59e0b;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.22);
}
.order-chat-reply-ref {
  margin-bottom: 7px;
  padding: 6px 8px;
  border-left: 3px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  font-size: 12px;
}
.order-chat-reply-ref a {
  color: #334155;
  text-decoration: none;
}
.order-chat-message.is-own .order-chat-reply-ref {
  border-left-color: #f59e0b;
  background: #fff;
}
.order-chat-message.is-own .order-chat-reply-ref a {
  color: #9a3412;
}
.order-chat-reply-ref a:hover {
  text-decoration: underline;
}
.order-chat-text {
  white-space: pre-wrap;
  word-break: break-word;
}
.order-chat-image {
  margin-top: 8px;
  width: min(320px, 100%);
  border-radius: 8px;
  border: 1px solid var(--border);
}
.order-chat-video {
  margin-top: 8px;
  width: min(420px, 100%);
  max-height: 320px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #000;
}
.order-chat-video-link {
  margin-top: 4px;
  font-size: 12px;
}
.chat-reply-hint {
  margin: 8px 0 4px;
  font-size: 12px;
}
.install-prompt {
  position: fixed;
  right: 12px;
  bottom: 18px;
  width: min(290px, calc(100vw - 20px));
  padding: 13px 13px 12px;
  border-radius: 16px;
  border: 1px solid rgba(251, 146, 60, 0.32);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.22), transparent 44%),
    linear-gradient(160deg, #fb923c 0%, #ea580c 62%, #9a3412 100%);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.28);
  color: #fff;
  z-index: 1100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}
.install-prompt.is-visible {
  opacity: 1;
  pointer-events: auto;
}
.install-prompt__close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  box-shadow: none;
  font-size: 16px;
  line-height: 1;
}
.install-prompt__close:hover {
  transform: none;
  background: rgba(255, 255, 255, 0.22);
}
.install-prompt__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.install-prompt__title {
  margin: 10px 0 6px;
  padding-right: 30px;
  font-size: 18px;
  line-height: 1.15;
}
.install-prompt__text {
  margin: 0;
  color: rgba(255, 255, 255, 0.92);
  line-height: 1.35;
  font-size: 12px;
}
.install-prompt__steps {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.install-prompt__step {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  font-size: 12px;
  line-height: 1.3;
}
.install-prompt__step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 11px;
  font-weight: 800;
}
.install-prompt__pointer {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 0;
}
.install-prompt__pointer-line {
  display: block;
  width: 2px;
  height: 28px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
}
.install-prompt__pointer-head {
  display: block;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
}
.install-prompt--ios-bottom {
  left: 50%;
  right: auto;
  bottom: 12px;
  transform: translateX(-50%);
}
.install-prompt--ios-bottom .install-prompt__pointer {
  left: 50%;
  bottom: -34px;
  transform: translateX(-50%);
  flex-direction: column;
}
.install-prompt--ios-bottom .install-prompt__pointer-head {
  margin-top: -1px;
  border-top: 12px solid rgba(255, 255, 255, 0.92);
}

@media (max-width: 640px) {
  .install-prompt {
    width: min(290px, calc(100vw - 16px));
    right: 8px;
    bottom: 8px;
    padding: 12px 12px 11px;
  }
  .install-prompt__title {
    font-size: 17px;
  }
  .install-prompt__text,
  .install-prompt__step {
    font-size: 12px;
  }
  .install-prompt--ios-bottom {
    left: 50%;
    right: auto;
    bottom: 8px;
  }
}
.order-chat-send-form {
  margin-top: 10px;
  position: sticky;
  bottom: 0;
  background: #fff;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.chat-reply-compose {
  border: 1px solid #fed7aa;
  background: #fff7ed;
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 10px;
}
.chat-reply-compose-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.chat-reply-compose-text {
  margin-top: 6px;
  font-size: 13px;
  color: #9a3412;
  white-space: pre-wrap;
  word-break: break-word;
}
.chat-reply-cancel {
  min-height: 26px;
  padding: 4px 8px;
  font-size: 11px;
}

@media (max-width: 980px) {
  .order-chat-layout {
    grid-template-columns: 1fr;
  }
  .order-chat-main {
    min-height: 0;
  }
  .order-chat-messages {
    min-height: 260px;
    max-height: 60vh;
  }
  .order-chat-send-form {
    position: static;
    border-top: none;
    padding-top: 0;
  }
}
