/* =============================================================
   [cart_items] — список товаров в корзине
   ============================================================= */

.kdc-cart-items {
	width: 100%;
}

.kdc-cart-items__mobile-title,
.kdc-cart-items__menu-toggle,
.kdc-cart-item__mobile-price,
.kdc-cart-totals__summary {
	display: none;
}

.kdc-cart-items__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding-bottom: 16px;
	margin-bottom: 16px;
	font-size: 12px;
	font-weight: 500;
	color: #6D7482;
	border-bottom: 1px solid #CDCDCD;
}

.kdc-cart-items__select-all {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	font-size: 12px;
	color: #6D7482;
	margin: 0;
}

.kdc-cart-items__head-actions {
	display: inline-flex;
	align-items: center;
	gap: 24px;
}

.kdc-cart-items__action {
	background: transparent;
	border: 0;
	padding: 0;
	font-size: 12px;
	font-weight: 500;
	color: #6D7482;
	cursor: pointer;
	transition: color 0.15s ease;
}

.kdc-cart-items__action:hover,
.kdc-cart-items__action:focus {
	color: var(--global-palette2);
	background: transparent;
	box-shadow: none;
}

/* Контейнер-слот: чтобы внутренняя плашка занимала ширину контента, не блока. */
.kdc-cart-items__notice-slot {
	margin-bottom: 12px;
}

.kdc-cart-items__notice-slot[hidden] {
	display: none;
}

/* Универсальный inline-блок с ошибкой/успехом. */
.kdc-cart-notice {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px;
	border-radius: 8px;
	background: #FFE5E5;
	color: var(--global-palette3);
	font-size: 14px;
	max-width: 100%;
}

.kdc-cart-notice svg {
	flex: 0 0 22px;
	display: block;
}

.kdc-cart-notice.is-success {
	background: #E5F7EB;
	color: #17A34B;
}

.kdc-cart-notice.is-success svg path[stroke="#8B0101"] {
	stroke: #17A34B;
}
.kdc-cart-notice.is-success svg path[fill="#8B0101"] {
	fill: #17A34B;
}

.kdc-cart-empty {
	padding: 24px 0;
	color: #6D7482;
	font-size: 14px;
}

/* ── Item row ── */
.kdc-cart-item {
	display: grid;
	grid-template-columns: auto 100px minmax(0, 260px) minmax(150px, 1fr) auto;
	align-items: stretch;
	gap: 24px;
	padding: 10px 10px 16px 10px;
	border-bottom: 1px solid #CDCDCD;
}

.kdc-cart-item__select { align-self: center; }
.kdc-cart-item__thumb  { align-self: center; }

.kdc-cart-item__select {
	display: inline-flex;
	align-items: center;
	margin: 0;
	cursor: pointer;
}

.kdc-cart-item__thumb {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100px;
	height: 100px;
	background-color: #F6F7FB;
	border-radius: 8px;
	overflow: hidden;
}

.kdc-cart-item__thumb .kdc-cart-item__img,
.kdc-cart-item__thumb img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}

.kdc-cart-item__info {
	display: flex;
	flex-direction: column;
	gap: 4px;
	max-width: 260px;
	align-self: start;
}

.kdc-cart-item__sku {
	font-size: 12px;
	font-weight: 500;
	color: #686868;
}

.kdc-cart-item__name {
	font-size: 14px;
	color: var(--global-palette3);
	text-decoration: none;
	line-height: 1.3;
}

.kdc-cart-item__name:hover {
	color: var(--global-palette2);
}

.kdc-cart-item__badge {
	margin-top: 18px; /* 4px (gap above) + 18px ≈ 22px from name */
	align-self: flex-start;
}

.kdc-cart-item__qty {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.kdc-cart-item__unit {
	font-size: 10px;
	color: #6D7482;
}

.kdc-cart-item__total {
	display: flex;
	align-items: stretch;
	justify-content: space-between;
	gap: 24px;
	min-height: 100px; /* высота фотки, чтобы space-between у иконок имел диапазон */
}

.kdc-cart-item__total-price {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	align-self: flex-start;
	gap: 2px;
}

.kdc-cart-item__price-current {
	font-size: 20px;
	font-weight: 600;
	color: var(--global-palette3);
	line-height: 1.1;
}

.kdc-cart-item__price-current .woocommerce-Price-amount {
	font-size: inherit;
	font-weight: inherit;
	color: inherit;
}

.kdc-cart-item__price-old {
	font-size: 12px;
	color: #6D7482;
	text-decoration: line-through;
}

.kdc-cart-item__actions {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	justify-content: space-between;
	align-self: center;
    gap: 22px;
}

.kdc-cart-item__wish.wishlist-icon {
	position: static;
	width: auto;
}

.kdc-cart-item__remove {
	background: transparent;
	border: 0;
	padding: 0;
	color: #6D7482;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: color 0.15s ease;
}

.kdc-cart-item__remove:hover,
.kdc-cart-item__remove:focus {
	color: var(--global-palette2);
	background: transparent;
	box-shadow: none;
}

.kdc-cart-item__remove svg path {
	stroke: currentColor;
}

/* =============================================================
   [cart_totals] — итого, промокод, кнопки
   ============================================================= */

.kdc-cart-totals[hidden] { display: none !important; }

.kdc-cart-totals {
	display: flex;
	flex-direction: column;
	gap: 24px;
	padding: 20px;
	border: 1px solid #EDEDED;
	border-radius: 8px;
}

.kdc-cart-totals__label {
	font-size: 20px;
	font-weight: 600;
	color: var(--global-palette3);
}

.kdc-cart-totals__price {
	margin: 0;
}

.kdc-cart-totals__coupon {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 6px 6px 16px;
	border: 1px solid #CDCDCD;
	border-radius: 8px;
	background: #fff;
	margin-bottom: 0 !important;
}

.kdc-cart-totals__coupon:hover,
.kdc-cart-totals__coupon:focus {
	border-color: #979797;
}

.kdc-cart-totals__coupon-input {
	flex: 1 1 auto;
	border: 0 !important;
	background: transparent !important;
	padding: 4px 0 !important;
	font-size: 14px;
	font-weight: 500;
	color: var(--global-palette3) !important;
	min-width: 0;
	outline: none;
	box-shadow: none !important;
}

.kdc-cart-totals__coupon-input::placeholder {
	color: #6D7482;
	font-weight: 500;
	font-size: 14px;
}

.kdc-cart-totals__coupon-btn {
	flex: 0 0 auto;
	background-color: #FFE5E5;
	color: var(--global-palette3);
	border: 0;
	border-radius: 6px;
	padding: 8px 14px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}

.kdc-cart-totals__coupon-btn:hover,
.kdc-cart-totals__coupon-btn:focus {
	background-color: var(--global-palette2);
	color: #fff;
	box-shadow: none;
}

.kdc-cart-totals__coupon-msg-slot[hidden] {
	display: none;
}

.kdc-cart-totals__actions.is-disabled .btn-add-to-cart,
.kdc-cart-totals__actions.is-disabled .btn-one-click {
	opacity: 0.55;
	cursor: not-allowed;
	pointer-events: none;
}

/* ── [cart_empty_state] ──────────────────────────────────────── */

.kdc-cart-empty-state[hidden] { display: none !important; }

.kdc-cart-empty-state {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 16px;
	text-align: center;
	padding: 40px 16px;
	max-width: 480px;
	margin: 0 auto;
}

.kdc-cart-empty-state__icon svg { display: block; }

.kdc-cart-empty-state__title {
	margin: 0 !important;
}

.kdc-cart-empty-state__text {
	margin: 0 !important;
	font-size: 16px;
	font-weight: 500;
	color: #6D7482;
	line-height: 1.4;
}

.kdc-cart-empty-state__btn {
	margin-top: 0;
	box-shadow: none;
	padding: 12px !important;
}

.kdc-cart-totals__actions {
	display: grid;
	margin-top: 4px;
}

.kdc-cart-totals__actions .btn-add-to-cart,
.kdc-cart-totals__actions .btn-one-click {
	width: 100%;
	border-radius: 10px;
	padding: 12px !important;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	font-size: 14px;
	margin-bottom: 0;
	text-decoration: none;
}

.kdc-cart-totals__actions .btn-one-click {
	background: #fff;
	border: 1px solid #111;
	color: #111;
}

.kdc-cart-totals__actions .btn-add-to-cart:hover,
.kdc-cart-totals__actions .btn-add-to-cart:focus {
	border-color: var(--global-palette2);
	box-shadow: none;
}

.kdc-cart-totals__actions .btn-one-click:hover,
.kdc-cart-totals__actions .btn-one-click:focus {
	border-color: var(--global-palette2);
	background: var(--global-palette2);
	color: var(--global-palette9);
	box-shadow: none;
}

/* =============================================================
   Адаптив
   ============================================================= */

@media (max-width: 900px) {
	.kdc-cart-item {
		grid-template-columns: auto 80px 1fr;
		grid-template-areas:
			"select thumb info"
			"qty    qty   qty"
			"total  total total";
		gap: 12px 16px;
		padding: 12px 8px;
		align-items: center;
	}

	.kdc-cart-item__select { grid-area: select; align-self: start; padding-top: 4px; }
	.kdc-cart-item__thumb {
		grid-area: thumb;
		width: 80px;
		height: 80px;
	}
	.kdc-cart-item__info  { grid-area: info; }
	.kdc-cart-item__qty   {
		grid-area: qty;
		gap: 12px;
	}
	.kdc-cart-item__total {
		grid-area: total;
		min-height: 0;
	}

	.kdc-cart-item__actions {
		flex-direction: row;
		justify-content: flex-end;
		gap: 16px;
		align-self: center;
	}

	.kdc-cart-item__price-current { font-size: 18px; }
}

@media (max-width: 768px) {
	.kdc-cart-item {
		margin-top: 16px;
	}

	.kdc-cart-items__mobile-title {
		display: block;
		margin-bottom: 20px !important;
		font-size: 20px;
	}

	.kdc-cart-items__head {
		position: relative;
		flex-wrap: nowrap;
		gap: 12px;
		padding-bottom: 0;
		margin-bottom: 16px;
		border-bottom: 0;
	}

	.kdc-cart-items__list {
		border-top: 1px solid #CDCDCD;
	}

	.kdc-cart-items__menu-toggle {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 32px;
		height: 32px;
		margin-left: auto;
		padding: 0;
		background: transparent;
		border: 0;
		box-shadow: none;
		cursor: pointer;
	}

	.kdc-cart-items__menu-toggle:hover,
	.kdc-cart-items__menu-toggle:focus {
		background: transparent;
		border: 0;
		box-shadow: none;
	}

	.kdc-cart-items__head-actions {
		position: absolute;
		top: 36px;
		right: 0;
		z-index: 20;
		display: none;
		flex-direction: column;
		align-items: stretch;
		gap: 0;
		min-width: 190px;
		padding: 8px;
		background: #fff;
		border: 1px solid #EDEDED;
		border-radius: 8px;
		box-shadow: 0 10px 28px rgba(17, 24, 39, 0.12);
	}

	.kdc-cart-items__head.is-actions-open .kdc-cart-items__head-actions {
		display: flex;
	}

	.kdc-cart-items__action {
		width: 100%;
		padding: 10px 12px;
		text-align: left;
		border-radius: 6px;
	}

	.kdc-cart-items__action:hover,
	.kdc-cart-items__action:focus {
		background: #F6F7FB;
	}

	.kdc-cart-notice {
		display: flex;
		width: 100%;
		padding: 12px 10px;
	}

	.kdc-cart-item {
		position: relative;
		grid-template-columns: 111px minmax(0, 1fr);
		grid-template-areas:
			"thumb info"
			"actions qty";
		gap: 8px 6px;
		padding: 10px 0;
		align-items: start;
	}

	.kdc-cart-item__select {
		position: absolute;
		top: 10px;
		left: 0;
		z-index: 2;
		grid-area: auto;
		padding: 8px;
	}

	.kdc-cart-item__thumb {
		width: 111px;
		height: 111px;
	}

	.kdc-cart-item__info {
		max-width: none;
		min-height: 111px;
		justify-content: space-between;
		gap: 6px;
		padding-left: 0;
	}

	.kdc-cart-item__sku {
		display: none;
	}

	.kdc-cart-item__name {
		font-size: 13px;
		line-height: 1.2;
	}

	.kdc-cart-item__badge--desktop {
		display: none;
	}

	.kdc-cart-item__mobile-price {
		display: inline-flex;
		flex-wrap: nowrap;
		align-items: center;
		gap: 6px;
		margin-top: 8px;
		white-space: nowrap;
	}

	.kdc-cart-item__mobile-price .kdc-cart-item__price-old {
		font-size: 12px;
		line-height: 1;
	}

	.kdc-cart-item__mobile-price .kdc-cart-item__badge {
		margin-top: 0;
	}

	.kdc-cart-item__qty {
		grid-area: qty;
		align-items: flex-start;
		align-self: center;
		gap: 0;
	}

	.kdc-cart-item__qty .kdc-qty-counter {
		width: 140px;
		min-width: 140px;
		height: 42px;
		background: #E9ECF4;
		border: 0;
		border-radius: 6px;
	}

	.kdc-cart-item__unit {
		display: none;
	}

	.kdc-cart-item__total {
		display: contents;
	}

	.kdc-cart-item__total-price {
		display: none;
	}

	.kdc-cart-item__price-current {
		font-size: 21px;
	}

	.kdc-cart-item__actions {
		grid-area: actions;
		flex-direction: row;
		justify-content: flex-start;
		align-items: center;
		align-self: center;
		gap: 28px;
		min-height: 42px;
		padding-left: 17px;
	}

	.kdc-cart-item__wish.wishlist-icon,
	.kdc-cart-item__remove {
		width: 24px;
		height: 24px;
	}

	.kdc-cart-totals {
		gap: 12px;
		padding: 0;
		border: 0;
		border-radius: 0;
	}

	.kdc-totals-promo-group {
		order: 1;
		gap: 4px;
	}

	.kdc-cart-totals .kdc-cart-totals__rows {
		order: 3;
		gap: 8px;
		padding: 0 0 8px !important;
		border-bottom: 1px solid #CDCDCD;
	}

	.kdc-cart-totals__summary {
		order: 2;
		display: flex;
		flex-direction: column;
		gap: 8px;
		list-style: none;
		margin: 20px 0 0 !important;
		padding: 0 !important;
	}

	.kdc-cart-totals:not(:has(.kdc-cart-totals__rows)) .kdc-cart-totals__summary {
		padding-bottom: 8px !important;
		border-bottom: 1px solid #CDCDCD;
	}

	.kdc-cart-totals__summary-row,
	.kdc-cart-totals__row {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 12px;
		font-size: 14px;
		line-height: 1.2;
	}

	.kdc-cart-totals__summary-label,
	.kdc-cart-totals .kdc-cart-totals__row-label {
		color: #6D7482;
	}

	.kdc-cart-totals__summary-value {
		color: var(--global-palette3);
		font-weight: 500;
		white-space: nowrap;
	}

	.kdc-cart-totals__label {
		order: 4;
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 12px;
		font-size: 14px;
		line-height: 1.2;
	}

	.kdc-cart-totals__price {
		order: 5;
		align-self: flex-end;
		margin-top: -28px;
	}

	.kdc-cart-totals__price .kadence-child-qv__price-current {
		font-size: 16px;
	}

	.kdc-cart-totals__actions {
		position: fixed;
		left: 0;
		right: 0;
		bottom: calc(63px + env(safe-area-inset-bottom));
		z-index: 2147483000;
		display: grid;
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		gap: 8px;
		width: auto;
		margin: 0;
		padding: 8px 16px;
		background: #fff;
		box-shadow: 0 -0.5px 6px 0 rgba(140, 140, 140, 0.15);
	}

	.kdc-cart-totals__actions .btn-add-to-cart,
	.kdc-cart-totals__actions .btn-one-click {
		box-sizing: border-box;
		height: 42px !important;
		min-height: 42px !important;
		max-height: 42px;
		padding: 10px !important;
		border-radius: 7px;
		font-size: 13px;
		line-height: 1.2;
		margin: 0;
		white-space: nowrap;
	}

	.kdc-cart-totals__actions .btn-one-click {
		order: 1;
	}

	.kdc-cart-totals__actions .btn-add-to-cart {
		order: 2;
	}
}
