/* =========================================================
   Celena — личный кабинет посетителя (/account)
   Ядровый стиль, не зависящий от темы. Цвета берём из переменных
   активной темы с фолбэками (commerce --cm-*, default --*),
   поэтому кабинет выглядит согласованно в любой теме.
   ========================================================= */

.acc-container {
  --acc-accent:       var(--cm-accent, var(--accent, #0095e0));
  --acc-accent-hover: var(--cm-accent-hover, var(--accent-2, #00aff0));
  --acc-contrast:     #ffffff;
  --acc-surface:      var(--cm-surface, var(--surface, #ffffff));
  --acc-surface-2:    var(--cm-surface-alt, var(--surface-2, #f7f7f8));
  --acc-bg:           var(--cm-bg, var(--bg, #f4f4f4));
  --acc-text:         var(--cm-text, var(--text, #1d1d1f));
  --acc-muted:        var(--cm-text-muted, var(--text-muted, #707378));
  --acc-border:       var(--cm-border, var(--border, #e8e8e8));
  --acc-radius:       16px;
  --acc-radius-sm:    10px;
  --acc-shadow:       0 2px 10px rgba(15, 18, 25, .06);

  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 20px 48px;
  color: var(--acc-text);
  box-sizing: border-box;
}
.acc-container *,
.acc-container *::before,
.acc-container *::after { box-sizing: border-box; }

.acc-breadcrumbs {
  display: flex; gap: 8px; align-items: center;
  font-size: 13px; color: var(--acc-muted); margin-bottom: 18px;
}
.acc-breadcrumbs a { color: var(--acc-muted); text-decoration: none; }
.acc-breadcrumbs a:hover { color: var(--acc-accent); }

/* ---------- Раскладка: навигация + контент ---------- */
.acc-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 22px;
  align-items: start;
}

/* ---------- Боковая навигация ---------- */
.acc-side {
  background: var(--acc-surface);
  border: 1px solid var(--acc-border);
  border-radius: var(--acc-radius);
  box-shadow: var(--acc-shadow);
  padding: 14px;
  position: sticky;
  top: 16px;
}
.acc-side__user {
  display: flex; align-items: center; gap: 12px;
  padding: 6px 8px 14px;
  border-bottom: 1px solid var(--acc-border);
  margin-bottom: 10px;
}
.acc-side__avatar {
  width: 42px; height: 42px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--acc-accent); color: var(--acc-contrast);
}
.acc-side__meta { overflow: hidden; }
.acc-side__name { display: block; font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-side__email { display: block; font-size: 12px; color: var(--acc-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.acc-nav { display: flex; flex-direction: column; gap: 2px; }
.acc-nav__link {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: var(--acc-radius-sm);
  color: var(--acc-text); text-decoration: none;
  font-size: 14px; font-weight: 500;
  border: 0; background: transparent; width: 100%; text-align: left;
  cursor: pointer; transition: background .15s, color .15s;
}
.acc-nav__link:hover { background: var(--acc-surface-2); color: var(--acc-accent); }
.acc-nav__link.is-active { background: var(--acc-accent); color: var(--acc-contrast); }
.acc-nav__ico { display: inline-flex; flex-shrink: 0; }
.acc-side__logout { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--acc-border); }
.acc-nav__link--logout { color: var(--acc-muted); }
.acc-nav__link--logout:hover { background: var(--acc-surface-2); color: #e02020; }

/* ---------- Основная область ---------- */
.acc-main { min-width: 0; }
.acc-head { margin-bottom: 18px; }
.acc-head__title { margin: 0 0 4px; font-size: 26px; font-weight: 800; letter-spacing: -.01em; }
.acc-head__sub { margin: 0; color: var(--acc-muted); font-size: 14px; }

/* ---------- Карточки на «Обзоре» ---------- */
.acc-cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.acc-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--acc-surface); border: 1px solid var(--acc-border);
  border-radius: var(--acc-radius); padding: 18px 16px;
  text-decoration: none; color: var(--acc-text);
  box-shadow: var(--acc-shadow);
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.acc-card:hover { border-color: var(--acc-accent); transform: translateY(-2px); }
.acc-card__ico {
  width: 42px; height: 42px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 12px; background: var(--acc-surface-2); color: var(--acc-accent);
}
.acc-card__label { font-weight: 600; font-size: 15px; }
.acc-card__arrow { margin-left: auto; color: var(--acc-muted); display: inline-flex; }

/* ---------- Формы / карточка-контейнер ---------- */
.acc-card-box {
  background: var(--acc-surface); border: 1px solid var(--acc-border);
  border-radius: var(--acc-radius); box-shadow: var(--acc-shadow);
  padding: 22px 24px; max-width: 560px;
}
.acc-field { margin-bottom: 16px; }
.acc-field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.acc-field input {
  width: 100%; padding: 11px 13px;
  border: 1px solid var(--acc-border); border-radius: var(--acc-radius-sm);
  background: var(--acc-surface); color: var(--acc-text);
  font-size: 14px; font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.acc-field input:focus {
  outline: none; border-color: var(--acc-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--acc-accent) 18%, transparent);
}
.acc-help { display: block; margin-top: 6px; font-size: 12px; color: var(--acc-muted); }
.acc-check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--acc-muted); margin-bottom: 8px; cursor: pointer; }
.acc-form__actions { margin-top: 18px; display: flex; gap: 10px; }

.acc-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; border-radius: 999px; border: 1px solid transparent;
  font-size: 14px; font-weight: 600; font-family: inherit; cursor: pointer;
  background: var(--acc-surface-2); color: var(--acc-text);
  transition: background .15s, color .15s, border-color .15s;
}
.acc-btn--primary { background: var(--acc-accent); color: var(--acc-contrast); }
.acc-btn--primary:hover { background: var(--acc-accent-hover); }
.acc-btn--block { width: 100%; }

/* ---------- Flash ---------- */
.acc-flashes { margin-bottom: 16px; display: flex; flex-direction: column; gap: 8px; }
.acc-flash {
  padding: 12px 16px; border-radius: var(--acc-radius-sm);
  font-size: 14px; border: 1px solid transparent;
}
.acc-flash--success { background: #e7f6ec; color: #1b7a3d; border-color: #bfe6cd; }
.acc-flash--error   { background: #fdecec; color: #c0291f; border-color: #f5c5c1; }
.acc-flash--info    { background: #e6f3fb; color: #1364a3; border-color: #c2e0f3; }
.acc-flash--warning { background: #fff5e5; color: #9a5b00; border-color: #ffe1b3; }

/* ---------- Auth (вход / регистрация) ---------- */
.acc-container--auth { max-width: 460px; padding-top: 48px; }
.acc-authcard {
  background: var(--acc-surface); border: 1px solid var(--acc-border);
  border-radius: var(--acc-radius); box-shadow: var(--acc-shadow);
  padding: 32px 28px;
}
.acc-auth__title { margin: 0 0 6px; font-size: 24px; font-weight: 800; }
.acc-auth__sub { margin: 0 0 20px; color: var(--acc-muted); font-size: 14px; }
.acc-auth__alt { margin: 18px 0 0; text-align: center; font-size: 14px; color: var(--acc-muted); }
.acc-auth__alt a { color: var(--acc-accent); text-decoration: none; font-weight: 600; }
.acc-auth__alt a:hover { opacity: .8; }

/* ---------- Пустое состояние ---------- */
.acc-empty {
  background: var(--acc-surface); border: 1px dashed var(--acc-border);
  border-radius: var(--acc-radius); padding: 40px 24px; text-align: center;
  color: var(--acc-muted);
}
.acc-empty p { margin: 0 0 14px; }

/* ---------- Заказы (список) — магазин ---------- */
.acc-orders { display: flex; flex-direction: column; gap: 10px; }
.acc-order {
  display: flex; align-items: center; gap: 16px;
  background: var(--acc-surface); border: 1px solid var(--acc-border);
  border-radius: var(--acc-radius); box-shadow: var(--acc-shadow);
  padding: 14px 18px; text-decoration: none; color: var(--acc-text);
  transition: border-color .15s, transform .15s;
}
.acc-order:hover { border-color: var(--acc-accent); transform: translateY(-1px); }
.acc-order__main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.acc-order__num { font-weight: 700; font-size: 15px; }
.acc-order__date { font-size: 12px; color: var(--acc-muted); }
.acc-order__total { margin-left: auto; font-weight: 700; white-space: nowrap; }
.acc-order__arrow { color: var(--acc-muted); display: inline-flex; }

/* ---------- Бейдж статуса ---------- */
.acc-status {
  display: inline-flex; align-items: center;
  padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
  background: var(--acc-surface-2); color: var(--acc-muted);
}
.acc-status--new       { background: #e6f3fb; color: #1364a3; }
.acc-status--paid      { background: #e7f6ec; color: #1b7a3d; }
.acc-status--shipped   { background: #ede9fe; color: #5b46c9; }
.acc-status--delivered { background: #e7f6ec; color: #137a3d; }
.acc-status--cancelled { background: #fdecec; color: #c0291f; }

/* ---------- Детали заказа ---------- */
.acc-items { width: 100%; border-collapse: collapse; font-size: 14px; }
.acc-items th, .acc-items td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--acc-border); vertical-align: top; }
.acc-items th { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--acc-muted); font-weight: 600; }
.acc-items td:nth-child(2), .acc-items td:nth-child(3), .acc-items td:nth-child(4),
.acc-items th:nth-child(2), .acc-items th:nth-child(3), .acc-items th:nth-child(4) { text-align: right; white-space: nowrap; }
.acc-items__title { display: block; font-weight: 500; }
.acc-items__sku { display: block; font-size: 12px; color: var(--acc-muted); }
.acc-order-total { margin-top: 14px; text-align: right; font-size: 16px; }
.acc-order-total b { font-size: 19px; }
.acc-subhead { margin: 0 0 10px; font-size: 15px; font-weight: 700; }
.acc-recipient { margin-top: 16px; }
.acc-recipient p { margin: 0 0 4px; }
.acc-muted { color: var(--acc-muted); font-size: 13px; }

/* ---------- Избранное ---------- */
.acc-fav__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.acc-fav__card {
  position: relative; display: flex; flex-direction: column;
  background: var(--acc-surface); border: 1px solid var(--acc-border);
  border-radius: var(--acc-radius); box-shadow: var(--acc-shadow);
  padding: 12px; transition: border-color .15s, transform .15s;
}
.acc-fav__card:hover { border-color: var(--acc-accent); transform: translateY(-2px); }
.acc-fav__img { display: block; aspect-ratio: 1 / 1; border-radius: var(--acc-radius-sm); overflow: hidden; background: var(--acc-surface-2); margin-bottom: 10px; }
.acc-fav__img img { width: 100%; height: 100%; object-fit: contain; }
.acc-fav__noimg { display: block; width: 100%; height: 100%; }
.acc-fav__title { font-size: 13px; font-weight: 500; color: var(--acc-text); text-decoration: none; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.acc-fav__title:hover { color: var(--acc-accent); }
.acc-fav__price { margin-top: 8px; font-weight: 700; }
.acc-fav__del {
  position: absolute; top: 8px; right: 8px;
  width: 26px; height: 26px; border-radius: 50%;
  border: 1px solid var(--acc-border); background: var(--acc-surface);
  color: var(--acc-muted); font-size: 16px; line-height: 1; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s, border-color .15s;
}
.acc-fav__del:hover { background: #fdecec; color: #c0291f; border-color: #f5c5c1; }

/* ---------- Форма адресов: 2 колонки ---------- */
.acc-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }

/* ---------- Адаптив ---------- */
@media (max-width: 760px) {
  .acc-layout { grid-template-columns: 1fr; }
  .acc-side { position: static; }
  .acc-nav { flex-direction: row; flex-wrap: wrap; }
  .acc-nav__link { flex: 1 1 auto; justify-content: center; }
  .acc-head__title { font-size: 22px; }
  .acc-grid2 { grid-template-columns: 1fr; }
  .acc-order { flex-wrap: wrap; }
  .acc-order__total { margin-left: 0; }
}
