/* ==========================================================================
   Кабинет и вход (inc/auth.php, inc/account.php, woocommerce/myaccount/*, AccountModule).
   Язык оформления заказа: карточки .co-card, поля .co-f с подписью в рамке, галочки .co-check.
   ========================================================================== */

/* класс .co нужен ради стиля полей (.co .co-f), но сам по себе это сетка оформления заказа — здесь она не нужна */
.auth.co, .acc-card.co { display: flex; flex-direction: column; grid-template-columns: none; align-items: stretch; }
.acc-card.co { gap: 14px; }

/* ---------- окно и форма входа ---------- */
.auth-dialog { width: min(460px, calc(100vw - 32px)); }
.auth { display: flex; flex-direction: column; gap: 14px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: var(--radius-btn); background: var(--surface-warm); }
.auth-tab {
	height: 40px; border: 0; border-radius: 11px; background: transparent; font-size: 14px; font-weight: 600; color: var(--text-muted);
	cursor: pointer; transition: background .15s, color .15s, box-shadow .15s;
}
.auth-tab:hover { color: var(--text); }
.auth-tab.is-active { background: var(--surface); color: var(--accent); box-shadow: 0 2px 8px rgba(60, 40, 20, .08); }
.auth-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.auth-step { display: flex; flex-direction: column; gap: 12px; }
.auth-step[hidden] { display: none; }
.auth-hint { display: flex; gap: 8px; align-items: flex-start; margin: -2px 0 0; font-size: 13px; line-height: 1.45; color: var(--text-muted); }
.auth-hint .icon { flex: none; margin-top: 2px; color: var(--brand); }
.auth-consents { display: flex; flex-direction: column; gap: 8px; }
.auth-consents .co-check { font-size: 12.5px; color: var(--text-muted); }
.auth-lead { margin: 0; font-size: 15px; line-height: 1.5; }
.auth-lead b { white-space: nowrap; color: var(--heading); }
.auth-test { margin: 0; padding: 10px 12px; border-radius: 10px; background: #FFF4D6; font-size: 13px; color: #6B4A00; }
.auth-code {
	width: 100%; height: 64px; padding: 0 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--bg-sidebar);
	font-family: var(--font-head); font-size: 32px; font-weight: 600; letter-spacing: .5em; text-align: center; text-indent: .5em; color: var(--heading);
	font-variant-numeric: lining-nums tabular-nums;
}
.auth-code:focus { outline: 0; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px var(--accent-soft); }
.auth-error { margin: 0; padding: 10px 12px; border-radius: 10px; background: #FBE9E5; font-size: 13.5px; line-height: 1.45; color: #9B3A1E; }
.auth-links { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.auth-link { padding: 6px 0; border: 0; background: none; font-size: 13.5px; font-weight: 600; color: var(--accent); cursor: pointer; }
.auth-link:disabled { color: var(--text-muted); font-weight: 500; cursor: default; }
.auth-note { margin: 0; font-size: 13px; line-height: 1.45; text-align: center; color: var(--text-muted); }
.auth .btn.is-loading { opacity: .7; cursor: progress; }

/* в оформлении заказа гостю: «Уже заказывали? Войдите» */
.co-login-hint { margin: 0 0 12px; padding: 12px 16px; border-radius: var(--radius-md); background: var(--brand-soft); font-size: 14px; color: var(--text); }
.co-login-hint a { font-weight: 700; color: var(--accent); text-decoration: underline; }
/* сохранённые адреса над полями адреса */
.co-saved { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.co-saved-label { font-size: 13px; color: var(--text-muted); }
.co-saved-addr {
	max-width: 100%; min-height: 36px; padding: 6px 14px; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--surface);
	font-size: 13.5px; font-weight: 600; color: var(--text); text-align: left; cursor: pointer; transition: border-color .15s, color .15s, background .15s;
}
.co-saved-addr:hover { border-color: var(--accent); color: var(--accent); }
.co-saved-addr.is-active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

/* ---------- страница кабинета ---------- */
.acc-page { max-width: 1120px; padding-top: 16px; } /* заголовок на той же высоте от верхнего меню, что и на главной */
.acc-page .co-title, .auth-dialog .co-title { margin: 0; } /* общие стили контента WooCommerce дают h2 отступ 24px сверху */
.acc { display: grid; grid-template-columns: 264px minmax(0, 1fr); gap: 20px; align-items: start; }
.acc-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.acc-card { gap: 14px; }
.acc-note { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--text-muted); }
.acc-note a { color: var(--accent); text-decoration: underline; }
.acc-empty { margin: 0; font-size: 15px; line-height: 1.55; color: var(--text-muted); }
.acc-card > .btn { align-self: flex-start; }

/* меню */
.acc-nav { position: sticky; top: 16px; gap: 14px; padding: 18px 14px; }
.acc-who { display: flex; align-items: center; gap: 12px; padding: 0 6px 14px; border-bottom: 1px solid var(--border); }
.acc-avatar { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--brand); color: #fff; font-family: var(--font-head); font-size: 20px; font-weight: 600; }
.acc-who-text { display: flex; flex-direction: column; min-width: 0; }
.acc-who-text b { overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.acc-who-text span { font-size: 13px; color: var(--text-muted); white-space: nowrap; }
.acc-nav ul { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; }
.acc-nav-link {
	display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 12px; border-radius: var(--radius-btn);
	font-size: 14.5px; font-weight: 500; color: var(--text); transition: background .15s, color .15s;
}
.acc-nav-link .icon { color: var(--brand); } /* как в боковом меню */
.acc-nav-link:hover { background: var(--surface-warm); }
.acc-nav-link.is-active { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; } /* как активный пункт бокового меню */
.acc-nav-link.is-active .icon { color: var(--brand); }
.acc-nav .woocommerce-MyAccount-navigation-link--customer-logout { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--border); }

/* обзор */
.acc-hello { gap: 14px; }
.acc-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 4px; }
.acc-tile {
	display: flex; flex-direction: column; gap: 4px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-sidebar);
	transition: border-color .15s, transform .15s;
}
.acc-tile .icon { margin-bottom: 6px; color: var(--brand); }
.acc-tile b { font-size: 15px; }
.acc-tile span { font-size: 13px; color: var(--text-muted); }
.acc-tile:hover { border-color: var(--accent); transform: translateY(-1px); }
.acc-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-top: 8px; }
.acc-section-head h2 { font-size: 22px; font-weight: 500; }

/* заказ */
.acc-orders { display: flex; flex-direction: column; gap: 12px; }
.acc-order { gap: 14px; padding-bottom: 20px; }
.acc-order-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.acc-order-num { font-family: var(--font-head); font-size: 19px; font-weight: 600; color: var(--heading); }
.acc-order-num:hover { color: var(--accent); }
.acc-order-date { font-size: 13.5px; color: var(--text-muted); }
.acc-status { margin-left: auto; padding: 4px 12px; border-radius: var(--radius-pill); background: var(--surface-warm); font-size: 12.5px; font-weight: 700; color: var(--text-muted); }
.acc-status.is-processing, .acc-status.is-on-hold { background: #FFF1D6; color: #8A5300; }
.acc-status.is-completed { background: #E5F1E4; color: #2F5B32; }
.acc-status.is-cancelled, .acc-status.is-failed { background: #FBE9E5; color: #9B3A1E; }
.acc-status.is-pending { background: var(--accent-soft); color: var(--accent); }
.acc-order-body { display: flex; gap: 16px; align-items: center; }
.acc-order-thumbs { flex: none; display: flex; align-items: center; }
.acc-order-thumb { width: 52px; height: 52px; border: 2px solid var(--surface); border-radius: 12px; object-fit: cover; box-shadow: 0 2px 6px rgba(60, 40, 20, .1); }
.acc-order-thumb + .acc-order-thumb { margin-left: -14px; }
.acc-order-more { display: grid; place-items: center; width: 40px; height: 40px; margin-left: 6px; border-radius: 50%; background: var(--surface-warm); font-size: 12.5px; font-weight: 700; color: var(--text-muted); }
.acc-order-info { min-width: 0; }
.acc-order-items { margin: 0; font-size: 14.5px; line-height: 1.45; }
.acc-order-meta { margin: 4px 0 0; font-size: 13px; line-height: 1.45; color: var(--text-muted); }
.acc-order-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.acc-order-total { font-family: var(--font-head); font-size: 22px; font-weight: 600; color: var(--heading); font-variant-numeric: lining-nums; }
.acc-order-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.acc-order-btn { height: 40px; padding: 0 16px; }
.acc-pager { display: flex; justify-content: center; gap: 10px; }

/* адреса */
.acc-addr-list { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.acc-addr { display: flex; align-items: center; gap: 12px; padding: 14px 0; }
.acc-addr + .acc-addr { border-top: 1px solid var(--border); }
.acc-addr-ico { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-dark); }
.acc-addr-text { flex: 1; min-width: 0; font-size: 15px; line-height: 1.45; }
.acc-tag { margin-left: 8px; padding: 2px 8px; border-radius: var(--radius-pill); background: var(--surface-warm); font-size: 11.5px; font-weight: 700; color: var(--text-muted); white-space: nowrap; }
.acc-icon-btn { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; color: var(--text-muted); cursor: pointer; }
.acc-icon-btn:hover { background: #FBE9E5; color: #9B3A1E; }

/* бонусы — в разработке */
.acc-soon { align-items: flex-start; }
.acc-soon-ico { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-dark); }
.acc-soon p { margin: 0; font-size: 15px; line-height: 1.6; color: var(--text-muted); max-width: 60ch; }

/* профиль */
.acc-form { display: flex; flex-direction: column; gap: 12px; }
.acc-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.acc-grid-btn { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.acc-grid-btn .btn { height: 52px; }
.co .co-f input[readonly] { background: var(--surface-warm); color: var(--text-muted); cursor: default; }
.acc-actions { display: flex; align-items: center; gap: 14px; }
.acc-msg { font-size: 13.5px; color: #2F5B32; }
.acc-msg.is-error { color: #9B3A1E; }
.acc-msg:empty { display: none; }
.acc-state { display: flex; gap: 8px; align-items: flex-start; margin: 0; font-size: 14.5px; line-height: 1.45; }
.acc-state .icon { flex: none; margin-top: 2px; color: var(--brand); }
.acc-state.is-ok .icon { color: #2F7A3A; }
.acc-flash { margin: 0; padding: 12px 16px; border-radius: var(--radius-md); font-size: 14.5px; font-weight: 600; }
.acc-flash.is-ok { background: #E5F1E4; color: #2F5B32; }
.acc-flash.is-error { background: #FBE9E5; color: #9B3A1E; }

/* вход на странице кабинета (гость) */
.acc-login { display: grid; grid-template-columns: minmax(0, 460px) minmax(0, 1fr); gap: 24px 40px; align-items: start; }
.acc-login-card { gap: 14px; }
.acc-login-perks { display: flex; flex-direction: column; gap: 18px; margin: 24px 0 0; padding: 0; list-style: none; }
.acc-login-perks li { display: flex; align-items: center; gap: 14px; font-size: 16px; }
.acc-login-perks .icon { flex: none; box-sizing: content-box; padding: 12px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-dark); }

/* ---------- адаптив ---------- */
@media (max-width: 1023px) {
	.acc { grid-template-columns: minmax(0, 1fr); }
	.acc-nav { position: static; padding: 12px; }
	.acc-who { padding: 0 4px 12px; }
	.acc-nav ul { flex-direction: row; gap: 6px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
	.acc-nav ul::-webkit-scrollbar { display: none; }
	.acc-nav-link { height: 40px; padding: 0 14px; border: 1px solid var(--border); white-space: nowrap; }
	.acc-nav-link.is-active { border-color: var(--brand-soft); }
	.acc-nav-link .icon { width: 22px; height: 22px; }
	.acc-nav .woocommerce-MyAccount-navigation-link--customer-logout { margin: 0; padding: 0; border: 0; }
	.acc-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.acc-login { grid-template-columns: minmax(0, 1fr); }
	.acc-login-perks { margin: 0; }
}
@media (max-width: 600px) {
	.acc-grid-2, .acc-grid-btn { grid-template-columns: minmax(0, 1fr); }
	.acc-grid-btn .btn { width: 100%; }
	.acc-order-body { flex-direction: column; align-items: flex-start; gap: 10px; }
	.acc-status { margin-left: 0; }
	.acc-order-actions, .acc-order-actions .btn { width: 100%; }
	.acc-order-actions { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
	.acc-tile, .co-saved-addr, .auth-tab { transition: none; }
	.acc-tile:hover { transform: none; }
}
@media (max-width: 760px) { .acc-page { padding-top: 20px; } }
