/* Header tools + commerce pages */

.om-header__tools {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.om-header__tool {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  color: var(--om-muted);
  transition: background 0.15s, color 0.15s;
}

.om-header__tool:hover {
  background: var(--om-surface);
  color: var(--om-text);
}

.om-header__badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--om-blue);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

.om-header__user {
  font-size: 14px;
  font-weight: 600;
  color: var(--om-text);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.om-header__user:hover { color: var(--om-blue); }

.om-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  z-index: 200;
  padding: 12px 20px;
  border-radius: 10px;
  background: #0f172a;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}

.om-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Commerce layout */
.om-commerce-page {
  padding: 32px 0 64px;
  min-height: 60vh;
}

.om-commerce-head {
  margin-bottom: 28px;
}

.om-commerce-head__title {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 8px;
}

.om-commerce-head__lead {
  color: var(--om-muted);
  font-size: 15px;
}

.om-commerce-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 28px;
  align-items: start;
}

.om-commerce-card {
  background: #fff;
  border: 1px solid var(--om-border);
  border-radius: var(--om-radius-lg);
  overflow: hidden;
}

.om-cart-item {
  display: grid;
  grid-template-columns: 88px 1fr auto;
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--om-border);
  align-items: center;
}

.om-cart-item:last-child { border-bottom: none; }

.om-cart-item__img {
  width: 88px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--om-surface);
}

.om-cart-item__name {
  font-weight: 600;
  margin-bottom: 4px;
}

.om-cart-item__name a:hover { color: var(--om-blue); }

.om-cart-item__meta {
  font-size: 13px;
  color: var(--om-muted);
  margin-bottom: 8px;
}

.om-cart-item__price {
  font-weight: 700;
  font-size: 16px;
}

.om-cart-item .om-qty {
  display: inline-flex;
  align-items: stretch;
  height: 34px;
  border: 1px solid var(--om-border);
  border-radius: 8px;
  background: var(--om-surface);
  overflow: hidden;
}

.om-cart-item .om-qty__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  min-width: 30px;
  padding: 0;
  border: none;
  background: transparent;
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  color: var(--om-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.om-cart-item .om-qty__btn:hover {
  background: #fff;
  color: var(--om-blue);
}

.om-cart-item .om-qty__btn:active {
  background: var(--om-border);
}

.om-cart-item .om-qty__input {
  width: 2.75rem;
  min-width: 0;
  height: 100%;
  padding: 0 2px;
  border: none;
  border-left: 1px solid var(--om-border);
  border-right: 1px solid var(--om-border);
  background: #fff;
  text-align: center;
  font-weight: 600;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
  appearance: textfield;
}

.om-cart-item .om-qty__input::-webkit-outer-spin-button,
.om-cart-item .om-qty__input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.om-cart-item .om-qty__input:focus {
  outline: none;
  box-shadow: inset 0 0 0 2px rgba(37, 99, 235, 0.25);
}

.om-cart-item__actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.om-cart-item__remove {
  font-size: 13px;
  color: var(--om-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.om-cart-item__remove:hover { color: #dc2626; }

.om-cart-summary {
  padding: 24px;
  position: sticky;
  top: 88px;
}

.om-cart-summary__row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 14px;
}

.om-cart-summary__row--total {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--om-border);
  font-size: 18px;
  font-weight: 700;
}

.om-cart-summary__note {
  font-size: 12px;
  color: var(--om-muted);
  margin: 12px 0 20px;
}

.om-cart-empty {
  padding: 48px 24px;
  text-align: center;
}

.om-cart-empty__title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.om-cart-empty__text {
  color: var(--om-muted);
  margin-bottom: 20px;
}

/* Checkout */
.om-checkout-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.om-checkout-section {
  padding: 24px;
  margin-bottom: 20px;
}

.om-checkout-section__title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
}

.om-checkout-methods {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.om-checkout-method {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--om-border);
  border-radius: 10px;
  cursor: pointer;
}

.om-checkout-method:has(input:checked) {
  border-color: var(--om-blue);
  background: #eff6ff;
}

.om-checkout-success {
  text-align: center;
  padding: 48px 24px;
}

.om-checkout-success__icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: #dcfce7;
  color: #16a34a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}

/* Compare table */
.om-compare-wrap {
  overflow-x: auto;
}

.om-compare-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

.om-compare-table th,
.om-compare-table td {
  padding: 14px 16px;
  border: 1px solid var(--om-border);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

.om-compare-table th {
  background: var(--om-surface);
  font-weight: 600;
  width: 160px;
}

.om-compare-product {
  text-align: center;
  min-width: 180px;
}

.om-compare-product img {
  width: 120px;
  height: 100px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 8px;
}

.om-compare-product__name {
  font-weight: 600;
  margin-bottom: 6px;
}

/* Favorites reuse catalog grid */
.om-fav-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.om-pinfo__meta a.is-active,
.om-pinfo__meta .om-pinfo__quick.is-active,
.om-catalog-card__fav.is-active {
  color: #dc2626;
}

.om-catalog-card__fav.is-active svg {
  fill: #dc2626;
  stroke: #dc2626;
}

/* Order detail page */
.om-order-page {
  max-width: 1200px;
}

.om-order-page .om-breadcrumbs {
  margin-bottom: 20px;
}

.om-order-page .om-commerce-card {
  padding: 24px;
}

.om-order-page .om-cab-table-wrap {
  border-radius: 10px;
}

.om-order-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.om-order-head__title {
  font-size: 28px;
  font-weight: 800;
  margin: 0 0 6px;
}

.om-order-head__meta {
  margin: 0;
  color: var(--om-muted);
  font-size: 14px;
}

.om-order-head__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.om-order-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
  align-items: start;
}

.om-order-section {
  margin-bottom: 0;
}

.om-order-layout .om-order-section + .om-order-section,
.om-order-side .om-order-section + .om-order-section {
  margin-top: 0;
}

.om-order-section__title {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 16px;
}

.om-order-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.om-order-item__img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

.om-order-item__name {
  font-weight: 600;
  color: var(--om-text);
  text-decoration: none;
}

.om-order-item__name:hover {
  color: var(--om-primary);
}

.om-order-item__meta {
  font-size: 12px;
  color: var(--om-muted);
  margin-top: 4px;
}

.om-order-table tfoot td {
  border-top: 2px solid var(--om-border);
  padding-top: 14px;
}

.om-order-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}

.om-order-timeline__item {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 14px;
  padding-bottom: 22px;
  position: relative;
}

.om-order-timeline__item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 24px;
  bottom: 0;
  width: 2px;
  background: var(--om-border);
  border-radius: 1px;
}

.om-order-timeline__item--done:not(:last-child)::before {
  background: linear-gradient(180deg, var(--om-blue) 0%, #93c5fd 100%);
}

.om-order-timeline__item--current:not(:last-child)::before {
  background: linear-gradient(180deg, var(--om-blue) 0%, var(--om-border) 100%);
}

.om-order-timeline__dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--om-surface);
  border: 2px solid var(--om-border);
  margin-top: 0;
  box-sizing: border-box;
  position: relative;
  z-index: 1;
}

.om-order-timeline__item--done .om-order-timeline__dot {
  border: none;
  background: linear-gradient(135deg, var(--om-blue) 0%, var(--om-blue-dark) 100%);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.16);
}

.om-order-timeline__item--done .om-order-timeline__dot::after {
  content: '';
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
}

.om-order-timeline__item--current .om-order-timeline__dot {
  border: none;
  background: linear-gradient(135deg, #60a5fa 0%, var(--om-blue) 45%, var(--om-blue-dark) 100%);
  box-shadow:
    0 0 0 4px rgba(37, 99, 235, 0.2),
    0 4px 12px rgba(37, 99, 235, 0.28);
  animation: om-timeline-pulse 2.4s ease-in-out infinite;
}

.om-order-timeline__item--current .om-order-timeline__top strong {
  color: var(--om-blue);
}

.om-order-timeline__item--pending .om-order-timeline__dot {
  background: #fff;
  border-color: #dbeafe;
}

@keyframes om-timeline-pulse {
  0%, 100% {
    box-shadow:
      0 0 0 4px rgba(37, 99, 235, 0.2),
      0 4px 12px rgba(37, 99, 235, 0.28);
  }
  50% {
    box-shadow:
      0 0 0 7px rgba(37, 99, 235, 0.12),
      0 4px 16px rgba(37, 99, 235, 0.35);
  }
}

.om-order-timeline__top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
  font-size: 14px;
}

.om-order-timeline__top span {
  color: var(--om-muted);
  white-space: nowrap;
}

.om-order-timeline__body p {
  margin: 0;
  font-size: 13px;
  color: var(--om-muted);
  line-height: 1.5;
}

.om-order-docs {
  list-style: none;
  margin: 0;
  padding: 0;
}

.om-order-doc {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--om-border);
  border-radius: 10px;
  background: var(--om-surface);
  font: inherit;
  cursor: pointer;
  margin-bottom: 8px;
  text-align: left;
}

.om-order-doc span {
  font-size: 11px;
  font-weight: 700;
  color: var(--om-primary);
  text-transform: uppercase;
}

.om-order-docs__empty {
  color: var(--om-muted);
  font-size: 14px;
}

.om-order-dl {
  margin: 0;
  font-size: 14px;
}

.om-order-dl dt {
  color: var(--om-muted);
  font-size: 12px;
  margin-top: 12px;
}

.om-order-dl dt:first-child {
  margin-top: 0;
}

.om-order-dl dd {
  margin: 4px 0 0;
}

.om-order-side .om-order-section {
  margin-bottom: 20px;
}

.om-order-side .om-order-section:last-child {
  margin-bottom: 0;
}

.om-order-main .om-order-section {
  margin-bottom: 20px;
}

.om-order-main .om-order-section:last-child {
  margin-bottom: 0;
}

.om-order-side__value {
  margin: 0 0 8px;
}

.om-order-side .om-cabinet-side__link {
  display: inline-block;
  margin-top: 4px;
}

.om-order-chat__lead {
  font-size: 13px;
  color: var(--om-muted);
  margin: -8px 0 14px;
}

.om-order-chat__messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 320px;
  overflow-y: auto;
  padding: 16px;
  margin-bottom: 14px;
  background: var(--om-surface);
  border-radius: var(--om-radius);
  border: 1px solid var(--om-border);
}

.om-order-chat__empty {
  margin: 0;
  font-size: 14px;
  color: var(--om-muted);
  text-align: center;
  padding: 24px 12px;
}

.om-order-chat__compose {
  margin-top: 0;
}

.om-order-status-select {
  min-width: 140px;
}

.om-order-dl__hint {
  font-size: 12px;
  color: var(--om-muted);
  font-weight: 400;
}

@media (max-width: 768px) {
  .om-order-head__actions {
    flex-wrap: wrap;
  }
}

.om-order-empty {
  text-align: center;
  padding: 48px 20px;
}

.om-order-row {
  cursor: pointer;
}

.om-order-row:hover {
  background: rgba(37, 99, 235, 0.04);
}

.om-order-row__link {
  color: inherit;
  text-decoration: none;
}

.om-order-row__link:hover strong {
  color: var(--om-primary);
}

.om-order-row__actions {
  white-space: nowrap;
}

.om-order-row__actions .om-cab-link-btn + .om-cab-link-btn {
  margin-left: 8px;
}

@media (max-width: 1100px) {
  .om-commerce-layout { grid-template-columns: 1fr; }
  .om-order-layout { grid-template-columns: 1fr; }
  .om-fav-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .om-header__tools { gap: 0; }
  .om-header__tool { width: 36px; height: 36px; }
  .om-cart-item { grid-template-columns: 72px 1fr; }
  .om-cart-item__actions { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; }
  .om-checkout-grid { grid-template-columns: 1fr; }
  .om-fav-grid { grid-template-columns: repeat(2, 1fr); }
}
