/* ==========================================================================
   profile.css — оформление личного кабинета
   (вкладки «Мои данные», «Настройки», «Заказы»)

   Подключение на страницах профиля:
   <link rel="stylesheet" href="/css/profile.css">

   Все правила действуют только внутри <section class="article">,
   где есть блок .main__services.profile, — остальные страницы сайта
   файл не затрагивает.
   Цвета и отступы меняются в переменных ниже (блок «Переменные»).
   ========================================================================== */

/* ---------- Переменные ---------- */
.article:has(.main__services.profile) {
	--pr-accent: #86a53c;               /* основной цвет (кнопки, активный пункт меню) */
	--pr-accent-dark: #6f8a2e;          /* цвет при наведении */
	--pr-text: #2b2f36;                 /* основной текст */
	--pr-muted: #8a9099;                /* приглушённый текст */
	--pr-border: #e6e8eb;               /* линии и рамки */
	--pr-card: #ffffff;                 /* фон карточек */
	--pr-page: #f4f5f7;                 /* фон страницы */
	--pr-danger: #d9534f;               /* красный (выход, обязательные поля) */
	--pr-radius: 12px;
	--pr-shadow: 0 2px 12px rgba(30, 35, 40, .07);

	background: var(--pr-page);
	padding: 24px 0 48px;
	color: var(--pr-text);
	font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- «Хлебные крошки» ---------- */
.article:has(.main__services.profile) .container-products__breadcrumbs {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	margin: 0 0 20px;
	font-size: 14px;
}
.article:has(.main__services.profile) .container-products__breadcrumbs a {
	color: var(--pr-accent);
	text-decoration: none;
}
.article:has(.main__services.profile) .container-products__breadcrumbs a:hover {
	text-decoration: underline;
}
.article:has(.main__services.profile) .container-products__breadcrumbs a::after {
	content: "/";
	margin: 0 8px;
	color: #c4c9cf;
}
.article:has(.main__services.profile) .container-products__breadcrumbs span {
	color: var(--pr-muted);
}

/* ---------- Каркас: меню слева, контент справа ---------- */
.article:has(.main__services.profile) .container-products--list {
	display: grid;
	grid-template-columns: 250px minmax(0, 1fr);
	gap: 24px;
	align-items: start;
}
.article:has(.main__services.profile) .container-products__content-right {
	min-width: 0; /* чтобы контент не растягивал сетку */
}

/* ---------- Боковое меню ---------- */
.article:has(.main__services.profile) .container-products__content-left .shop__details-description {
	background: var(--pr-card);
	border: 1px solid var(--pr-border);
	border-radius: var(--pr-radius);
	box-shadow: var(--pr-shadow);
	padding: 10px;
}
.article:has(.main__services.profile) .main-nav__links {
	display: flex;
	flex-direction: column;
	gap: 4px;
}
.article:has(.main__services.profile) .main-nav__link a {
	display: block;
	padding: 12px 16px;
	border-radius: 8px;
	font-size: 15px;
	color: var(--pr-text);
	text-decoration: none;
	transition: background .15s ease, color .15s ease;
}
.article:has(.main__services.profile) .main-nav__link a:hover {
	background: #f0f3e4;
	color: var(--pr-accent-dark);
}
.article:has(.main__services.profile) .main-nav__link_active a,
.article:has(.main__services.profile) .main-nav__link_active a:hover {
	background: var(--pr-accent);
	color: #fff;
	font-weight: 600;
}
/* Кнопка «Выйти» */
.article:has(.main__services.profile) .main-nav__link.logout {
	margin-top: 6px;
	padding-top: 6px;
	border-top: 1px solid var(--pr-border);
}
.article:has(.main__services.profile) .main-nav__link.logout a {
	color: var(--pr-danger);
}
.article:has(.main__services.profile) .main-nav__link.logout a:hover {
	background: #fbeaea;
	color: #b23b37;
}

/* ---------- Карточка контента ---------- */
.article:has(.main__services.profile) .main__services.profile {
	background: var(--pr-card);
	border: 1px solid var(--pr-border);
	border-radius: var(--pr-radius);
	box-shadow: var(--pr-shadow);
	padding: 28px 32px 32px;
}
.article:has(.main__services.profile) .shop__details-name {
	margin: 0 0 18px;
	font-size: 26px;
	font-weight: 700;
	line-height: 1.25;
}

/* ---------- Таблица «Мои данные» ---------- */
.article:has(.main__services.profile) .main__services.profile table {
	width: 100%;
	border-collapse: collapse;
	font-size: 16px;
}
.article:has(.main__services.profile) .main__services.profile td {
	padding: 12px 8px;
	vertical-align: top;
}
.article:has(.main__services.profile) .main__services.profile td:has(.liner) {
	padding: 2px 8px;
}
.article:has(.main__services.profile) .main__services.profile .t_left {
	color: var(--pr-muted);
	white-space: nowrap;
}
.article:has(.main__services.profile) .main__services.profile .liner {
	height: 1px;
	background: var(--pr-border);
}

/* ---------- Предупреждение (например, об автоматическом пароле) ----------
   Можно выводить прямо на странице вместо/вместе с popup-окном:
   <div class="profile__warning"><b>Внимание!</b> Текст предупреждения</div> */
.article:has(.main__services.profile) .profile__warning {
	margin: 0 0 20px;
	padding: 14px 16px;
	font-size: 14px;
	line-height: 1.5;
	color: #8a6d1a;
	background: #fdf6e0;
	border: 1px solid #f0dfae;
	border-left: 4px solid #e9c46a;
	border-radius: 8px;
}

/* ---------- Форма «Настройки» ---------- */
.article:has(.main__services.profile) .profile__form .form__section {
	margin-bottom: 8px;
}
.article:has(.main__services.profile) .profile__form .form__line {
	margin-bottom: 16px;
}
.article:has(.main__services.profile) .profile__form .form__row {
	display: flex;
	flex-direction: column;
	gap: 6px;
	max-width: 420px;
}
.article:has(.main__services.profile) .profile__form .form__label {
	font-size: 14px;
	font-weight: 600;
}
.article:has(.main__services.profile) .profile__form .form__label span {
	color: var(--pr-danger);
}

/* Поля ввода */
.article:has(.main__services.profile) .profile__form .inps {
	width: 100%;
	box-sizing: border-box;
	padding: 11px 14px;
	font-size: 15px;
	color: var(--pr-text);
	background: #fff;
	border: 1px solid var(--pr-border);
	border-radius: 8px;
	transition: border-color .15s ease, box-shadow .15s ease;
}
.article:has(.main__services.profile) .profile__form .inps:focus {
	outline: none;
	border-color: var(--pr-accent);
	box-shadow: 0 0 0 3px rgba(134, 165, 60, .18);
}

/* Чекбокс подписки */
.article:has(.main__services.profile) .form-checkbox {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 4px 0 18px;
	cursor: pointer;
	user-select: none;
}
.article:has(.main__services.profile) .form-checkbox input {
	position: absolute;
	width: 0;
	height: 0;
	opacity: 0;
}
.article:has(.main__services.profile) .form-checkbox__checkmark {
	position: relative;
	flex: 0 0 auto;
	width: 20px;
	height: 20px;
	background: #fff;
	border: 2px solid #c9ced4;
	border-radius: 6px;
	transition: background .15s ease, border-color .15s ease;
}
.article:has(.main__services.profile) .form-checkbox__checkmark::after {
	content: "";
	position: absolute;
	left: 5px;
	top: 1px;
	width: 5px;
	height: 10px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg) scale(0);
	transition: transform .15s ease;
}
.article:has(.main__services.profile) .form-checkbox input:checked ~ .form-checkbox__checkmark {
	background: var(--pr-accent);
	border-color: var(--pr-accent);
}
.article:has(.main__services.profile) .form-checkbox input:checked ~ .form-checkbox__checkmark::after {
	transform: rotate(45deg) scale(1);
}
.article:has(.main__services.profile) .form-checkbox__body {
	font-size: 14px;
}

/* Кнопка «Сохранить» */
.article:has(.main__services.profile) .form__button .btn {
	display: inline-block;
	padding: 12px 28px;
	font-size: 15px;
	font-weight: 600;
	color: #fff;
	background: var(--pr-accent);
	border: none;
	border-radius: 8px;
	cursor: pointer;
	transition: background .15s ease, transform .1s ease;
}
.article:has(.main__services.profile) .form__button .btn:hover {
	background: var(--pr-accent-dark);
}
.article:has(.main__services.profile) .form__button .btn:active {
	transform: translateY(1px);
}

/* ---------- Адаптив: планшет и телефон ---------- */
@media (max-width: 820px) {
	.article:has(.main__services.profile) .container-products--list {
		grid-template-columns: 1fr;
	}
	.article:has(.main__services.profile) .main-nav__links {
		flex-direction: row;
		flex-wrap: wrap;
	}
	.article:has(.main__services.profile) .main-nav__link.logout {
		margin-top: 0;
		padding-top: 0;
		border-top: none;
	}
	.article:has(.main__services.profile) .main__services.profile {
		padding: 20px;
	}
}


/* ==========================================================================
   Вкладка «Заказы» и страница деталей заказа
   ========================================================================== */

/* ---------- Список заказов (.orders-spisok) ---------- */
.article:has(.main__services.profile) .orders-spisok {
	margin: 0 0 16px;
	padding: 18px 20px;
	background: var(--pr-card);
	border: 1px solid var(--pr-border);
	border-radius: var(--pr-radius);
	font-size: 15px;
	line-height: 1.7;
	color: var(--pr-text);
	transition: border-color .15s ease, box-shadow .15s ease;
}
.article:has(.main__services.profile) .orders-spisok:hover {
	border-color: #d7dcc8;
	box-shadow: var(--pr-shadow);
}

/* Номер заказа — плашка слева (инлайн-стили переопределяются) */
.article:has(.main__services.profile) .orders-spisok > div:first-child {
	min-width: 58px;
	padding: 12px 10px !important;
	margin: 0 16px 10px 0 !important;
	border: none !important;
	border-radius: 10px;
	background: var(--pr-accent);
	text-align: center;
}
.article:has(.main__services.profile) .orders-spisok > div:first-child a {
	color: #fff !important;
	font-size: 20px !important;
	font-weight: 700;
	text-decoration: none;
}

/* Имя покупателя */
.article:has(.main__services.profile) .orders-spisok font {
	font-size: 16px !important;
	font-weight: 600;
}

/* Ссылка «Подробнее о заказе» — кнопка */
.article:has(.main__services.profile) .orders-spisok .morea {
	display: inline-block;
	margin: 8px 0 2px 6px;
	padding: 9px 18px;
	background: var(--pr-accent);
	border-radius: 8px;
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	transition: background .15s ease, transform .1s ease;
}
.article:has(.main__services.profile) .orders-spisok .morea:hover {
	background: var(--pr-accent-dark);
}
.article:has(.main__services.profile) .orders-spisok .morea:active {
	transform: translateY(1px);
}

/* Статус заказа — бейдж */
.article:has(.main__services.profile) .orders-spisok p {
	margin: 12px 0 0;
	padding-top: 0 !important;
	font-size: 14px;
	color: var(--pr-muted);
}
.article:has(.main__services.profile) .orders-spisok p span {
	display: inline-block;
	padding: 4px 12px;
	border-radius: 20px;
	background: #fdecec;
	color: #be1116 !important;
	font-size: 13px;
	font-weight: 600 !important;
}

/* Ссылка «удалить» */
.article:has(.main__services.profile) .orders-spisok form {
	margin: 10px 0 0;
}
.article:has(.main__services.profile) .orders-spisok form .button {
	font-size: 13px;
}

/* ---------- Ссылка «Вернуться назад» ---------- */
.article:has(.main__services.profile) .cart-buttons-back {
	margin: 0 0 18px;
}
.article:has(.main__services.profile) .cart-buttons-back a {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: var(--pr-muted);
	font-size: 14px;
	text-decoration: none;
	transition: color .15s ease;
}
.article:has(.main__services.profile) .cart-buttons-back a::before {
	content: "\2190"; /* ← */
	font-size: 16px;
	line-height: 1;
}
.article:has(.main__services.profile) .cart-buttons-back a:hover {
	color: var(--pr-accent-dark);
}

/* ---------- Детали заказа: таблицы (инлайн-стили нужно убрать) ---------- */
/* Общий вид всех таблиц с шапкой внутри карточки заказа */
.article:has(.main__services.profile) .main__services.profile > table:has(thead) {
	width: 100%;
	border-collapse: separate;
	border-spacing: 0;
	margin: 0 0 24px;
	background: var(--pr-card);
	border: 1px solid var(--pr-border);
	border-radius: 10px;
	overflow: hidden;
	font-size: 14px;
}
/* Шапка таблицы («Детализация заказа», «Адрес доставки», «Товар…») */
.article:has(.main__services.profile) .main__services.profile > table:has(thead) > thead td {
	padding: 12px 16px;
	background: #f0f3e4;
	border-bottom: 1px solid var(--pr-border);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .4px;
	text-transform: uppercase;
	color: var(--pr-text);
}
/* Ячейки тела таблицы */
.article:has(.main__services.profile) .main__services.profile > table:has(thead) > tbody > tr > td {
	padding: 14px 16px;
	vertical-align: top;
	line-height: 1.65;
	border-bottom: 1px solid var(--pr-border);
}
.article:has(.main__services.profile) .main__services.profile > table:has(thead) > tbody > tr:last-child > td {
	border-bottom: none;
}
/* Таблица «Детализация заказа»: две колонки пополам + разделитель */
.article:has(.main__services.profile) .main__services.profile > table:has(> thead td[colspan="2"]) > tbody > tr > td {
	width: 50%;
}
.article:has(.main__services.profile) .main__services.profile > table:has(> thead td[colspan="2"]) > tbody > tr > td + td {
	border-left: 1px solid var(--pr-border);
}
/* Вложенная таблица (Статус / Имя / Телефон / Email) — без рамок */
.article:has(.main__services.profile) .main__services.profile table table {
	width: 100%;
	margin: 0;
	border-collapse: collapse;
	font-size: 14px;
}
.article:has(.main__services.profile) .main__services.profile table table td {
	padding: 3px 12px 3px 0;
	vertical-align: top;
}
.article:has(.main__services.profile) .main__services.profile table table td:first-child:not([colspan]) {
	width: 90px;
	white-space: nowrap;
	color: var(--pr-muted);
}
/* Таблица товаров: ширины и выравнивание колонок */
.article:has(.main__services.profile) .main__services.profile > table:has(tfoot) > thead td:nth-child(-n+2) {
	width: 28%;
}
.article:has(.main__services.profile) .main__services.profile > table:has(tfoot) td:nth-child(n+3) {
	text-align: right;
	white-space: nowrap;
}
/* Итог («Сумма») */
.article:has(.main__services.profile) .main__services.profile > table:has(tfoot) > tfoot > tr > td {
	padding: 12px 16px;
	text-align: right;
	border-top: 1px solid var(--pr-border);
}
.article:has(.main__services.profile) .main__services.profile > table:has(tfoot) > tfoot > tr:first-child > td {
	background: #f6f8ee;
	font-size: 17px;
	font-weight: 700;
	color: var(--pr-accent-dark);
}
/* Пустая строка-разделитель в подвале (colspan="5") — тонкий отступ */
.article:has(.main__services.profile) .main__services.profile > table:has(tfoot) > tfoot > tr > td:only-child {
	padding: 6px;
	border-top: none;
}
/* Если пустая строка с colspan="5" вообще не нужна, удалите её из вёрстки
   или раскомментируйте правило ниже: */
/*
.article:has(.main__services.profile) .main__services.profile > table:has(tfoot) > tfoot > tr:has(> td:only-child[colspan="5"]) {
	display: none;
}
*/

/* ---------- Адаптив для страниц заказов ---------- */
@media (max-width: 640px) {
	/* «Детализация заказа»: колонки друг под другом */
	.article:has(.main__services.profile) .main__services.profile > table:has(> thead td[colspan="2"]) > tbody > tr > td {
		display: block;
		width: auto;
	}
	.article:has(.main__services.profile) .main__services.profile > table:has(> thead td[colspan="2"]) > tbody > tr > td + td {
		border-left: none;
	}
	/* Таблица товаров: горизонтальная прокрутка */
	.article:has(.main__services.profile) .main__services.profile > table:has(tfoot) {
		display: block;
		overflow-x: auto;
	}
	.article:has(.main__services.profile) .orders-spisok > div:first-child {
		min-width: 48px;
		padding: 10px 8px !important;
	}
}
