/**
 * Корзина allboiler — стили под дизайн темы medved
 * (фирменный красный #e5161d, тёмная шапка #0b0d0e).
 */

:root {
	--ab-red: #e5161d;
	--ab-red-hover: #c91117;
	--ab-border: #d7dadd;
	--ab-muted: #717171;
}

/* ------------------------------------------------------------------ */
/* 1. Иконка корзины в шапке (header.php)                              */
/* ------------------------------------------------------------------ */

.medved-site-header__inner .medved-header-cart {
	position: relative;
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	color: #fff;
	text-decoration: none;
	transition: color 150ms;
}

.medved-header-cart svg {
	display: block;
	width: 26px;
	height: 26px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.medved-header-cart:hover,
.medved-header-cart:focus-visible {
	color: var(--ab-red);
}

.medved-cart-badge {
	position: absolute;
	top: 2px;
	right: 0;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	border-radius: 9px;
	background: var(--ab-red);
	color: #fff;
	font-family: Arial, sans-serif;
	font-size: 11px;
	font-weight: 700;
	line-height: 18px;
	text-align: center;
}

/* На главной шапка прозрачная поверх картинки — иконка остаётся белой,
   при открытых мобильных меню тоже. */
.medved-site-header--home .medved-header-cart {
	color: #fff;
}

/* ------------------------------------------------------------------ */
/* 2. Блок «количество + В корзину» в карточках каталога и на странице товара */
/* ------------------------------------------------------------------ */

.ab-cart-buy {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 15px 0 5px;
	flex-wrap: wrap;
}

.ab-cart-buy--center {
	justify-content: center;
}

.ab-cart-buy--left {
	justify-content: flex-start;
}

.ab-qty {
	display: inline-flex;
	align-items: center;
	border: 1px solid var(--ab-border);
	border-radius: 6px;
	background: #fff;
	overflow: hidden;
}

.ab-qty button {
	width: 34px;
	height: 36px;
	padding: 0;
	border: 0;
	background: none;
	font-size: 18px;
	line-height: 1;
	color: #212529;
	cursor: pointer;
}

.ab-qty button:hover {
	color: var(--ab-red);
}

.ab-qty .ab-qty-input {
	width: 42px;
	height: 36px;
	padding: 0;
	border: 0;
	border-left: 1px solid var(--ab-border);
	border-right: 1px solid var(--ab-border);
	text-align: center;
	font-weight: 700;
	font-size: 14px;
	color: #212529;
	outline: none;
	-moz-appearance: textfield;
	pointer-events: none; /* ввод только кнопками, чтобы не сломать сумму */
}

.ab-qty .ab-qty-input::-webkit-outer-spin-button,
.ab-qty .ab-qty-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.ab-cart-add {
	display: inline-block;
	padding: 9px 20px;
	border: 0;
	border-radius: 6px;
	background: var(--ab-red);
	color: #fff !important;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.4;
	text-decoration: none;
	cursor: pointer;
	transition: background 150ms;
}

.ab-cart-add:hover,
.ab-cart-add:focus-visible {
	background: var(--ab-red-hover);
	color: #fff !important;
	text-decoration: none;
}

.ab-cart-add[disabled] {
	opacity: 0.65;
	cursor: wait;
}

/* ------------------------------------------------------------------ */
/* 3. Всплывашка «Товар добавлен в корзину»                            */
/* ------------------------------------------------------------------ */

.ab-cart-toast {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 2000;
	display: flex;
	align-items: flex-start;
	gap: 12px;
	max-width: min(360px, calc(100vw - 32px));
	padding: 16px 18px;
	background: #fff;
	border-radius: 10px;
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
	opacity: 0;
	transform: translateY(12px);
	transition: opacity 200ms, transform 200ms;
}

.ab-cart-toast--show {
	opacity: 1;
	transform: none;
}

.ab-cart-toast__check {
	flex: none;
	width: 26px;
	height: 26px;
	margin-top: 1px;
}

.ab-cart-toast__title {
	margin: 0;
	font-size: 15px;
	font-weight: 700;
	color: #212529;
}

.ab-cart-toast__name {
	margin: 2px 0 0;
	font-size: 13px;
	color: var(--ab-muted);
	max-height: 60px;
	overflow: hidden;
}

.ab-cart-toast__links {
	margin: 10px 0 0;
	display: flex;
	gap: 14px;
	align-items: center;
	flex-wrap: wrap;
}

.ab-cart-toast__links a {
	font-size: 13px;
	font-weight: 700;
	color: var(--ab-red);
	text-decoration: none;
}

.ab-cart-toast__links a:hover {
	text-decoration: underline;
	color: var(--ab-red);
}

.ab-cart-toast__close {
	flex: none;
	margin-left: auto;
	border: 0;
	background: none;
	font-size: 18px;
	line-height: 1;
	color: #a1a3a5;
	cursor: pointer;
	padding: 2px;
}

.ab-cart-toast__close:hover {
	color: #212529;
}

/* ------------------------------------------------------------------ */
/* 4. Страница корзины                                                 */
/* ------------------------------------------------------------------ */

.ab-cart-loading {
	color: var(--ab-muted);
}

.ab-cart-table {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 30px;
}

.ab-cart-table th {
	padding: 10px;
	border-bottom: 2px solid #212529;
	font-size: 14px;
	font-weight: 700;
	text-align: left;
	vertical-align: middle;
}

.ab-cart-table th.ab-col-price,
.ab-cart-table th.ab-col-sum,
.ab-cart-table th.ab-col-remove,
.ab-cart-table th.ab-col-qty {
	text-align: center;
}

.ab-cart-table td {
	padding: 16px 10px;
	border-bottom: 1px solid #e9ecef;
	vertical-align: middle;
	font-size: 15px;
}

.ab-cart-table td.ab-col-sum,
.ab-cart-table td.ab-col-price {
	text-align: center;
	white-space: nowrap;
	font-weight: 700;
}

.ab-cart-table td.ab-col-img {
	width: 92px;
	padding: 16px 0;
	text-align: center;
}

.ab-cart-table td.ab-col-img img {
	max-width: 80px;
	max-height: 80px;
	object-fit: contain;
}

.ab-cart-row__title {
	font-weight: 700;
	color: #212529;
	text-decoration: none;
}

.ab-cart-row__title:hover {
	color: var(--ab-red);
	text-decoration: none;
}

.ab-cart-table del {
	color: #a1a3a5;
	font-weight: 400;
	margin-right: 6px;
}

/* Кол-во в корзине — как в каталоге, но ввод разрешён */
.ab-cart-table .ab-qty .ab-qty-input {
	pointer-events: auto;
}

.ab-cart-remove {
	border: 0;
	background: none;
	padding: 6px 10px;
	font-size: 20px;
	line-height: 1;
	color: #a1a3a5;
	cursor: pointer;
	transition: color 150ms;
}

.ab-cart-remove:hover {
	color: var(--ab-red);
}

.ab-cart-footer {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 18px;
	margin: 10px 0 40px;
}

.ab-cart-total {
	font-size: 20px;
	color: #212529;
}

.ab-cart-total strong {
	font-size: 26px;
	color: #212529;
}

.ab-cart-actions {
	display: flex;
	gap: 14px;
	flex-wrap: wrap;
}

/* Кнопки (в дизайн темы) */
.ab-btn {
	display: inline-block;
	padding: 12px 28px;
	border: 1px solid transparent;
	border-radius: 6px;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.4;
	text-decoration: none;
	cursor: pointer;
	text-align: center;
	transition: background 150ms, color 150ms, border-color 150ms;
}

.ab-btn--primary {
	background: var(--ab-red);
	border-color: var(--ab-red);
	color: #fff !important;
}

.ab-btn--primary:hover,
.ab-btn--primary:focus-visible {
	background: var(--ab-red-hover);
	border-color: var(--ab-red-hover);
	color: #fff !important;
	text-decoration: none;
}

.ab-btn--outline {
	background: #fff;
	border-color: #b6b9bd;
	color: #212529 !important;
}

.ab-btn--outline:hover,
.ab-btn--outline:focus-visible {
	border-color: var(--ab-red);
	color: var(--ab-red) !important;
	text-decoration: none;
}

.ab-cart-error {
	padding: 14px 18px;
	border: 1px solid #f1b0b7;
	background: #f8d7da;
	color: #721c24;
	border-radius: 6px;
	margin-bottom: 24px;
}

.ab-cart-notice {
	padding: 12px 18px;
	border: 1px solid #f5d38f;
	background: #fff8e5;
	color: #7a5b00;
	border-radius: 6px;
	margin-bottom: 24px;
}

/* ------------------------------------------------------------------ */
/* 5. Страница оформления заказа                                        */
/* ------------------------------------------------------------------ */

.ab-checkout {
	max-width: 640px;
}

/* Отступ под кнопкой «Разместить заказ», чтобы форма не прилипала к подвалу */
.ab-checkout-form {
	margin-bottom: 60px;
}

.ab-checkout-summary {
	border: 1px solid #e9ecef;
	border-radius: 8px;
	padding: 20px 24px;
	margin-bottom: 30px;
	background: #fbfbfb;
}

.ab-checkout-summary__title {
	margin: 0 0 14px;
	font-size: 18px;
	font-weight: 700;
}

.ab-checkout-items {
	margin: 0;
	padding: 0;
	list-style: none;
}

.ab-checkout-items li {
	display: flex;
	justify-content: space-between;
	gap: 14px;
	padding: 8px 0;
	border-bottom: 1px solid #e9ecef;
	font-size: 14px;
}

.ab-checkout-items li:last-child {
	border-bottom: 0;
}

.ab-checkout-items__name {
	color: #212529;
}

.ab-checkout-items__name a {
	color: #212529;
	text-decoration: none;
}

.ab-checkout-items__name a:hover {
	color: var(--ab-red);
	text-decoration: none;
}

.ab-checkout-items__sum {
	white-space: nowrap;
	font-weight: 700;
}

.ab-checkout-summary__total {
	margin-top: 14px;
	padding-top: 14px;
	border-top: 2px solid #e9ecef;
	font-size: 16px;
	text-align: right;
}

.ab-checkout-summary__total strong {
	font-size: 22px;
}

.ab-checkout-field {
	margin-bottom: 18px;
}

.ab-checkout-field label {
	display: block;
	margin-bottom: 6px;
	font-weight: 700;
	font-size: 15px;
	color: #212529;
}

.ab-checkout-field .form-control {
	max-width: 480px;
	height: 44px;
	border-color: var(--ab-border);
	border-radius: 6px;
}

.ab-checkout-field textarea.form-control {
	height: auto;
	max-width: 640px;
}

.ab-checkout-field .form-control:focus {
	border-color: var(--ab-red);
	box-shadow: 0 0 0 3px rgba(229, 22, 29, 0.12);
}

.ab-req {
	color: var(--ab-red);
	margin-left: 2px;
}

.ab-checkout-consent label {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	font-weight: 400;
	font-size: 14px;
	color: var(--ab-muted);
}

.ab-checkout-consent input[type="checkbox"] {
	margin-top: 3px;
	accent-color: var(--ab-red);
	width: 16px;
	height: 16px;
	flex: none;
}

.ab-checkout-consent .ab-req {
	color: var(--ab-red);
}

.ab-checkout-error {
	padding: 14px 18px;
	border: 1px solid #f1b0b7;
	background: #f8d7da;
	color: #721c24;
	border-radius: 6px;
	margin-bottom: 24px;
	font-size: 15px;
}

.ab-btn--submit {
	min-width: 220px;
	font-size: 17px;
	padding: 14px 30px;
}

.ab-btn--submit[disabled] {
	opacity: 0.65;
	cursor: wait;
}

/* ------------------------------------------------------------------ */
/* 6. Страница «Заказ оформлен»                                        */
/* ------------------------------------------------------------------ */

.ab-thanks {
	max-width: 640px;
	margin: 0 auto; /* весь блок по центру контейнера, не только текст внутри него */
	text-align: center;
	padding: 30px 0 50px;
}

.ab-thanks__icon {
	margin-bottom: 18px;
}

.ab-thanks__title {
	font-size: 28px;
	font-weight: 700;
	color: #212529;
	margin: 0 0 16px;
}

.ab-thanks__order {
	font-size: 17px;
}

.ab-thanks__order strong {
	color: var(--ab-red);
}

.ab-thanks__text {
	font-size: 15px;
	line-height: 1.6;
	color: #212529;
}

.ab-thanks__text a {
	color: var(--ab-red);
	font-weight: 700;
	text-decoration: none;
}

.ab-thanks__text a:hover {
	text-decoration: underline;
	color: var(--ab-red);
}

.ab-thanks__actions {
	margin-top: 24px;
}

/* ------------------------------------------------------------------ */
/* 7. Адаптив                                                          */
/* ------------------------------------------------------------------ */

@media (max-width: 640px) {
	/* Корзина: таблица превращается в карточки */
	.ab-cart-table,
	.ab-cart-table thead,
	.ab-cart-table tbody,
	.ab-cart-table tr,
	.ab-cart-table td,
	.ab-cart-table th {
		display: block;
	}

	.ab-cart-table thead {
		display: none;
	}

	.ab-cart-table tr {
		position: relative;
		border: 1px solid #e9ecef;
		border-radius: 8px;
		margin-bottom: 14px;
		padding: 12px;
	}

	.ab-cart-table td {
		display: flex;
		justify-content: space-between;
		align-items: center;
		border-bottom: 0;
		padding: 6px 4px;
	}

	.ab-cart-table td::before {
		content: attr(data-label);
		color: var(--ab-muted);
		font-size: 13px;
		margin-right: 12px;
	}

	.ab-cart-table td.ab-col-img {
		padding-top: 0;
	}

	.ab-cart-table td.ab-col-img::before {
		display: none;
	}

	.ab-cart-row__img {
		width: auto;
	}

	.ab-cart-table td.ab-col-remove {
		position: absolute;
		top: 10px;
		right: 8px;
	}

	.ab-cart-footer {
		flex-direction: column;
		align-items: stretch;
	}

	.ab-cart-total {
		text-align: center;
	}

	.ab-cart-actions {
		flex-direction: column;
	}

	.ab-cart-actions .ab-btn {
		width: 100%;
	}

	/* Чек-аут */
	.ab-checkout-field .form-control {
		max-width: 100%;
	}

	.ab-btn--submit {
		width: 100%;
	}

	.ab-cart-toast {
		right: 16px;
		left: 16px;
		bottom: 16px;
		max-width: none;
	}
}
