/* ==========================================================================
   DF Modern Shop — clean, white, Next.js-style storefront.
   Everything is scoped to .dfms (the grid) or .dfms-layer (cart drawer,
   options sheet, toasts) so theme styles cannot leak in or out.
   ========================================================================== */

.dfms,
:is(.dfms-layer, #dfms-x) {
	--dfms-fg: var(--dfms-primary, #0a0a0a);
	--dfms-btn: var(--dfms-accent, #0a0a0a);
	--dfms-btn-fg: #fff;
	--dfms-muted: #6b6b6b;
	--dfms-faint: #a1a1a1;
	--dfms-border: #ebebeb;
	--dfms-border-strong: #d9d9d9;
	--dfms-subtle: #fafafa;
	--dfms-hover: #f4f4f4;
	--dfms-green: #16a34a;
	--dfms-red: #e5484d;
	--dfms-r: var(--dfms-radius, 12px);
	--dfms-ease: cubic-bezier(.2, .8, .2, 1);
	--dfms-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 24px -8px rgba(0, 0, 0, .12);
	--dfms-font: "DFMS Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	color: var(--dfms-fg);
	font-family: var(--dfms-font);
	font-size: 15px;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
	font-feature-settings: "ss01", "cv11";
}
.dfms--font-system,
:is(.dfms-layer, #dfms-x).dfms--font-system { --dfms-font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
.dfms--font-inherit,
:is(.dfms-layer, #dfms-x).dfms--font-inherit { --dfms-font: inherit; }

/* ---------- Scoped reset ---------------------------------------------- */
:is(.dfms, .dfms-layer, #dfms-x) *,
:is(.dfms, .dfms-layer, #dfms-x) *::before,
:is(.dfms, .dfms-layer, #dfms-x) *::after { box-sizing: border-box; }
:is(.dfms, .dfms-layer, #dfms-x) :is(h2, h3, h4, p, ul, li, figure) { margin: 0; padding: 0; border: 0; background: none; font-family: inherit; letter-spacing: inherit; text-transform: none; }
:is(.dfms, .dfms-layer, #dfms-x) ul { list-style: none; }
:is(.dfms, .dfms-layer, #dfms-x) a { color: inherit; text-decoration: none; box-shadow: none; }
:is(.dfms, .dfms-layer, #dfms-x) button,
:is(.dfms, .dfms-layer, #dfms-x) input,
:is(.dfms, .dfms-layer, #dfms-x) select {
	all: unset;
	box-sizing: border-box;
	font-family: inherit;
	font-size: inherit;
	line-height: inherit;
	color: inherit;
}
:is(.dfms, .dfms-layer, #dfms-x) button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
:is(.dfms, .dfms-layer, #dfms-x) button:disabled { cursor: not-allowed; opacity: .45; }
:is(.dfms, .dfms-layer, #dfms-x) img { max-width: 100%; height: auto; border: 0; box-shadow: none; border-radius: 0; }
:is(.dfms, .dfms-layer, #dfms-x) svg.dfms-icon { width: 16px; height: 16px; flex: none; display: block; }
:is(.dfms, .dfms-layer, #dfms-x) :focus-visible { outline: 2px solid var(--dfms-fg); outline-offset: 2px; border-radius: 6px; }
:is(.dfms, .dfms-layer, #dfms-x) [hidden] { display: none !important; }
:is(.dfms, .dfms-layer, #dfms-x) .dfms-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:is(.dfms, .dfms-layer, #dfms-x) .dfms-muted { color: var(--dfms-muted); }

/* ---------- Buttons ---------------------------------------------------- */
:is(.dfms, .dfms-layer, #dfms-x) .dfms-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	height: 40px;
	padding: 0 16px;
	border-radius: 999px;
	font-size: 14px;
	font-weight: 500;
	line-height: 1;
	white-space: nowrap;
	cursor: pointer;
	user-select: none;
	transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .15s var(--dfms-ease), opacity .15s ease;
}
:is(.dfms, .dfms-layer, #dfms-x) .dfms-btn:active { transform: scale(.97); }
:is(.dfms, .dfms-layer, #dfms-x) .dfms-btn--primary { background: var(--dfms-btn); color: var(--dfms-btn-fg) !important; border: 1px solid var(--dfms-btn); }
:is(.dfms, .dfms-layer, #dfms-x) .dfms-btn--primary:hover { background: color-mix(in srgb, var(--dfms-btn) 86%, #fff); }
:is(.dfms, .dfms-layer, #dfms-x) .dfms-btn--outline { background: #fff; color: var(--dfms-fg); border: 1px solid var(--dfms-border-strong); }
:is(.dfms, .dfms-layer, #dfms-x) .dfms-btn--outline:hover { background: var(--dfms-hover); }
:is(.dfms, .dfms-layer, #dfms-x) .dfms-btn--ghost { background: transparent; color: var(--dfms-fg); border: 1px solid transparent; }
:is(.dfms, .dfms-layer, #dfms-x) .dfms-btn--ghost:hover { background: var(--dfms-hover); }
:is(.dfms, .dfms-layer, #dfms-x) .dfms-btn--block { width: 100%; height: 48px; font-size: 15px; }
:is(.dfms, .dfms-layer, #dfms-x) .dfms-btn.is-busy { pointer-events: none; opacity: .7; }
:is(.dfms, .dfms-layer, #dfms-x) .dfms-btn.is-busy svg { display: none; }
:is(.dfms, .dfms-layer, #dfms-x) .dfms-btn.is-busy::before {
	content: "";
	width: 14px; height: 14px;
	border-radius: 50%;
	border: 2px solid currentColor;
	border-right-color: transparent;
	animation: dfms-spin .6s linear infinite;
}
:is(.dfms, .dfms-layer, #dfms-x) .dfms-btn.is-done svg { animation: dfms-pop .3s var(--dfms-ease); }

/* ==========================================================================
   Showcase
   ========================================================================== */
:is(.dfms, #dfms-x) {
	position: relative;
	display: block;
	width: 100%;
	background: var(--dfms-page-bg, #fff);
	padding: clamp(4px, 1vw, 8px) 0 8px;
	isolation: isolate;
}

/* Thin top loading bar */
:is(.dfms, #dfms-x) .dfms__progress {
	position: absolute; left: 0; top: 0;
	height: 2px; width: 0;
	background: var(--dfms-fg);
	opacity: 0;
	z-index: 3;
	border-radius: 2px;
}
:is(.dfms, #dfms-x).is-loading .dfms__progress { opacity: 1; animation: dfms-progress 1.4s var(--dfms-ease) forwards; }

/* Header */
:is(.dfms, #dfms-x) .dfms__header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
:is(.dfms, #dfms-x) .dfms__title { font-size: clamp(24px, 3vw, 32px); line-height: 1.15; font-weight: 600; letter-spacing: -.035em; color: var(--dfms-fg); }
:is(.dfms, #dfms-x) .dfms__count { margin-top: 4px; font-size: 14px; color: var(--dfms-muted); font-variant-numeric: tabular-nums; }

/* Cart button */
:is(.dfms, .dfms-layer, #dfms-x) .dfms-cart-open {
	position: relative;
	display: inline-flex; align-items: center; gap: 8px;
	height: 40px; padding: 0 8px 0 14px;
	border: 1px solid var(--dfms-border); border-radius: 999px;
	background: #fff; color: var(--dfms-fg);
	font-size: 14px; font-weight: 500;
	transition: background-color .15s ease, border-color .15s ease, transform .15s var(--dfms-ease);
	flex: none;
}
:is(.dfms, .dfms-layer, #dfms-x) .dfms-cart-open:hover { background: var(--dfms-hover); border-color: var(--dfms-border-strong); }
:is(.dfms, .dfms-layer, #dfms-x) .dfms-cart-open:active { transform: scale(.97); }
:is(.dfms, .dfms-layer, #dfms-x) .dfms-cart-count {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 24px; height: 24px; padding: 0 7px;
	border-radius: 999px;
	background: var(--dfms-btn); color: var(--dfms-btn-fg);
	font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums;
	transition: transform .2s var(--dfms-ease);
}
:is(.dfms, .dfms-layer, #dfms-x) .dfms-cart-count[data-count="0"] { background: var(--dfms-hover); color: var(--dfms-muted); }
:is(.dfms, .dfms-layer, #dfms-x) .dfms-cart-count.is-bump { animation: dfms-bump .45s var(--dfms-ease); }

/* Filters */
:is(.dfms, #dfms-x) .dfms__filters { display: grid; gap: 14px; margin-bottom: 24px; }
:is(.dfms, #dfms-x) .dfms__toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
:is(.dfms, #dfms-x) .dfms__search {
	position: relative;
	flex: 1 1 280px;
	display: flex; align-items: center;
	height: 40px;
	border: 1px solid var(--dfms-border);
	border-radius: 10px;
	background: #fff;
	transition: border-color .15s ease, box-shadow .15s ease;
}
:is(.dfms, #dfms-x) .dfms__search:focus-within { border-color: var(--dfms-fg); box-shadow: 0 0 0 3px rgba(0, 0, 0, .06); }
:is(.dfms, #dfms-x) .dfms__search svg { position: absolute; left: 12px; color: var(--dfms-faint); pointer-events: none; }
:is(.dfms, #dfms-x) .dfms__search input { width: 100%; height: 100%; padding: 0 40px 0 38px; font-size: 14px; }
:is(.dfms, #dfms-x) .dfms__search input::placeholder { color: var(--dfms-faint); opacity: 1; }
:is(.dfms, #dfms-x) .dfms__search input::-webkit-search-cancel-button { -webkit-appearance: none; }
:is(.dfms, #dfms-x) .dfms__search kbd {
	position: absolute; right: 10px;
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 20px; height: 20px; padding: 0 5px;
	border: 1px solid var(--dfms-border); border-radius: 5px;
	background: var(--dfms-subtle); color: var(--dfms-muted);
	font: 500 11px/1 var(--dfms-font); box-shadow: none;
}
:is(.dfms, #dfms-x) .dfms__search:focus-within kbd { opacity: 0; }

:is(.dfms, #dfms-x) .dfms__selects { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
:is(.dfms, #dfms-x) .dfms__select { position: relative; display: block; }
:is(.dfms, #dfms-x) .dfms__select::after {
	content: ""; position: absolute; right: 13px; top: 50%;
	width: 6px; height: 6px; margin-top: -5px;
	border-right: 1.5px solid var(--dfms-muted); border-bottom: 1.5px solid var(--dfms-muted);
	transform: rotate(45deg); pointer-events: none;
}
:is(.dfms, #dfms-x) .dfms__select select {
	display: block;
	height: 40px; min-width: 132px; max-width: 220px;
	padding: 0 34px 0 14px;
	line-height: 38px;
	border: 1px solid var(--dfms-border); border-radius: 10px;
	background: #fff;
	font-size: 14px; color: var(--dfms-fg);
	white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
	cursor: pointer;
	transition: border-color .15s ease, background-color .15s ease;
}
:is(.dfms, #dfms-x) .dfms__select select:hover { background: var(--dfms-subtle); }
:is(.dfms, #dfms-x) .dfms__select select:focus-visible { border-color: var(--dfms-fg); outline: none; box-shadow: 0 0 0 3px rgba(0, 0, 0, .06); }
:is(.dfms, #dfms-x) .dfms__reset { height: 40px; padding: 0 10px; font-size: 14px; color: var(--dfms-muted); border-radius: 8px; }
:is(.dfms, #dfms-x) .dfms__reset:hover { color: var(--dfms-fg); background: var(--dfms-hover); }

/* Category chips */
:is(.dfms, #dfms-x) .dfms__chips {
	display: flex; gap: 8px;
	overflow-x: auto; scrollbar-width: none;
	padding: 2px; margin: -2px;
	-webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent);
	mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent);
}
:is(.dfms, #dfms-x) .dfms__chips::-webkit-scrollbar { display: none; }
:is(.dfms, #dfms-x) .dfms-chip { position: relative; flex: none; cursor: pointer; }
:is(.dfms, #dfms-x) .dfms-chip input { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
:is(.dfms, #dfms-x) .dfms-chip span {
	display: inline-flex; align-items: center;
	height: 34px; padding: 0 14px;
	border: 1px solid var(--dfms-border); border-radius: 999px;
	background: #fff; color: var(--dfms-muted);
	font-size: 13.5px; font-weight: 500; white-space: nowrap;
	transition: all .15s ease;
}
:is(.dfms, #dfms-x) .dfms-chip:hover span { color: var(--dfms-fg); border-color: var(--dfms-border-strong); }
:is(.dfms, #dfms-x) .dfms-chip input:checked + span { background: var(--dfms-fg); border-color: var(--dfms-fg); color: #fff; }
:is(.dfms, #dfms-x) .dfms-chip input:focus-visible + span { outline: 2px solid var(--dfms-fg); outline-offset: 2px; }

/* Grid */
:is(.dfms, #dfms-x) .dfms__results { position: relative; transition: opacity .2s ease; }
:is(.dfms, #dfms-x).is-loading .dfms__results { opacity: .5; pointer-events: none; }
:is(.dfms, #dfms-x) .dfms__grid {
	display: grid;
	grid-template-columns: repeat(var(--dfms-cols, 4), minmax(0, 1fr));
	gap: 32px 20px;
}

/* Card */
:is(.dfms, #dfms-x) .dfms-card {
	position: relative;
	container-type: inline-size;
	display: flex; flex-direction: column;
	min-width: 0;
	background: transparent;
	animation: dfms-in .5s var(--dfms-ease) both;
	animation-delay: calc(var(--i, 0) * 30ms);
}
:is(.dfms, #dfms-x) .dfms-card__media {
	position: relative;
	aspect-ratio: var(--dfms-ratio, 1/1);
	overflow: hidden;
	border: 1px solid var(--dfms-border);
	border-radius: var(--dfms-r);
	background: var(--dfms-card-bg, #fff);
	transition: border-color .2s ease, box-shadow .3s ease;
}
:is(.dfms, #dfms-x) .dfms-card:hover .dfms-card__media { border-color: var(--dfms-border-strong); box-shadow: var(--dfms-shadow); }
:is(.dfms, #dfms-x) .dfms-card__image { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 10%; }
:is(.dfms, #dfms-x) .dfms-card__image img {
	display: block;
	width: 100%; height: 100%;
	max-width: 100%;
	object-fit: contain;
	transition: transform .5s var(--dfms-ease);
}
:is(.dfms, #dfms-x) .dfms-card:hover .dfms-card__image img { transform: scale(1.05); }
:is(.dfms, #dfms-x) .dfms-card.is-sold-out .dfms-card__image img { opacity: .55; filter: grayscale(.4); }

:is(.dfms, #dfms-x) .dfms-card__badges { position: absolute; top: 10px; left: 10px; display: flex; flex-wrap: wrap; gap: 6px; z-index: 1; pointer-events: none; }
:is(.dfms, #dfms-x) .dfms-badge {
	display: inline-flex; align-items: center;
	height: 22px; padding: 0 8px;
	border-radius: 999px;
	background: var(--dfms-fg); color: #fff;
	font-size: 11.5px; font-weight: 600; line-height: 1;
	letter-spacing: 0;
}
:is(.dfms, #dfms-x) .dfms-badge--sale { background: var(--dfms-red); }
:is(.dfms, #dfms-x) .dfms-badge--muted { background: #fff; color: var(--dfms-muted); border: 1px solid var(--dfms-border); }

/* Hover call-to-action on the image */
:is(.dfms, #dfms-x) .dfms-card__cta {
	position: absolute; left: 10px; right: 10px; bottom: 10px;
	z-index: 2;
	height: 40px;
	opacity: 0;
	transform: translateY(8px);
	transition: opacity .2s ease, transform .25s var(--dfms-ease), background-color .15s ease;
	box-shadow: 0 6px 16px -6px rgba(0, 0, 0, .35);
}
:is(.dfms, #dfms-x) .dfms-card:hover .dfms-card__cta,
:is(.dfms, #dfms-x) .dfms-card:focus-within .dfms-card__cta,
:is(.dfms, #dfms-x) .dfms-card__cta.is-busy,
:is(.dfms, #dfms-x) .dfms-card__cta.is-done { opacity: 1; transform: none; }
:is(.dfms, #dfms-x) .dfms-card__cta span { overflow: hidden; text-overflow: ellipsis; }

:is(.dfms, #dfms-x) .dfms-card__body { display: flex; flex-direction: column; flex: 1; gap: 4px; padding: 14px 2px 0; }
:is(.dfms, #dfms-x) .dfms-card__category { font-size: 12.5px; color: var(--dfms-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
:is(.dfms, #dfms-x) .dfms-card__title { font-size: 15px; line-height: 1.4; font-weight: 500; letter-spacing: -.01em; color: var(--dfms-fg); }
:is(.dfms, #dfms-x) .dfms-card__title a { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: inherit; }
:is(.dfms, #dfms-x) .dfms-card__title a:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
:is(.dfms, #dfms-x) .dfms-card__excerpt { font-size: 13.5px; color: var(--dfms-muted); line-height: 1.5; }
:is(.dfms, #dfms-x) .dfms-card__footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 4px; }
:is(.dfms, #dfms-x) .dfms-card__price { font-size: 15px; font-weight: 600; color: var(--dfms-fg); font-variant-numeric: tabular-nums; }
:is(.dfms, #dfms-x) .dfms-card__price del { color: var(--dfms-faint); font-weight: 400; font-size: .9em; margin-right: 6px; opacity: 1; }
:is(.dfms, #dfms-x) .dfms-card__price ins { text-decoration: none; background: none; color: var(--dfms-red); }
:is(.dfms, #dfms-x) .dfms-card__price .screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:is(.dfms, #dfms-x) .dfms-card__rating { display: inline-flex; align-items: center; gap: 3px; font-size: 13px; font-weight: 500; flex: none; }
:is(.dfms, #dfms-x) .dfms-card__rating svg { width: 14px; height: 14px; color: #f5a524; }
:is(.dfms, #dfms-x) .dfms-card__stock { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--dfms-muted); }
:is(.dfms, #dfms-x) .dfms-card__stock i { width: 6px; height: 6px; border-radius: 50%; background: var(--dfms-green); }
:is(.dfms, #dfms-x) .dfms-card__stock.is-out i { background: var(--dfms-red); }

/* Navigation */
:is(.dfms, #dfms-x) .dfms__nav { display: flex; justify-content: center; margin-top: 40px; }
:is(.dfms, #dfms-x) .dfms__load-more { min-width: 160px; }
:is(.dfms, #dfms-x) .dfms__pagination { display: flex; justify-content: center; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 40px; }
:is(.dfms, #dfms-x) .dfms__page {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 38px; height: 38px; padding: 0 10px;
	border: 1px solid var(--dfms-border); border-radius: 10px;
	background: #fff; font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums;
	transition: background-color .15s ease, border-color .15s ease;
}
:is(.dfms, #dfms-x) .dfms__page:hover { background: var(--dfms-hover); }
:is(.dfms, #dfms-x) .dfms__page.is-current { background: var(--dfms-fg); border-color: var(--dfms-fg); color: #fff; }
:is(.dfms, #dfms-x) .dfms__gap { color: var(--dfms-faint); padding: 0 4px; }

/* Empty */
:is(.dfms, #dfms-x) .dfms__empty {
	display: flex; flex-direction: column; align-items: center; gap: 6px;
	padding: 64px 20px;
	border: 1px dashed var(--dfms-border-strong); border-radius: var(--dfms-r);
	text-align: center;
}
:is(.dfms, #dfms-x) .dfms__empty svg { width: 28px; height: 28px; color: var(--dfms-faint); margin-bottom: 6px; }
:is(.dfms, #dfms-x) .dfms__empty strong { font-size: 16px; font-weight: 600; }
:is(.dfms, #dfms-x) .dfms__empty span { color: var(--dfms-muted); font-size: 14px; }
:is(.dfms, #dfms-x) .dfms__empty .dfms-btn { margin-top: 12px; border-color: var(--dfms-border); }

/* ==========================================================================
   Overlay layer: cart drawer, options sheet, toast
   ========================================================================== */
html.dfms-lock, html.dfms-lock body { overflow: hidden !important; }

dialog.dfms-layer {
	position: fixed;
	margin: 0; padding: 0;
	max-width: 100vw; max-height: 100dvh;
	border: 0;
	background: #fff;
	color: var(--dfms-fg);
	overflow: hidden;
	z-index: 2147483000;
}
dialog.dfms-layer::backdrop { background: rgba(0, 0, 0, .32); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); animation: dfms-fade .25s ease both; }
dialog.dfms-layer.is-closing::backdrop { animation: dfms-fade .2s ease reverse both; }

/* Drawer */
dialog.dfms-drawer {
	inset: 0 0 0 auto;
	width: min(440px, 100vw); height: 100dvh;
	display: none;
	flex-direction: column;
	border-left: 1px solid var(--dfms-border);
	box-shadow: -24px 0 60px -12px rgba(0, 0, 0, .18);
}
dialog.dfms-drawer[open] { display: flex; animation: dfms-slide-in .38s var(--dfms-ease) both; }
dialog.dfms-drawer.is-closing { animation: dfms-slide-out .25s ease both; }

:is(.dfms-layer, #dfms-x) .dfms-drawer__head {
	display: flex; align-items: center; justify-content: space-between; gap: 12px;
	height: 64px; padding: 0 12px 0 24px;
	border-bottom: 1px solid var(--dfms-border);
	flex: none;
}
:is(.dfms-layer, #dfms-x) .dfms-drawer__title { display: flex; align-items: baseline; gap: 8px; font-size: 17px; font-weight: 600; letter-spacing: -.02em; }
:is(.dfms-layer, #dfms-x) .dfms-drawer__title small { font-size: 13px; font-weight: 400; color: var(--dfms-muted); font-variant-numeric: tabular-nums; }
:is(.dfms-layer, #dfms-x) .dfms-icon-btn {
	display: inline-flex; align-items: center; justify-content: center;
	width: 36px; height: 36px; border-radius: 10px; color: var(--dfms-muted);
	transition: background-color .15s ease, color .15s ease;
}
:is(.dfms-layer, #dfms-x) .dfms-icon-btn:hover { background: var(--dfms-hover); color: var(--dfms-fg); }
:is(.dfms-layer, #dfms-x) .dfms-icon-btn svg { width: 18px; height: 18px; }

:is(.dfms-layer, #dfms-x) .dfms-drawer__alert {
	margin: 12px 24px 0;
	padding: 10px 12px;
	border: 1px solid #fbd5d6; border-radius: 10px;
	background: #fff5f5; color: #b4232a;
	font-size: 13.5px; line-height: 1.45;
	animation: dfms-in .25s ease both;
}
:is(.dfms-layer, #dfms-x) .dfms-drawer__body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 8px 24px; position: relative; }
:is(.dfms-layer, #dfms-x).is-busy .dfms-drawer__body::before {
	content: ""; position: sticky; top: 0; display: block;
	height: 2px; margin: -8px -24px 6px;
	background: linear-gradient(90deg, transparent, var(--dfms-fg), transparent);
	background-size: 50% 100%; background-repeat: no-repeat;
	animation: dfms-scan 1s linear infinite;
}

/* Cart line */
:is(.dfms-layer, #dfms-x) .dfms-line {
	display: grid;
	grid-template-columns: 80px minmax(0, 1fr);
	gap: 14px;
	padding: 16px 0;
	border-bottom: 1px solid var(--dfms-border);
	transition: opacity .2s ease;
}
:is(.dfms-layer, #dfms-x) .dfms-line.is-enter { animation: dfms-in .3s var(--dfms-ease) both; }
:is(.dfms-layer, #dfms-x) .dfms-line:last-child { border-bottom: 0; }
:is(.dfms-layer, #dfms-x) .dfms-line.is-busy { opacity: .5; pointer-events: none; }
:is(.dfms-layer, #dfms-x) .dfms-line.is-new .dfms-line__img { animation: dfms-ring 1.8s ease both; }
:is(.dfms-layer, #dfms-x) .dfms-line__img {
	display: flex; align-items: center; justify-content: center;
	width: 80px; height: 80px; padding: 6px;
	border: 1px solid var(--dfms-border); border-radius: 10px;
	background: #fff; overflow: hidden;
	transition: box-shadow .4s ease;
}
:is(.dfms-layer, #dfms-x) .dfms-line__img img { width: 100%; height: 100%; object-fit: contain; }
:is(.dfms-layer, #dfms-x) .dfms-line__main { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
:is(.dfms-layer, #dfms-x) .dfms-line__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
:is(.dfms-layer, #dfms-x) .dfms-line__name { font-size: 14.5px; font-weight: 500; line-height: 1.35; letter-spacing: -.01em; }
:is(.dfms-layer, #dfms-x) a.dfms-line__name:hover { text-decoration: underline; text-underline-offset: 3px; }
:is(.dfms-layer, #dfms-x) .dfms-line__total { font-size: 14.5px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
:is(.dfms-layer, #dfms-x) .dfms-line__meta { font-size: 13px; color: var(--dfms-muted); }
:is(.dfms-layer, #dfms-x) .dfms-line__unit { font-size: 13px; color: var(--dfms-muted); font-variant-numeric: tabular-nums; }
:is(.dfms-layer, #dfms-x) .dfms-line__unit del { color: var(--dfms-faint); }
:is(.dfms-layer, #dfms-x) .dfms-line__unit ins { text-decoration: none; background: none; }
:is(.dfms-layer, #dfms-x) .dfms-line__actions { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
:is(.dfms-layer, #dfms-x) .dfms-line__remove { font-size: 13px; color: var(--dfms-muted); padding: 4px 6px; margin-right: -6px; border-radius: 6px; }
:is(.dfms-layer, #dfms-x) .dfms-line__remove:hover { color: var(--dfms-red); background: #fff5f5; }

/* Quantity stepper */
:is(.dfms-layer, #dfms-x) .dfms-qty {
	display: inline-flex; align-items: center;
	height: 34px;
	border: 1px solid var(--dfms-border); border-radius: 999px;
	background: #fff;
}
:is(.dfms-layer, #dfms-x) .dfms-qty button {
	display: inline-flex; align-items: center; justify-content: center;
	width: 34px; height: 32px; border-radius: 999px; color: var(--dfms-muted);
	transition: color .15s ease, background-color .15s ease;
}
:is(.dfms-layer, #dfms-x) .dfms-qty button:hover:not(:disabled) { color: var(--dfms-fg); background: var(--dfms-hover); }
:is(.dfms-layer, #dfms-x) .dfms-qty button svg { width: 14px; height: 14px; }
:is(.dfms-layer, #dfms-x) .dfms-qty output,
:is(.dfms-layer, #dfms-x) .dfms-qty input {
	min-width: 28px; width: 34px; text-align: center;
	font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums;
	-moz-appearance: textfield;
}
:is(.dfms-layer, #dfms-x) .dfms-qty input::-webkit-inner-spin-button,
:is(.dfms-layer, #dfms-x) .dfms-qty input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
:is(.dfms-layer, #dfms-x) .dfms-qty--lg { height: 44px; }
:is(.dfms-layer, #dfms-x) .dfms-qty--lg button { width: 42px; height: 42px; }

/* Empty cart */
:is(.dfms-layer, #dfms-x) .dfms-drawer__empty {
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
	min-height: 100%; padding: 40px 12px; text-align: center;
	animation: dfms-in .35s var(--dfms-ease) both;
}
:is(.dfms-layer, #dfms-x) .dfms-drawer__empty-icon {
	display: flex; align-items: center; justify-content: center;
	width: 64px; height: 64px; margin-bottom: 10px;
	border: 1px solid var(--dfms-border); border-radius: 50%;
	background: var(--dfms-subtle); color: var(--dfms-muted);
}
:is(.dfms-layer, #dfms-x) .dfms-drawer__empty-icon svg { width: 24px; height: 24px; }
:is(.dfms-layer, #dfms-x) .dfms-drawer__empty strong { font-size: 16px; font-weight: 600; }
:is(.dfms-layer, #dfms-x) .dfms-drawer__empty p { font-size: 14px; color: var(--dfms-muted); margin-bottom: 14px; }

/* Footer */
:is(.dfms-layer, #dfms-x) .dfms-drawer__foot { flex: none; padding: 18px 24px calc(20px + env(safe-area-inset-bottom)); border-top: 1px solid var(--dfms-border); background: #fff; }
:is(.dfms-layer, #dfms-x) .dfms-sum { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 14px; color: var(--dfms-muted); margin-bottom: 6px; font-variant-numeric: tabular-nums; }
:is(.dfms-layer, #dfms-x) .dfms-sum--total { font-size: 16px; color: var(--dfms-fg); font-weight: 600; }
:is(.dfms-layer, #dfms-x) .dfms-sum .tax_label, :is(.dfms-layer, #dfms-x) .dfms-sum small { font-size: 12px; font-weight: 400; color: var(--dfms-muted); }
:is(.dfms-layer, #dfms-x) .dfms-drawer__note { font-size: 12.5px; color: var(--dfms-muted); margin: 4px 0 16px; }
:is(.dfms-layer, #dfms-x) .dfms-drawer__actions { display: grid; gap: 8px; }
:is(.dfms-layer, #dfms-x) .dfms-drawer__actions .dfms-btn--outline { border-color: var(--dfms-border); }

/* Options sheet (variable products) */
dialog.dfms-sheet {
	inset: 0;
	margin: auto;
	width: min(760px, calc(100vw - 32px));
	max-height: min(640px, calc(100dvh - 32px));
	border: 1px solid var(--dfms-border);
	border-radius: 16px;
	box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .35);
}
dialog.dfms-sheet[open] { display: block; animation: dfms-zoom-in .3s var(--dfms-ease) both; }
dialog.dfms-sheet.is-closing { animation: dfms-zoom-in .18s ease reverse both; }
:is(.dfms-layer, #dfms-x) .dfms-sheet__inner { display: grid; grid-template-columns: 1fr 1fr; max-height: inherit; }
:is(.dfms-layer, #dfms-x) .dfms-sheet__media { position: relative; display: flex; align-items: center; justify-content: center; padding: 32px; background: #fff; border-right: 1px solid var(--dfms-border); min-height: 280px; }
:is(.dfms-layer, #dfms-x) .dfms-sheet__media img { width: 100%; max-height: 420px; object-fit: contain; transition: opacity .2s ease; }
:is(.dfms-layer, #dfms-x) .dfms-sheet__content { display: flex; flex-direction: column; gap: 18px; padding: 28px; overflow-y: auto; max-height: min(640px, calc(100dvh - 32px)); }
:is(.dfms-layer, #dfms-x) .dfms-sheet__close { position: absolute; top: 12px; right: 12px; z-index: 2; background: rgba(255, 255, 255, .9); }
:is(.dfms-layer, #dfms-x) .dfms-sheet__name { font-size: 22px; line-height: 1.25; font-weight: 600; letter-spacing: -.03em; padding-right: 28px; }
:is(.dfms-layer, #dfms-x) .dfms-sheet__price { font-size: 17px; font-weight: 600; margin-top: 6px; font-variant-numeric: tabular-nums; }
:is(.dfms-layer, #dfms-x) .dfms-sheet__price del { color: var(--dfms-faint); font-weight: 400; margin-right: 6px; }
:is(.dfms-layer, #dfms-x) .dfms-sheet__price ins { text-decoration: none; background: none; color: var(--dfms-red); }
:is(.dfms-layer, #dfms-x) .dfms-attr legend, :is(.dfms-layer, #dfms-x) .dfms-attr__label { display: block; font-size: 13px; font-weight: 500; color: var(--dfms-muted); margin-bottom: 8px; padding: 0; }
:is(.dfms-layer, #dfms-x) .dfms-attr__label b { color: var(--dfms-fg); font-weight: 500; }
:is(.dfms-layer, #dfms-x) .dfms-attr__opts { display: flex; flex-wrap: wrap; gap: 8px; }
:is(.dfms-layer, #dfms-x) .dfms-opt {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 44px; height: 38px; padding: 0 14px;
	border: 1px solid var(--dfms-border); border-radius: 999px;
	background: #fff; font-size: 14px;
	transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}
:is(.dfms-layer, #dfms-x) .dfms-opt:hover { border-color: var(--dfms-border-strong); }
:is(.dfms-layer, #dfms-x) .dfms-opt[aria-pressed="true"] { border-color: var(--dfms-fg); background: var(--dfms-fg); color: #fff; }
:is(.dfms-layer, #dfms-x) .dfms-opt.is-unavailable { color: var(--dfms-faint); text-decoration: line-through; background: var(--dfms-subtle); }
:is(.dfms-layer, #dfms-x) .dfms-opt.is-unavailable[aria-pressed="true"] { color: #fff; background: var(--dfms-muted); border-color: var(--dfms-muted); }
:is(.dfms-layer, #dfms-x) .dfms-sheet__status { font-size: 13px; color: var(--dfms-muted); min-height: 19px; }
:is(.dfms-layer, #dfms-x) .dfms-sheet__status.is-error { color: var(--dfms-red); }
:is(.dfms-layer, #dfms-x) .dfms-sheet__buy { display: flex; gap: 10px; margin-top: auto; }
:is(.dfms-layer, #dfms-x) .dfms-sheet__buy .dfms-btn { flex: 1; height: 44px; }
:is(.dfms-layer, #dfms-x) .dfms-sheet__link { font-size: 13.5px; color: var(--dfms-muted); text-align: center; text-decoration: underline; text-underline-offset: 3px; }
:is(.dfms-layer, #dfms-x) .dfms-sheet__link:hover { color: var(--dfms-fg); }
:is(.dfms-layer, #dfms-x) .dfms-skel { border-radius: 8px; background: linear-gradient(90deg, #f2f2f2 25%, #e8e8e8 37%, #f2f2f2 63%); background-size: 400% 100%; animation: dfms-shimmer 1.2s ease infinite; }

/* Toast */
.dfms-toasts {
	position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom));
	transform: translateX(-50%);
	display: flex; flex-direction: column; align-items: center; gap: 8px;
	z-index: 2147483100; pointer-events: none;
	width: max-content; max-width: calc(100vw - 32px);
}
:is(.dfms-layer, #dfms-x).dfms-toast {
	display: flex; align-items: center; gap: 12px;
	padding: 8px 8px 8px 16px; min-height: 48px;
	border-radius: 999px;
	background: #0a0a0a; color: #fff;
	box-shadow: 0 12px 32px -8px rgba(0, 0, 0, .4);
	font-size: 14px; font-weight: 500;
	pointer-events: auto;
	animation: dfms-toast-in .35s var(--dfms-ease) both;
}
:is(.dfms-layer, #dfms-x).dfms-toast.is-error { background: var(--dfms-red); padding-right: 16px; }
:is(.dfms-layer, #dfms-x).dfms-toast.is-leaving { animation: dfms-toast-out .2s ease both; }
:is(.dfms-layer, #dfms-x).dfms-toast svg { width: 18px; height: 18px; color: #4ade80; }
:is(.dfms-layer, #dfms-x).dfms-toast.is-error svg { color: #fff; }
:is(.dfms-layer, #dfms-x).dfms-toast .dfms-toast__text { max-width: 60vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
:is(.dfms-layer, #dfms-x).dfms-toast button { height: 32px; padding: 0 14px; border-radius: 999px; background: #fff; color: #0a0a0a; font-size: 13px; font-weight: 600; }
:is(.dfms-layer, #dfms-x).dfms-toast button:hover { background: #e9e9e9; }

/* ---------- Animations ------------------------------------------------- */
@keyframes dfms-ring { 0%, 40% { box-shadow: 0 0 0 2px var(--dfms-fg); } 100% { box-shadow: 0 0 0 2px transparent; } }
@keyframes dfms-spin { to { transform: rotate(360deg); } }
@keyframes dfms-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes dfms-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes dfms-slide-in { from { transform: translateX(100%); } to { transform: none; } }
@keyframes dfms-slide-out { from { transform: none; } to { transform: translateX(100%); } }
@keyframes dfms-zoom-in { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes dfms-toast-in { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes dfms-toast-out { to { opacity: 0; transform: translateY(8px) scale(.96); } }
@keyframes dfms-bump { 0% { transform: scale(1); } 40% { transform: scale(1.3); } 100% { transform: scale(1); } }
@keyframes dfms-pop { 0% { transform: scale(.4); } 70% { transform: scale(1.2); } 100% { transform: scale(1); } }
@keyframes dfms-progress { 0% { width: 0; } 60% { width: 70%; } 100% { width: 90%; } }
@keyframes dfms-scan { from { background-position: -100% 0; } to { background-position: 200% 0; } }
@keyframes dfms-shimmer { from { background-position: 100% 50%; } to { background-position: 0 50%; } }

/* ---------- Responsive ------------------------------------------------- */
@media (max-width: 1100px) {
	:is(.dfms, #dfms-x) .dfms__grid { grid-template-columns: repeat(var(--dfms-cols-tablet, 3), minmax(0, 1fr)); }
}
@media (max-width: 760px) {
	:is(.dfms, #dfms-x) .dfms__selects { width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: -2px; }
	:is(.dfms, #dfms-x) .dfms__selects::-webkit-scrollbar { display: none; }
	:is(.dfms, #dfms-x) .dfms__select { flex: none; }
	:is(.dfms, #dfms-x) .dfms__select select { min-width: 0; }
	dialog.dfms-sheet { inset: auto 0 0 0; width: 100vw; max-height: 92dvh; border-radius: 18px 18px 0 0; border-bottom: 0; }
	dialog.dfms-sheet[open] { animation: dfms-sheet-up .35s var(--dfms-ease) both; }
	dialog.dfms-sheet.is-closing { animation: dfms-sheet-up .2s ease reverse both; }
	:is(.dfms-layer, #dfms-x) .dfms-sheet__inner { grid-template-columns: 1fr; overflow-y: auto; max-height: 92dvh; }
	:is(.dfms-layer, #dfms-x) .dfms-sheet__media { border-right: 0; border-bottom: 1px solid var(--dfms-border); min-height: 0; height: 34dvh; padding: 20px; }
	:is(.dfms-layer, #dfms-x) .dfms-sheet__media img { max-height: 100%; }
	:is(.dfms-layer, #dfms-x) .dfms-sheet__content { max-height: none; overflow: visible; padding: 20px 20px calc(20px + env(safe-area-inset-bottom)); }
}
@keyframes dfms-sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@media (max-width: 640px) {
	:is(.dfms, #dfms-x) .dfms__header { margin-bottom: 16px; }
	:is(.dfms, #dfms-x) .dfms-cart-open > span:not(.dfms-cart-count) { display: none; }
	:is(.dfms, #dfms-x) .dfms-cart-open { padding: 0 6px 0 10px; }
	:is(.dfms, #dfms-x) .dfms__search kbd { display: none; }
	:is(.dfms, #dfms-x) .dfms__grid { grid-template-columns: repeat(var(--dfms-cols-mobile, 2), minmax(0, 1fr)); gap: 24px 12px; }
	:is(.dfms, #dfms-x) .dfms-card__body { padding-top: 10px; }
	:is(.dfms, #dfms-x) .dfms-card__title { font-size: 14px; }
	:is(.dfms, #dfms-x) .dfms-card__price { font-size: 14px; }
	:is(.dfms, #dfms-x) .dfms-card__footer { flex-wrap: wrap; }
	:is(.dfms, #dfms-x) .dfms-card__cta { left: 8px; right: 8px; bottom: 8px; height: 36px; font-size: 13px; padding: 0 10px; }
	:is(.dfms-layer, #dfms-x) .dfms-drawer__head { padding-left: 18px; }
	:is(.dfms-layer, #dfms-x) .dfms-drawer__body { padding: 4px 18px; }
	:is(.dfms-layer, #dfms-x) .dfms-drawer__foot { padding-left: 18px; padding-right: 18px; }
	:is(.dfms-layer, #dfms-x) .dfms-line { grid-template-columns: 68px minmax(0, 1fr); gap: 12px; }
	:is(.dfms-layer, #dfms-x) .dfms-line__img { width: 68px; height: 68px; }
}
/* Narrow cards: compact round button so the label never gets cut off. */
@container (max-width: 200px) {
	:is(.dfms, #dfms-x) .dfms-card__cta { left: auto; right: 8px; bottom: 8px; width: 38px; height: 38px; padding: 0; border-radius: 50%; }
	:is(.dfms, #dfms-x) .dfms-card__cta span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
	:is(.dfms, #dfms-x) .dfms-card__cta svg { width: 18px; height: 18px; }
}
/* Touch devices: no hover, so show a compact round button on the image. */
@media (hover: none) {
	:is(.dfms, #dfms-x) .dfms-card__cta { opacity: 1; transform: none; left: auto; right: 8px; bottom: 8px; width: 38px; height: 38px; padding: 0; border-radius: 50%; }
	:is(.dfms, #dfms-x) .dfms-card__cta span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
	:is(.dfms, #dfms-x) .dfms-card__cta svg { width: 18px; height: 18px; }
	:is(.dfms, #dfms-x) .dfms-card:hover .dfms-card__image img { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
	:is(.dfms, .dfms-layer, #dfms-x) *,
	dialog.dfms-layer,
	dialog.dfms-layer::backdrop { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
}

/* ==========================================================================
   Floating cart button
   ========================================================================== */
.dfms-fab {
	position: fixed;
	right: max(20px, env(safe-area-inset-right));
	bottom: max(20px, env(safe-area-inset-bottom));
	z-index: 2147482000;
}
:is(.dfms-layer, #dfms-x).dfms-fab .dfms-cart-open {
	height: 52px;
	padding: 0 10px 0 18px;
	border: 0;
	background: var(--dfms-btn);
	color: var(--dfms-btn-fg);
	font-size: 14.5px;
	font-weight: 500;
	box-shadow: 0 10px 30px -8px rgba(0, 0, 0, .45), 0 0 0 1px rgba(255, 255, 255, .08) inset;
	animation: dfms-toast-in .4s var(--dfms-ease) both;
}
:is(.dfms-layer, #dfms-x).dfms-fab .dfms-cart-open:hover { background: color-mix(in srgb, var(--dfms-btn) 85%, #fff); }
:is(.dfms-layer, #dfms-x).dfms-fab .dfms-cart-open svg { width: 18px; height: 18px; }
:is(.dfms-layer, #dfms-x).dfms-fab .dfms-cart-count,
:is(.dfms-layer, #dfms-x).dfms-fab .dfms-cart-count[data-count="0"] { background: #fff; color: #0a0a0a; min-width: 28px; height: 28px; }
html.dfms-lock .dfms-fab { opacity: 0; pointer-events: none; }

/* Panel waiting for an add-to-cart answer */
:is(.dfms-layer, #dfms-x) .dfms-line--pending { display: grid; grid-template-columns: 80px 1fr; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--dfms-border); }
:is(.dfms-layer, #dfms-x) .dfms-line--pending .dfms-skel:first-child { width: 80px; height: 80px; border-radius: 10px; }
:is(.dfms-layer, #dfms-x) .dfms-line--pending > div:last-child { display: grid; gap: 8px; align-content: start; padding-top: 4px; }

/* Product page button while adding */
.single_add_to_cart_button.dfms-adding { opacity: .6 !important; pointer-events: none !important; }

@media (max-width: 640px) {
	:is(.dfms-layer, #dfms-x).dfms-fab .dfms-cart-open { height: 48px; padding: 0 8px 0 14px; }
	:is(.dfms-layer, #dfms-x).dfms-fab .dfms-cart-open .dfms-cart-open__label { display: none; }
}
