/* ============================================================
   КОШИК: тост після «Купити», модалка кошика, сторінка кошика,
   зведення на checkout.
   ============================================================ */

/* Сторінка кошика — мініатюра в таблиці */
.cart-page-product-inner {
	display: flex;
	align-items: center;
	gap: 0.65rem;
}
.cart-page-thumb {
	width: 48px;
	height: 48px;
	object-fit: contain;
	flex-shrink: 0;
	background: #f5f5f5;
	border-radius: 4px;
}
.cart-summary-table {
	width: 100%;
	border-collapse: collapse;
	margin: 1rem 0;
}
.cart-summary-table th,
.cart-summary-table td {
	border: 1px solid #e5e5e5;
	padding: 0.5rem 0.65rem;
	text-align: left;
}

/* Тост після додавання в кошик */
.estore-cart-toast {
	position: fixed;
	bottom: 1.25rem;
	right: 1.25rem;
	z-index: 10070;
	max-width: min(22rem, calc(100vw - 2rem));
	animation: estore-cart-toast-in 0.22s ease-out;
}
@keyframes estore-cart-toast-in {
	from {
		transform: translateY(0.5rem);
		opacity: 0;
	}
	to {
		transform: translateY(0);
		opacity: 1;
	}
}
.estore-cart-toast__inner {
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 10px 36px rgba(0, 0, 0, 0.2);
	padding: 1rem 1.1rem;
	border: 1px solid #e8e8e8;
}
.estore-cart-toast__product {
	margin: 0 0 0.35rem;
	font-size: 0.9rem;
	font-weight: 600;
	line-height: 1.35;
	color: #1a1a1a;
}
.estore-cart-toast__msg {
	margin: 0 0 0.65rem;
	font-size: 0.85rem;
	color: #555;
}
.estore-cart-toast__btn {
	margin: 0;
}

/* Модальне вікно кошика */
.estore-cart-shell {
	position: fixed;
	inset: 0;
	z-index: 10060;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
}
.estore-cart-shell__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.5);
	backdrop-filter: blur(2px);
}
.estore-cart-shell__panel {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: min(840px, calc(100vw - 2rem));
	max-height: min(90vh, 720px);
	display: flex;
	flex-direction: column;
	background: #fff;
	border-radius: 10px;
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.22);
	overflow: hidden;
}
.estore-cart-shell__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 1rem 1.15rem;
	border-bottom: 1px solid #ececec;
	flex-shrink: 0;
}
.estore-cart-shell__title {
	margin: 0;
	font-size: 1.15rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}
.estore-cart-shell__close {
	border: 0;
	background: transparent;
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
	color: #444;
	padding: 0.15rem 0.35rem;
	border-radius: 4px;
}
.estore-cart-shell__close:hover {
	background: #f0f0f0;
}
.estore-cart-shell__body {
	padding: 0.65rem 1rem;
	overflow-y: auto;
	flex: 1;
	min-height: 5rem;
}
.estore-cart-shell__loading,
.estore-cart-shell__empty {
	margin: 0.75rem 0;
	color: #666;
}
.estore-cart-shell__rows {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}
.estore-cart-shell__row {
	display: flex;
	align-items: stretch;
	flex-wrap: wrap;
	position: relative;
	gap: 1rem 1rem;
	padding: 1rem 0.45rem 1rem 1rem;
	background: #f7f7f8;
	border-radius: 8px;
}
.estore-cart-shell__remove-corner {
	position: absolute;
	top: 0.45rem;
	right: 0.35rem;
	z-index: 3;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.25rem;
	height: 2.25rem;
	padding: 0;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: #888;
	cursor: pointer;
	line-height: 1;
}
.estore-cart-shell__remove-corner:hover {
	color: #b91c1c;
	background: rgba(185, 28, 28, 0.08);
}
.estore-cart-shell__ic {
	display: block;
	width: 14px;
	height: 14px;
	flex-shrink: 0;
}
.estore-cart-shell__ic--trash {
	width: 16px;
	height: 16px;
}
.estore-cart-shell__thumb-wrap {
	flex-shrink: 0;
	width: 112px;
	height: 112px;
	background: #fff;
	border-radius: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	border: 1px solid #ececec;
}
.estore-cart-shell__thumb {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
}
.estore-cart-shell__col-main {
	flex: 1 1 auto;
	min-width: 0;
	max-width: min(26rem, calc(100% - 8rem));
	padding-right: clamp(5.25rem, 22vw, 9rem);
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	box-sizing: border-box;
}
.estore-cart-shell__name {
	margin: 0;
	font-weight: 600;
	font-size: 0.95rem;
	line-height: 1.45;
	color: #111;
	text-align: left;
	word-wrap: break-word;
	overflow-wrap: anywhere;
}
.estore-cart-shell__col-price {
	position: absolute;
	right: 0.45rem;
	top: 50%;
	transform: translateY(-50%);
	z-index: 1;
	display: block;
	margin: 0;
	padding: 0;
}
.estore-cart-shell__line-price {
	font-weight: 700;
	font-size: 1.05rem;
	color: #d4721c;
	white-space: nowrap;
	text-align: right;
	margin: 0;
	padding: 0;
}
.estore-cart-shell__qtyrow {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-start;
	gap: 0.35rem 0.5rem;
	margin-top: 0.55rem;
}
.estore-cart-shell__qtybtn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border: 1px solid #c8c8c8;
	background: #fff;
	border-radius: 6px;
	cursor: pointer;
	padding: 0;
	color: #333;
	line-height: 1;
}
.estore-cart-shell__qtybtn .estore-cart-shell__ic {
	width: 13px;
	height: 13px;
}
.estore-cart-shell__qtybtn:hover {
	border-color: #999;
	background: #fafafa;
}
.estore-cart-shell__qty {
	min-width: 1.75rem;
	text-align: center;
	font-size: 0.95rem;
	font-weight: 600;
}

@media (max-width: 520px) {
	/* CSS Grid: фото зліва, праворуч — назва зверху, ціна знизу.
	   Кнопки +/- — абсолютно у правому нижньому куті. */
	.estore-cart-shell__row {
		display: grid !important;
		grid-template-columns: 72px 1fr;
		grid-template-rows: auto auto;
		grid-template-areas:
			"thumb name"
			"thumb price";
		gap: 0.35rem 0.7rem;
		align-items: start;
		padding: 0.8rem 0.8rem 0.8rem 0.8rem;
		min-height: 88px;
	}
	/* Кнопка-X (видалити) у правому верхньому куті */
	.estore-cart-shell__remove-corner {
		top: 0.4rem;
		right: 0.3rem;
		width: 1.9rem;
		height: 1.9rem;
	}
	/* Фотка зліва, охоплює обидва рядки grid */
	.estore-cart-shell__thumb-wrap {
		grid-area: thumb;
		grid-row: 1 / span 2;
		width: 72px;
		height: 72px;
		border-radius: 8px;
		align-self: center;
	}
	/* col-main розчиняється — діти стають grid items батьківського рядка */
	.estore-cart-shell__col-main {
		display: contents;
	}
	.estore-cart-shell__name {
		grid-area: name;
		font-size: 0.85rem;
		line-height: 1.35;
		margin: 0;
		padding-right: 2.5rem; /* місце під X */
		min-width: 0;
		word-wrap: break-word;
		overflow-wrap: anywhere;
	}
	/* Ціна — під назвою */
	.estore-cart-shell__col-price {
		grid-area: price;
		position: static;
		top: auto;
		right: auto;
		left: auto;
		bottom: auto;
		transform: none;
		display: block;
		width: auto;
		max-width: none;
		text-align: left;
		padding: 0;
		padding-right: 6rem; /* місце під +/- абс. */
		margin: 0;
	}
	.estore-cart-shell__line-price {
		font-size: 0.95rem;
		white-space: nowrap;
		display: inline-block;
	}
	/* +/- — абсолютно у правому нижньому куті рядка */
	.estore-cart-shell__qtyrow {
		position: absolute;
		right: 0.55rem;
		bottom: 0.55rem;
		top: auto;
		left: auto;
		display: flex;
		flex-wrap: nowrap;
		align-items: center;
		gap: 0.3rem;
		margin: 0;
		padding: 0;
	}
	.estore-cart-shell__qtybtn {
		width: 28px;
		height: 28px;
	}
	.estore-cart-shell__qty {
		min-width: 1.4rem;
		font-size: 0.9rem;
	}
	/* Футер кошика: «Продовжити покупки» зліва, разом + Оформлення справа */
	.estore-cart-shell__foot {
		justify-content: space-between;
		flex-wrap: wrap;
		gap: 0.6rem;
	}
	.estore-cart-shell__continue {
		flex: 0 0 auto;
	}
	.estore-cart-shell__foot-right {
		margin-left: auto;
		justify-content: flex-end;
		flex-wrap: nowrap;
	}
	.estore-cart-shell__checkout.button {
		margin-left: auto;
	}
}

.estore-cart-shell__foot {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 1rem 1.15rem;
	border-top: 1px solid #ececec;
	flex-shrink: 0;
}
.estore-cart-shell__continue {
	font-size: 0.8rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: #333;
	text-decoration: none;
	cursor: pointer;
}
.estore-cart-shell__continue:hover {
	text-decoration: underline;
}
.estore-cart-shell__foot-right {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem 0.75rem;
}
.estore-cart-shell__total-label {
	font-size: 0.9rem;
	color: #555;
}
.estore-cart-shell__total {
	font-size: 1.15rem;
	font-weight: 700;
}
.estore-cart-shell__checkout.button {
	margin: 0;
	color: #000 !important;
	font-weight: 700;
}

/* Випадаючий блок міні-кошика вимкнено — кошик лише в модалці по кліку на іконку */
[data-mini-cart] .mini-cart-content {
	display: none !important;
	visibility: hidden !important;
	pointer-events: none !important;
}

/* ============================================================
   CHECKOUT: форма зліва, зведення замовлення справа
   ============================================================ */

.checkout-page-lead {
	color: #555;
	margin: 0 0 1.25rem;
}
.checkout-layout {
	display: grid;
	grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr);
	gap: 1.5rem 2rem;
	align-items: start;
}
.checkout-layout__forms {
	min-width: 0;
}
.checkout-layout__summary {
	position: sticky;
	top: 1rem;
	background: #fff;
	border: 1px solid #ececec;
	border-radius: 12px;
	padding: 1.25rem 1.25rem 1.1rem;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}
@media (max-width: 880px) {
	.checkout-layout {
		grid-template-columns: 1fr;
	}
	.checkout-layout__summary {
		position: static;
	}
}

.checkout-form--styled {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}
.checkout-form__fieldset {
	border: 1px solid #ececec;
	border-radius: 12px;
	padding: 1rem 1.15rem 1.1rem;
	margin: 0;
}
.checkout-form__legend {
	font-weight: 700;
	font-size: 0.95rem;
	padding: 0 0.4rem;
	color: #1a1a1a;
}
.checkout-form__grid {
	display: grid;
	gap: 1.6rem 1rem;
	row-gap: 1.6rem;
}
.checkout-form__grid--2 {
	grid-template-columns: 1fr;
}
@media (min-width: 560px) {
	.checkout-form__grid--2 {
		grid-template-columns: 1fr 1fr;
	}
}
.checkout-form__field {
	display: flex;
	flex-direction: column;
	gap: 0.55rem;
	margin: 0;
	padding: 0;
}
.checkout-form__fieldset > .checkout-form__field,
.checkout-form__fieldset > .checkout-form__grid + .checkout-form__field,
.checkout-form__fieldset > .checkout-form__field + .checkout-form__grid,
.checkout-form__fieldset > .checkout-form__grid + .checkout-form__grid {
	margin-top: 10px;
}
.checkout-form__field--full {
	width: 100%;
}
.checkout-form__label {
	font-size: 0.85rem;
	color: #444;
	font-weight: 600;
	margin: 0 0 0.1rem;
	line-height: 1.3;
	display: block;
}
.checkout-form__req {
	color: #d4721c;
}
.checkout-form__input,
.checkout-form__textarea {
	border: 1px solid #d0d0d0;
	border-radius: 8px;
	padding: 0.65rem 0.8rem;
	font: inherit;
	color: #111;
	background: #fff;
	width: 100%;
	max-width: 100%;
	margin: 0;
	box-sizing: border-box;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.checkout-form__input:focus,
.checkout-form__textarea:focus {
	border-color: #d4721c;
	box-shadow: 0 0 0 3px rgba(212, 114, 28, 0.18);
	outline: none;
}
.checkout-form__textarea {
	min-height: 6rem;
	resize: vertical;
}
.checkout-form__actions {
	display: flex;
	justify-content: flex-end;
}
.checkout-form__submit.button {
	margin: 0;
	color: #000 !important;
	font-weight: 700;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	min-width: 220px;
	position: relative;
}
.checkout-form__submit[disabled],
.checkout-form__submit.is-loading {
	opacity: 0.75;
	cursor: not-allowed;
	pointer-events: none;
}
.checkout-form__submit-spinner {
	display: none;
	width: 1rem;
	height: 1rem;
	border-radius: 50%;
	border: 2px solid currentColor;
	border-top-color: transparent;
	animation: checkout-spin 0.8s linear infinite;
}
.checkout-form__submit.is-loading .checkout-form__submit-spinner {
	display: inline-block;
}
@keyframes checkout-spin {
	to { transform: rotate(360deg); }
}

.thankyou-card {
	max-width: 560px;
	margin: 2.5rem auto;
	padding: 2.5rem 2rem;
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
	text-align: center;
}
.thankyou-card__icon {
	display: inline-flex;
	width: 80px;
	height: 80px;
	border-radius: 50%;
	background: rgba(83, 235, 12, 0.12);
	color: #2fa804;
	align-items: center;
	justify-content: center;
	margin-bottom: 1rem;
}
.thankyou-card__icon svg {
	width: 48px;
	height: 48px;
}
.thankyou-card__title {
	margin: 0 0 0.75rem;
	font-size: 1.6rem;
	font-weight: 700;
	color: #0f172a;
}
.thankyou-card__order {
	margin: 0 0 0.75rem;
	color: #475569;
	font-size: 0.95rem;
}
.thankyou-card__order code {
	background: #f1f5f9;
	padding: 0.15rem 0.5rem;
	border-radius: 6px;
	font-size: 0.9em;
	color: #0f172a;
}
.thankyou-card__lead {
	margin: 0 0 1.5rem;
	color: #334155;
	line-height: 1.5;
}
.thankyou-card__actions {
	display: flex;
	justify-content: center;
}
.thankyou-card__btn.button {
	color: #000 !important;
	font-weight: 700;
	min-width: 220px;
}

.estore-callback {
	position: fixed;
	inset: 0;
	z-index: 10000;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 1rem;
}
.estore-callback[aria-hidden="false"],
.estore-callback.is-open {
	display: flex;
}
.estore-callback__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.55);
	backdrop-filter: blur(2px);
	cursor: pointer;
}
.estore-callback__dialog {
	position: relative;
	width: 100%;
	max-width: 460px;
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 30px 60px rgba(0, 0, 0, 0.25);
	padding: 2rem 1.75rem 1.75rem;
	animation: estore-callback-in 0.18s ease-out;
}
@keyframes estore-callback-in {
	from { opacity: 0; transform: translateY(8px) scale(0.98); }
	to { opacity: 1; transform: translateY(0) scale(1); }
}
.estore-callback__close {
	position: absolute;
	top: 0.5rem;
	right: 0.75rem;
	width: 36px;
	height: 36px;
	background: transparent;
	border: 0;
	font-size: 1.6rem;
	line-height: 1;
	color: #64748b;
	cursor: pointer;
	border-radius: 50%;
	transition: background 0.15s;
}
.estore-callback__close:hover {
	background: #f1f5f9;
	color: #0f172a;
}
.estore-callback__title {
	margin: 0 0 0.5rem;
	font-size: 1.35rem;
	font-weight: 700;
	color: #0f172a;
	text-align: center;
}
.estore-callback__lead {
	margin: 0 0 1.25rem;
	color: #64748b;
	text-align: center;
	font-size: 0.95rem;
}
.estore-callback__field {
	margin-bottom: 0.85rem;
}
.estore-callback__label {
	display: block;
	margin-bottom: 0.3rem;
	color: #334155;
	font-size: 0.85rem;
	font-weight: 600;
}
.estore-callback__input {
	width: 100%;
	box-sizing: border-box;
	padding: 0.7rem 0.9rem;
	border: 1px solid #cbd5e1;
	border-radius: 10px;
	background: #fff;
	font-size: 1rem;
	color: #0f172a;
	transition: border-color 0.15s, box-shadow 0.15s;
}
.estore-callback__input:focus {
	outline: none;
	border-color: #53EB0C;
	box-shadow: 0 0 0 3px rgba(83, 235, 12, 0.18);
}
.estore-callback__input.is-invalid {
	border-color: #ef4444;
	box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}
.estore-callback__msg {
	min-height: 1.2em;
	margin: 0.25rem 0 0.75rem;
	font-size: 0.85rem;
	color: #ef4444;
}
.estore-callback__msg.is-success {
	color: #16a34a;
}
.estore-callback__actions {
	display: flex;
	justify-content: center;
	margin-top: 0.5rem;
}
.estore-callback__submit.button {
	color: #000 !important;
	font-weight: 700;
	min-width: 200px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
}
.estore-callback__submit[disabled],
.estore-callback__submit.is-loading {
	opacity: 0.75;
	cursor: not-allowed;
	pointer-events: none;
}
.estore-callback__spinner {
	display: none;
	width: 1rem;
	height: 1rem;
	border-radius: 50%;
	border: 2px solid currentColor;
	border-top-color: transparent;
	animation: checkout-spin 0.8s linear infinite;
}
.estore-callback__submit.is-loading .estore-callback__spinner {
	display: inline-block;
}
body.estore-callback-open {
	overflow: hidden;
}
.checkout-back-link {
	margin: 0.25rem 0 0;
	font-size: 0.85rem;
}

.checkout-summary-title {
	margin: 0 0 0.85rem;
	font-size: 1rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #1a1a1a;
}
.checkout-summary-root {
	min-height: 4rem;
}
.checkout-summary-placeholder,
.checkout-summary-msg {
	color: #666;
	margin: 0.25rem 0;
	font-size: 0.9rem;
}
.checkout-summary__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.65rem;
}
.checkout-summary__item {
	display: flex;
	align-items: flex-start;
	gap: 0.75rem;
	padding: 0.55rem 0.5rem;
	background: #f8f8f9;
	border-radius: 8px;
}
.checkout-summary__item--estimate {
	background: #fff7e6;
}
.checkout-summary__item--unknown {
	background: #fff0f0;
}
.checkout-summary__thumb {
	flex-shrink: 0;
	width: 52px;
	height: 52px;
	object-fit: contain;
	background: #fff;
	border-radius: 6px;
	border: 1px solid #ececec;
}
.checkout-summary__thumb--empty {
	background: #f0f0f0;
}
.checkout-summary__meta {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
}
.checkout-summary__name-row {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	align-items: center;
}
.checkout-summary__name {
	font-weight: 600;
	font-size: 0.88rem;
	color: #1a1a1a;
	word-wrap: break-word;
	overflow-wrap: anywhere;
}
.checkout-summary__qtyprice {
	font-size: 0.8rem;
	color: #666;
}
.checkout-summary__line-total {
	flex-shrink: 0;
	font-weight: 700;
	color: #d4721c;
	white-space: nowrap;
	font-size: 0.95rem;
	align-self: center;
}
.checkout-summary__pending {
	font-weight: 600;
	color: #b91c1c;
}
.checkout-summary__estimate-tag {
	display: inline-block;
	padding: 0.05rem 0.45rem;
	background: #d4721c;
	color: #fff;
	border-radius: 999px;
	font-size: 0.7rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}
.checkout-summary__estimate-tag--unknown {
	background: #b91c1c;
}
.checkout-summary__note {
	margin: 0.75rem 0 0;
	padding: 0.5rem 0.65rem;
	background: #fff7e6;
	border-radius: 6px;
	color: #5a4a1c;
	font-size: 0.8rem;
	line-height: 1.4;
}
.checkout-summary__grand {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	margin-top: 1rem;
	padding-top: 0.85rem;
	border-top: 1px dashed #ddd;
}
.checkout-summary__grand-label {
	font-size: 0.85rem;
	color: #444;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}
.checkout-summary__grand-value {
	font-size: 1.2rem;
	font-weight: 800;
	color: #d4721c;
}
