.orders-page {
  --orders-green: #1faf5b;
  --orders-green-dark: #177943;
  --orders-ink: #18201b;
  --orders-muted: #7b837e;
  --orders-line: #dfe5e1;
  --orders-soft: #f2f7f3;
  min-height: calc(100vh - 88px);
  padding: 28px 0 48px;
  color: var(--orders-ink);
  background: radial-gradient(circle at 8% 8%, rgba(198, 233, 211, 0.58), transparent 28rem), linear-gradient(180deg, #f7faf8 0%, #f1f6f3 100%);
}

body.orders-view { background: #f1f6f3; }
body.orders-view > footer { margin-top: 0 !important; }
.orders-page *, .orders-page *::before, .orders-page *::after { box-sizing: border-box; }
.orders-page__container { max-width: 1180px; }

.orders-layout {
  display: grid;
  grid-template-columns: minmax(230px, 290px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.orders-sidebar { position: sticky; top: 16px; }

.profile-card, .order-card, .orders-empty {
  border: 1px solid rgba(41, 63, 50, 0.1);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 14px 36px rgba(35, 65, 47, 0.08);
}

.profile-card { overflow: hidden; padding: 22px; border-radius: 24px; }

.profile-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--orders-line);
}

.profile-card__eyebrow, .orders-heading__eyebrow {
  display: block;
  margin-bottom: 4px;
  color: var(--orders-green-dark);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.profile-card__title { margin: 0; font-size: 1.35rem; line-height: 1.25; }

.profile-card__id {
  padding: 6px 10px;
  border-radius: 999px;
  color: #526058;
  background: var(--orders-soft);
  font-size: 0.78rem;
  font-weight: 700;
}

.profile-card__details { display: grid; gap: 16px; padding: 20px 0; }
.profile-card__row { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 11px; align-items: center; }

.profile-card__icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  color: var(--orders-green-dark);
  background: #e9f6ed;
}

.profile-card__row div { min-width: 0; }
.profile-card__row strong { display: block; overflow-wrap: anywhere; font-size: 0.95rem; line-height: 1.35; }
.profile-card__label { display: block; margin-bottom: 2px; color: var(--orders-muted); font-size: 0.75rem; }

.profile-card__logout {
  display: flex;
  gap: 9px;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 3px;
  padding: 11px 14px 0;
  border-top: 1px solid var(--orders-line);
  color: #7c817e;
  font-size: 0.84rem;
  text-decoration: none;
}

.profile-card__logout:hover { color: #b33445; }
.profile-card__telegram { margin-bottom: 18px; }

.profile-confirm {
  margin-bottom: 16px;
  padding: 16px;
  border-radius: 16px;
  color: #36523f;
  background: #f0f8f2;
  text-align: center;
}

.profile-confirm p { margin: 0 0 12px; font-size: 0.8rem; line-height: 1.45; }
.profile-card--login { padding: 26px 22px; }
.profile-card__intro { margin: 10px 0 22px; color: var(--orders-muted); font-size: 0.9rem; line-height: 1.5; }
.profile-card__phone { margin-bottom: 14px; }
.orders-content { min-width: 0; }

.orders-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  margin-bottom: 14px;
  padding: 0 6px;
}

.orders-heading h2 { margin: 0; font-size: clamp(1.55rem, 2.3vw, 2rem); line-height: 1.2; }

.orders-heading__count {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid #d5e9dc;
  border-radius: 50%;
  color: var(--orders-green-dark);
  background: #edf8f0;
  font-weight: 700;
}

.orders-list { display: grid; gap: 20px; }
.order-card { overflow: hidden; border-radius: 26px; }

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

.order-card__header h3 { margin: 2px 0 0; font-size: 1.35rem; line-height: 1.25; }
.order-card__date { color: var(--orders-muted); font-size: 0.78rem; }

.order-status {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 8px;
  align-items: center;
  max-width: 48%;
  padding: 8px 13px;
  border: 1px solid #e1e5e2;
  border-radius: 999px;
  color: #4b534e;
  background: #fff;
  box-shadow: 0 4px 12px rgba(29, 47, 36, 0.06);
  font-size: 0.8rem;
  line-height: 1.2;
  text-align: right;
}

.order-status i { display: block; flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: #9ba39e; background: var(--order-status-color, #9ba39e); }
.order-card__body { padding: 24px; }
.order-card__columns { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr); gap: 24px; }
.order-products, .order-receiving { min-width: 0; }

.order-section-title {
  margin: 0 0 13px;
  color: #68716b;
  font-size: 0.77rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.order-products__list { display: grid; gap: 12px; }

.order-product {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 15px;
  min-width: 0;
  padding: 10px;
  border: 1px solid #e6e9e7;
  border-radius: 17px;
  background: #fff;
}

.order-product__image {
  position: relative;
  width: 116px;
  height: 116px;
  overflow: hidden;
  border-radius: 13px;
  background: #eef1ef;
}

.order-product__image .image-bg, .order-product__image .blur-bg { position: absolute; inset: 0; }
.order-product__image .blur-bg { background-position: center; background-size: cover; filter: blur(9px); opacity: 0.38; transform: scale(1.12); }
.order-product__image .image-bg { display: flex; align-items: center; justify-content: center; }
.order-product__image img { position: relative; z-index: 1; display: block; width: 100%; height: 100%; object-fit: contain; }
.order-product__info { display: flex; min-width: 0; flex-direction: column; align-items: flex-start; }

.order-product__name {
  margin: 2px 0 5px;
  color: var(--orders-ink);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.order-product__name:hover { color: var(--orders-green-dark); }
.order-product__quantity, .order-product__options { color: var(--orders-muted); font-size: 0.78rem; line-height: 1.4; }
.order-product__options { display: grid; margin-top: 4px; }
.order-product__price { margin-top: auto; padding-top: 8px; font-size: 0.92rem; }

.receiving-card {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 15px;
  border: 1px solid #e4e9e5;
  border-radius: 17px;
  background: #f9fbfa;
}

.receiving-card__icon {
  display: grid;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 13px;
  color: var(--orders-green-dark);
  background: #e8f5ec;
}

.receiving-card > div:not(.receiving-card__head) { display: grid; }
.receiving-card span:not(.receiving-card__icon):not(.receiving-card__price) { color: var(--orders-muted); font-size: 0.8rem; }
.receiving-card--delivery { display: block; }

.receiving-card__head { display: flex; gap: 10px; align-items: center; padding-bottom: 13px; border-bottom: 1px solid var(--orders-line); }
.receiving-card__price { margin-left: auto; color: #5d665f; font-size: 0.78rem; font-weight: 700; }
.receiving-card__details { display: grid; gap: 10px; margin: 14px 0 0; }
.receiving-card__details > div { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 9px; font-size: 0.78rem; }
.receiving-card__details dt { color: var(--orders-muted); font-weight: 500; }
.receiving-card__details dt i { width: 16px; }
.receiving-card__details dd { margin: 0; overflow-wrap: anywhere; color: var(--orders-ink); font-weight: 600; }
.receiving-card__notes { display: grid; gap: 5px; margin: 14px 0 0; padding: 0; color: #56615a; font-size: 0.75rem; list-style: none; }
.receiving-card__notes li::before { margin-right: 6px; color: var(--orders-green); content: "✓"; }
.receiving-card--muted { color: #68716b; }

.order-extra { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; padding: 11px 14px; border-radius: 13px; color: #526058; background: #f2f5f3; font-size: 0.8rem; }
.order-comment { margin-top: 12px; }
.order-comment > span { color: var(--orders-muted); font-size: 0.74rem; }
.order-comment p { margin: 5px 0 0; padding: 11px 13px; border-radius: 13px; overflow-wrap: anywhere; background: #f5f7f6; font-size: 0.8rem; line-height: 1.45; }

.payment-history { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--orders-line); }
.payment-history__table { overflow: hidden; border: 1px solid #e4e8e5; border-radius: 16px; }
.payment-history__head, .payment-history__row { display: grid; grid-template-columns: 1.15fr 1fr 0.8fr; gap: 12px; align-items: center; padding: 11px 14px; }
.payment-history__head { color: var(--orders-muted); background: #f7f9f8; font-size: 0.73rem; }
.payment-history__row { border-top: 1px solid #e8ebe9; font-size: 0.82rem; }
.payment-history__head span:last-child, .payment-history__row strong { text-align: right; }

.order-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 22px; }
.order-summary > div { display: grid; min-width: 0; gap: 3px; padding: 14px 10px; border-radius: 15px; background: #f7f9f8; text-align: center; }
.order-summary span { color: var(--orders-muted); font-size: 0.7rem; }
.order-summary strong { font-size: 1rem; white-space: nowrap; }
.order-summary__due { color: var(--orders-green-dark); background: #e8f5ed !important; }

.order-actions { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 12px; align-items: stretch; margin-top: 18px; }
.order-cancel, .order-paid { display: flex; align-items: center; justify-content: center; min-height: 52px; border-radius: 15px; font-size: 0.88rem; font-weight: 700; text-align: center; text-decoration: none; }
.order-cancel { border: 1px solid #f0c9ce; color: #b43a49; background: #fff7f8; }
.order-cancel:hover { color: #972b38; background: #ffedef; }
.order-pay { min-width: 0; width: 100%; min-height: 52px; }
.order-pay__form { width: 100%; margin: 0; }
.order-pay__button {
  width: 100%;
  min-height: 52px;
  padding: 11px 18px;
  color: #fff;
  background: linear-gradient(135deg, #2dcc70, #17a952);
  border: 0;
  border-radius: 15px;
  box-shadow: 0 10px 22px rgba(23, 169, 82, 0.2);
  font: inherit;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
  cursor: pointer;
}
.order-pay__button:hover { background: linear-gradient(135deg, #27c469, #139d4b); }
.order-pay__button:active { transform: translateY(1px); }

.order-transfer-section { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--orders-line); }
.order-transfer-section__title { display: flex; align-items: center; margin-bottom: 10px; color: #737b76; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }

.order-transfer-copy {
  display: grid;
  width: 100%;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 13px;
  align-items: center;
  padding: 13px 14px;
  border: 1px solid #e2e7e3;
  border-radius: 17px;
  color: var(--orders-ink);
  background: #fff;
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.order-transfer-copy:hover, .order-transfer-copy.is-copied { border-color: #bfddca; box-shadow: 0 8px 20px rgba(36, 72, 49, 0.09); transform: translateY(-1px); }
.order-transfer-copy:focus-visible, .order-cancel:focus-visible { outline: 3px solid rgba(31, 175, 91, 0.25); outline-offset: 2px; }
.order-transfer-copy__logo { display: grid; width: 48px; height: 48px; place-items: center; border-radius: 14px; background: #f6f8f7; }
.order-transfer-copy__logo svg { width: 30px; height: 30px; }
.order-transfer-copy__text { display: grid; min-width: 0; gap: 2px; }
.order-transfer-copy__text strong { font-size: 0.9rem; }
.order-transfer-copy__text small { overflow: hidden; color: var(--orders-muted); font-size: 0.76rem; text-overflow: ellipsis; white-space: nowrap; }
.order-transfer-copy__action { display: inline-flex; gap: 7px; align-items: center; padding: 9px 11px; border-radius: 12px; color: var(--orders-green-dark); background: #e9f6ed; font-size: 0.76rem; font-weight: 700; }
.order-paid { gap: 8px; margin-top: 18px; color: var(--orders-green-dark); background: #e8f6ed; }

.orders-alert { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; padding: 13px 16px; border: 1px solid; border-radius: 15px; background: #fff; font-size: 0.88rem; font-weight: 700; }
.orders-alert--success { border-color: #bfe3ca; color: #187442; }
.orders-alert--danger { border-color: #efc4ca; color: #a42e3c; }

.orders-empty { display: grid; min-height: 360px; place-items: center; align-content: center; padding: 40px 24px; border-radius: 26px; text-align: center; }
.orders-empty__icon { display: grid; width: 64px; height: 64px; margin-bottom: 14px; place-items: center; border-radius: 50%; color: var(--orders-green-dark); background: #e8f5ec; font-size: 1.45rem; }
.orders-empty h3 { margin: 0; font-size: 1.35rem; }
.orders-empty p { max-width: 390px; margin: 8px 0 20px; color: var(--orders-muted); }

.orders-copy-toast {
  position: fixed;
  z-index: 1090;
  right: 20px;
  bottom: 20px;
  display: flex;
  gap: 10px;
  align-items: center;
  max-width: min(380px, calc(100vw - 28px));
  padding: 13px 16px;
  border: 1px solid #cce5d4;
  border-radius: 15px;
  color: #23663e;
  background: #fff;
  box-shadow: 0 16px 42px rgba(20, 54, 32, 0.18);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  font-size: 0.84rem;
}

.orders-copy-toast.is-visible { opacity: 1; transform: translateY(0); }

@media (max-width: 991.98px) {
  .orders-page { min-height: 100vh; padding: 18px 0 20px; }
  .orders-layout { grid-template-columns: 1fr; }
  .orders-sidebar { position: static; }
  .profile-card__details { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767.98px) {
  .orders-page { padding: 12px 0 20px; }
  .orders-page__container { padding-right: 12px; padding-left: 12px; }
  .orders-layout { gap: 18px; }
  .profile-card { padding: 18px; border-radius: 20px; }
  .profile-card__details { grid-template-columns: 1fr; gap: 13px; padding: 17px 0; }
  .orders-heading { min-height: auto; margin: 0 2px 11px; }
  .orders-heading h2 { font-size: 1.55rem; }
  .order-card { border-radius: 22px; }
  .order-card__header { padding: 18px; }
  .order-card__header h3 { font-size: 1.2rem; }
  .order-status { max-width: 52%; padding: 7px 10px; font-size: 0.74rem; }
  .order-card__body { padding: 18px; }
  .order-card__columns { grid-template-columns: 1fr; gap: 20px; }
  .order-product { grid-template-columns: 96px minmax(0, 1fr); gap: 12px; padding: 8px; border-radius: 15px; }
  .order-product__image { width: 96px; height: 112px; border-radius: 11px; }
  .order-product__name { font-size: 0.92rem; }
  .order-product__price { font-size: 0.84rem; }
  .receiving-card__details > div { grid-template-columns: 67px minmax(0, 1fr); }
  .payment-history__head, .payment-history__row { grid-template-columns: 1.2fr 0.8fr 0.8fr; gap: 7px; padding: 10px; font-size: 0.74rem; }
  .payment-history__head { font-size: 0.66rem; }
  .order-summary { gap: 6px; }
  .order-summary > div { padding: 12px 5px; border-radius: 13px; }
  .order-summary span { font-size: 0.61rem; }
  .order-summary strong { font-size: 0.86rem; }
  .order-actions { grid-template-columns: 1fr; }
  .order-pay { grid-row: 1; }
  .order-cancel { grid-row: 2; min-height: 46px; }
  .order-transfer-copy { grid-template-columns: 44px minmax(0, 1fr) 40px; gap: 10px; padding: 11px; }
  .order-transfer-copy__logo { width: 44px; height: 44px; }
  .order-transfer-copy__text strong { font-size: 0.83rem; }
  .order-transfer-copy__text small { font-size: 0.7rem; }
  .order-transfer-copy__action { display: grid; width: 40px; height: 40px; padding: 0; place-items: center; }
  .order-transfer-copy__action span { display: none; }
  .orders-copy-toast { right: 14px; bottom: 76px; left: 14px; max-width: none; }
}

@media (max-width: 374px) {
  .order-card__header { align-items: flex-start; }
  .order-status { max-width: 47%; }
  .order-product { grid-template-columns: 82px minmax(0, 1fr); }
  .order-product__image { width: 82px; height: 104px; }
  .order-summary strong { font-size: 0.78rem; }
}
