:root {
	--Bg: #f5f5f4;
	--BgSoft: #efeeea;
	--Panel: #ffffff;
	--PanelAlt: #faf9f7;
	--Line: #e2dfd8;
	--LineStrong: #d3cfc7;
	--Text: #1f2937;
	--TextSoft: #667085;
	--TextFaint: #8a94a6;
	--Accent: #2563eb;
	--AccentHover: #1d4ed8;
	--AccentSoft: #eef4ff;
	--Success: #15803d;
	--Danger: #dc2626;
	--DangerSoft: #fee2e2;
	--Warning: #b45309;
	--ShadowSm: 0 6px 18px rgba(15, 23, 42, 0.05);
	--ShadowMd: 0 18px 40px rgba(15, 23, 42, 0.08);
	--ShadowLg: 0 28px 70px rgba(15, 23, 42, 0.16);
	--RadiusSm: 12px;
	--RadiusMd: 16px;
	--RadiusLg: 22px;
	--Wrap: 1240px;
}

* {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
}

html.ModalOpen,
html.ModalOpen body {
	overflow: hidden;
}

body {
	margin: 0;
	font-family: Arial, sans-serif;
	color: var(--Text);
	background: var(--Bg);
}

a {
	color: inherit;
	text-decoration: none;
}

button,
input,
select,
textarea {
	font: inherit;
}

img {
	display: block;
	max-width: 100%;
}

.PageLoadingOverlay {
	position: fixed;
	inset: 0;
	background: rgba(245, 245, 244, 0.95);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 9999;
}

.Spinner {
	width: 48px;
	height: 48px;
	border: 5px solid var(--Line);
	border-top-color: var(--Accent);
	border-radius: 50%;
	animation: Spin 0.8s linear infinite;
}

@keyframes Spin {
	to {
		transform: rotate(360deg);
	}
}

.Wrap {
	width: min(var(--Wrap), calc(100% - 32px));
	margin: 0 auto;
}

.ShopHeader {
	position: sticky;
	top: 0;
	z-index: 30;
	background: rgba(255, 255, 255, 0.92);
	backdrop-filter: blur(14px);
	border-bottom: 1px solid rgba(31, 41, 55, 0.08);
	box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

.HeaderRow {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 18px 0;
}

.ShopTitle {
	margin: 0;
	font-size: 2rem;
	line-height: 1.05;
	letter-spacing: -0.02em;
}

.ShopSubtitle {
	margin-top: 6px;
	color: var(--TextSoft);
	font-size: 0.98rem;
}

.Page {
	padding: 28px 0 54px;
}

.Toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
	margin-bottom: 20px;
	padding: 18px;
	background: #ffffff;
	border: 1px solid rgba(31, 41, 55, 0.06);
	border-radius: var(--RadiusLg);
	box-shadow: var(--ShadowSm);
}

.ToolbarMain {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
	flex: 1 1 auto;
}

.Input {
	min-height: 46px;
	padding: 11px 14px;
	border-radius: var(--RadiusSm);
	border: 1px solid var(--Line);
	background: #ffffff;
	color: var(--Text);
	outline: none;
	transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.Input:focus {
	border-color: #9bb8f3;
	box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.10);
}

.Input[type="search"] {
	min-width: min(100%, 360px);
	flex: 1 1 320px;
}

.ToggleButton,
.CartButton,
.Cta,
.Tab,
.ModalClose {
	min-height: 46px;
	padding: 11px 15px;
	border-radius: var(--RadiusSm);
	border: 1px solid transparent;
	cursor: pointer;
	transition:
		background 0.18s ease,
		color 0.18s ease,
		border-color 0.18s ease,
		transform 0.18s ease,
		box-shadow 0.18s ease,
		opacity 0.18s ease;
}

.ToggleButton:hover,
.CartButton:hover,
.Cta:hover,
.Tab:hover,
.ModalClose:hover {
	transform: translateY(-1px);
}

.ToggleButton,
.Tab,
.ModalClose,
.Cta.Secondary {
	background: #ffffff;
	color: var(--Text);
	border-color: var(--Line);
	box-shadow: 0 1px 0 rgba(31, 41, 55, 0.02);
}

.ToggleButton:hover,
.Tab:hover,
.ModalClose:hover,
.Cta.Secondary:hover {
	background: #f8f7f4;
	border-color: var(--LineStrong);
}

.CartButton,
.Cta {
	background: var(--Accent);
	color: #ffffff;
	font-weight: 700;
	box-shadow: 0 10px 24px rgba(37, 99, 235, 0.18);
}

.CartButton:hover,
.Cta:hover {
	background: var(--AccentHover);
	box-shadow: 0 14px 28px rgba(29, 78, 216, 0.24);
}

.Cta:disabled,
.CartButton:disabled,
.ToggleButton:disabled,
.ModalClose:disabled {
	cursor: not-allowed;
	opacity: 0.55;
	transform: none;
	box-shadow: none;
	background: #cfd6e4;
	color: gray;
	border-color: #cfd6e4;
}

.Cta:disabled:hover,
.CartButton:disabled:hover,
.ToggleButton:disabled:hover,
.ModalClose:disabled:hover {
	transform: none;
	background: #cfd6e4;
	color: gray;
	border-color: #cfd6e4;
	box-shadow: none;
}

.CartButton {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	white-space: nowrap;
}

.CartCount {
	display: inline-grid;
	place-items: center;
	min-width: 24px;
	height: 24px;
	padding: 0 7px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.20);
	border: 1px solid rgba(255, 255, 255, 0.22);
	color: #ffffff;
	font-size: 0.84rem;
	font-weight: 700;
}

.Check {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: var(--TextSoft);
}

.Check input {
	width: 16px;
	height: 16px;
	accent-color: var(--Accent);
}

.ShopTabs {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 20px;
}

.Tab.Active {
	background: var(--AccentSoft);
	border-color: #c6d9ff;
	color: #123b99;
	font-weight: 700;
}

.SaleBanner {
	margin-bottom: 16px;
	padding: 13px 16px;
	border-radius: var(--RadiusMd);
	background: linear-gradient(135deg, #dc2626, #ef4444);
	color: #ffffff;
	text-align: center;
	font-weight: 700;
	box-shadow: 0 14px 28px rgba(220, 38, 38, 0.18);
}

.Grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
	gap: 18px;
}

.List {
	display: grid;
	gap: 14px;
}

.Card,
.RowCard {
	background: #ffffff;
	border: 1px solid rgba(31, 41, 55, 0.06);
	border-radius: var(--RadiusLg);
	overflow: hidden;
	box-shadow: var(--ShadowSm);
	transition:
		transform 0.18s ease,
		box-shadow 0.18s ease,
		border-color 0.18s ease;
}

.Card:hover,
.RowCard:hover {
	transform: translateY(-3px);
	box-shadow: var(--ShadowMd);
	border-color: rgba(37, 99, 235, 0.14);
}

.Card {
	display: flex;
	flex-direction: column;
	min-height: 100%;
}

.RowCard {
	display: grid;
	grid-template-columns: 220px minmax(0, 1fr);
}

.Thumb {
	position: relative;
	aspect-ratio: 4 / 3;
	background: #f2f1ed;
	display: grid;
	place-items: center;
	color: var(--TextSoft);
	overflow: hidden;
}

.RowThumb {
	aspect-ratio: auto;
	min-height: 100%;
}

.Thumb::after {
	content: "";
	position: absolute;
	inset: auto 0 0 0;
	height: 38%;
	background: linear-gradient(to top, rgba(255, 255, 255, 0.14), transparent);
	pointer-events: none;
}

.Thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.Body {
	padding: 18px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.RowBody {
	padding: 20px;
}

.Title {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
	margin: 0;
	font-size: 1.1rem;
	line-height: 1.28;
	letter-spacing: -0.01em;
}

.Badge {
	display: inline-flex;
	align-items: center;
	padding: 4px 8px;
	border-radius: 999px;
	background: var(--DangerSoft);
	border: 1px solid #fecaca;
	color: #991b1b;
	font-size: 0.76rem;
	font-weight: 700;
	letter-spacing: 0.04em;
}

.Price {
	font-size: 1.1rem;
	font-weight: 700;
	color: var(--Text);
}

.PriceOld {
	text-decoration: line-through;
	color: var(--TextSoft);
	font-size: 0.92em;
	margin-right: 8px;
	font-weight: 500;
}

.PriceNew {
	color: var(--Warning);
}

.Desc {
	margin: 0;
	color: var(--TextSoft);
	line-height: 1.56;
	font-size: 0.96rem;
}

.Actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: auto;
	padding-top: 4px;
}

.Actions a.Cta.Secondary {
	background: #FF9900;
	color: white;
	border-color: #FF9900;
	font-weight: 700;
	box-shadow: 0 4px 12px rgba(255, 153, 0, 0.28);
}

.Actions a.Cta.Secondary:hover {
	background: #E68A00;
	border-color: #E68A00;
	color: white;
	box-shadow: 0 6px 16px rgba(230, 138, 0, 0.35);
	transform: translateY(-2px);
}

.Empty {
	padding: 32px 20px;
	text-align: center;
	color: var(--TextSoft);
	background: #ffffff;
	border: 1px solid rgba(31, 41, 55, 0.06);
	border-radius: var(--RadiusLg);
	box-shadow: var(--ShadowSm);
}

.Modal {
	position: fixed;
	inset: 0;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 22px;
	background: rgba(17, 24, 39, 0.22);
	backdrop-filter: blur(8px);
	z-index: 1000;
}

.Modal.Active {
	display: flex;
}

.ModalPanel {
	width: min(1040px, 100%);
	max-height: min(90vh, 960px);
	background: #f7f6f3;
	border: 1px solid rgba(31, 41, 55, 0.08);
	border-radius: 24px;
	box-shadow: var(--ShadowLg);
	display: grid;
	grid-template-rows: auto 1fr;
	overflow: hidden;
}

.ModalHeader {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 18px;
	background: #f7f6f3;
	border-bottom: 1px solid rgba(31, 41, 55, 0.08);
}

.ModalHeader h2 {
	margin: 0;
	font-size: 1.1rem;
	letter-spacing: -0.01em;
}

.ModalBody {
	padding: 18px;
	overflow: auto;
	background: #f3f2ef;
}

.CartModalBody {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 320px;
	gap: 18px;
	align-items: start;
}

.CartItems {
	display: grid;
	gap: 12px;
}

.CartItem {
	display: grid;
	grid-template-columns: 92px minmax(0, 1fr) auto;
	gap: 14px;
	padding: 14px;
	background: #ffffff;
	border: 1px solid rgba(31, 41, 55, 0.06);
	border-radius: 18px;
	box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
}

.CartItemMedia {
	display: flex;
	align-items: flex-start;
	justify-content: center;
}

.CartItemImage {
	width: 92px;
	height: 92px;
	object-fit: cover;
	border-radius: 14px;
	background: #edeae4;
	border: 1px solid rgba(31, 41, 55, 0.04);
}

.CartItemImage.Placeholder {
	display: grid;
	place-items: center;
	color: var(--TextSoft);
	font-size: 0.82rem;
	text-align: center;
	padding: 8px;
}

.CartItemMain {
	min-width: 0;
}

.CartItemTitle {
	margin: 0 0 8px;
	font-size: 1rem;
	line-height: 1.3;
}

.CartItemDesc {
	margin: 0 0 10px;
	color: var(--TextSoft);
	line-height: 1.45;
	font-size: 0.94rem;
}

.CartItemMeta {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	color: var(--TextFaint);
	font-size: 0.92rem;
}

.CartItemActions {
	display: flex;
	align-items: center;
}

.CartSummary {
	position: sticky;
	top: 0;
	padding: 18px;
	background: #fcfbf8;
	border: 1px solid rgba(31, 41, 55, 0.06);
	border-radius: 20px;
	box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
	display: grid;
	gap: 14px;
}

.CartSummaryRow {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	color: var(--TextSoft);
}

.CartSummaryRow strong {
	color: var(--Text);
	font-size: 1rem;
}

.CartSummaryActions {
	display: grid;
	gap: 10px;
	padding-top: 4px;
}

.CheckoutPanel {
	width: min(1440px, calc(100vw - 28px));
	height: min(96vh, 1040px);
	background: #f3f2ef;
	grid-template-rows: auto minmax(0, 1fr);
	overflow: hidden;
}

.CheckoutBody {
	padding: 18px 22px 22px;
	overflow: hidden;
	min-height: 0;
}

.CheckoutFrame {
	width: 100%;
	height: 100%;
	min-height: 0;
	border: 0;
	display: block;
	background: #ffffff;
	border-radius: 18px;
	box-shadow: inset 0 0 0 1px rgba(31, 41, 55, 0.05);
}

.AlertModal {
	z-index: 1100;
}

.AlertPanel {
	width: min(520px, calc(100vw - 24px));
	background: #ffffff;
	border: 1px solid rgba(31, 41, 55, 0.08);
	border-radius: 22px;
	box-shadow: 0 26px 70px rgba(15, 23, 42, 0.22);
	overflow: hidden;
}

.AlertHeader {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 16px 18px;
	border-bottom: 1px solid rgba(31, 41, 55, 0.08);
	background: #f8f7f4;
}

.AlertHeader h2 {
	margin: 0;
	font-size: 1.06rem;
}

.AlertBody {
	padding: 18px;
	background: #ffffff;
}

.AlertMessage {
	color: var(--Text);
	line-height: 1.55;
	white-space: pre-wrap;
}

.AlertFooter {
	display: flex;
	justify-content: flex-end;
	padding: 0 18px 18px;
	background: #ffffff;
}

@media (max-width: 980px) {
	.CartModalBody {
		grid-template-columns: 1fr;
	}

	.CartSummary {
		position: static;
	}
}

@media (max-width: 860px) {
	.RowCard {
		grid-template-columns: 1fr;
	}

	.CheckoutPanel {
		width: min(100vw - 16px, 1380px);
		height: min(96vh, 980px);
	}

	.CheckoutBody {
		padding: 12px;
	}
}

@media (max-width: 720px) {
	.Modal {
		padding: 12px;
	}

	.ModalPanel {
		border-radius: 20px;
	}

	.ModalBody {
		padding: 14px;
	}
}

@media (max-width: 640px) {
	.Wrap {
		width: min(100% - 20px, var(--Wrap));
	}

	.HeaderRow {
		flex-direction: column;
		align-items: stretch;
	}

	.Toolbar {
		padding: 14px;
	}

	.ToolbarMain {
		width: 100%;
	}

	.Input,
	.ToggleButton {
		width: 100%;
	}

	.CartButton {
		width: 100%;
		justify-content: space-between;
	}

	.Grid {
		grid-template-columns: 1fr 1fr;
	}

	.CartItem {
		grid-template-columns: 1fr;
	}

	.CartItemMedia,
	.CartItemActions {
		justify-content: flex-start;
	}

	.CheckoutFrame {
		min-height: 78vh;
	}
}

@media (max-width: 520px) {
	.Grid {
		grid-template-columns: 1fr;
	}

	.ShopTitle {
		font-size: 1.7rem;
	}

	.Title {
		font-size: 1.03rem;
	}
}
