/*
 * RC85 App Polish — scoped stability layer.
 *
 * RC84 applied mobile typography and BEM wildcard rules to every frontend
 * component. That made unrelated WooCommerce/Identity/Wallet controls inherit
 * Builder sizes and close-button rules. RC85 keeps the useful app polish, but
 * only inside Builder-owned storefront roots and named Delicat shell controls.
 */

/* Inline emoji replacements generated by the Builder renderer. */
svg.dbv9-emo {
	display:inline-block;
	width:1em;
	height:1em;
	max-width:1em;
	max-height:1em;
	vertical-align:-.125em;
	flex:0 0 auto;
	fill:none;
	stroke:currentColor;
	stroke-width:1.8;
	stroke-linecap:round;
	stroke-linejoin:round;
}

.delicat-testimonials__mstars svg.dbv9-emo,
.dbv9-reviews__stars svg.dbv9-emo,
.star-rating svg.dbv9-emo,
.dnp-reviews-stars svg.dbv9-emo,
.dnp-review-stars svg.dbv9-emo {
	fill:currentColor;
	stroke-width:.9;
	width:.95em;
	height:.95em;
}

/* App-like interaction without taking over the browser's native pull-to-refresh. */
html {
	-webkit-text-size-adjust:100%;
	text-size-adjust:100%;
	scroll-behavior:smooth;
}

body {
	-webkit-overflow-scrolling:touch;
	-webkit-tap-highlight-color:transparent;
}

/* Touch optimization only for Delicat-owned interactive controls. */
.delicat-page-layout :where(a,button,[role="button"],summary,input[type="submit"]),
.delicat-native-archive-main :where(a,button,[role="button"],summary,input[type="submit"]),
.delicat-native-product-main :where(a,button,[role="button"],summary,input[type="submit"]),
.delicat-native-page-main :where(a,button,[role="button"],summary,input[type="submit"]),
.delicat-native-info-main :where(a,button,[role="button"],summary,input[type="submit"]),
.delicat-v9-server-main :where(a,button,[role="button"],summary,input[type="submit"]),
.delicat-site :where(a,button,[role="button"],summary,input[type="submit"]),
.dpn-shell :where(a,button,[role="button"],summary,input[type="submit"]),
.dsb8-header :where(a,button,[role="button"]),
.dsb-modern-menu :where(a,button,[role="button"]),
.dbv9-drawer :where(a,button,[role="button"]),
.delicat-bottom-nav :where(a,button,[role="button"]) {
	touch-action:manipulation;
}

/* Horizontal rails keep momentum without styling arbitrary third-party tracks. */
.delicat-carousel__track,
.delicat-carousel__viewport,
.delicat-category-chips,
.delicat-native-category-chips,
.ddsw-grid,
.dpsr-switcher-list {
	-webkit-overflow-scrolling:touch;
	overscroll-behavior-x:contain;
	scrollbar-width:none;
}
.delicat-carousel__track::-webkit-scrollbar,
.delicat-carousel__viewport::-webkit-scrollbar,
.delicat-category-chips::-webkit-scrollbar,
.delicat-native-category-chips::-webkit-scrollbar,
.ddsw-grid::-webkit-scrollbar,
.dpsr-switcher-list::-webkit-scrollbar {
	width:0;
	height:0;
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior:auto; }
	.delicat-page-layout *,
	.delicat-native-archive-main *,
	.delicat-native-product-main *,
	.delicat-native-page-main *,
	.delicat-native-info-main *,
	.delicat-v9-server-main *,
	.delicat-site *,
	.dpn-shell * {
		animation-duration:.001ms !important;
		animation-iteration-count:1 !important;
		transition-duration:.001ms !important;
	}
}

/* Media stability. */
.delicat-page-layout :where(img,video,iframe),
.delicat-native-archive-main :where(img,video,iframe),
.delicat-native-product-main :where(img,video,iframe),
.delicat-native-page-main :where(img,video,iframe),
.delicat-native-info-main :where(img,video,iframe),
.delicat-v9-server-main :where(img,video,iframe),
.delicat-site :where(img,video,iframe),
.dpn-shell :where(img,video,iframe) {
	max-width:100%;
}
.delicat-page-layout img[width][height],
.delicat-native-archive-main img[width][height],
.delicat-native-product-main img[width][height],
.delicat-native-page-main img[width][height],
.delicat-native-info-main img[width][height],
.delicat-v9-server-main img[width][height],
.delicat-site img[width][height],
.dpn-shell img[width][height] { height:auto; }

.delicat-product-card__media { overflow:hidden; }
.delicat-product-card__media-wrap { aspect-ratio:auto; overflow:visible; }
.delicat-product-card__image { width:100%; height:100%; object-fit:cover; }

/* Apply lazy layout only to section containers; interactive children keep normal layout. */
.delicat-section,
.dbv9-section,
.dnp-steps,
.dnp-details,
.dnp-related {
	content-visibility:auto;
	contain-intrinsic-size:auto 420px;
}

/* Contain only Builder-owned roots. Avoid body overflow rules that can break sticky/fixed UI. */
.delicat-page-layout,
.delicat-native-archive-main,
.delicat-native-product-main,
.delicat-native-page-main,
.delicat-native-info-main,
.delicat-v9-server-main,
.delicat-site,
.dpn-shell {
	max-width:100%;
}
@supports (overflow: clip) {
	.delicat-page-layout,
	.delicat-native-archive-main,
	.delicat-native-product-main,
	.delicat-native-page-main,
	.delicat-native-info-main,
	.delicat-v9-server-main,
	.delicat-site,
	.dpn-shell { overflow-x:clip; }
}

.delicat-product-card,
.delicat-product-card__media-wrap,
.delicat-product-card__media { max-width:100%; box-sizing:border-box; }
.delicat-testimonials__marquee,
.delicat-testimonials__marquees { max-width:100%; overflow:hidden; }

/* Named touch targets only — no [class*="__close"] wildcard. */
.dsb8-cart-panel__close,
.dbv9-drawer__close,
.dsb-menu-close,
.dlc-review-close,
.dbv9-annc__close,
.dbv9-notifications__close,
.delicat-carousel__nav,
.dsb8-header__action,
.dbn-item,
.delicat-bottom-nav a {
	min-width:var(--dbv9-app-tap,44px);
	min-height:var(--dbv9-app-tap,44px);
}

.dsb8-cart-panel__close,
.dbv9-drawer__close,
.dsb-menu-close,
.dlc-review-close,
.dbv9-annc__close,
.dbv9-notifications__close {
	display:inline-flex;
	align-items:center;
	justify-content:center;
}

.dsb8-cart-panel__close svg,
.dbv9-drawer__close svg,
.dsb-menu-close svg,
.dlc-review-close svg,
.dbv9-annc__close svg,
.dbv9-notifications__close svg {
	width:18px;
	height:18px;
}

/* Safe areas only for known fixed Delicat bars. */
.dbv9-bottom-nav,
.delicat-bottom-nav,
.dbv9-mobile-dock,
.delicat-mobile-dock,
.dnp-mobile-dock,
.dpn-checkout-dock,
.dsb-bottom-nav {
	padding-bottom:max(env(safe-area-inset-bottom),6px);
}
@supports (padding: env(safe-area-inset-left)) {
	.dsb8-header,
	.dbv9-header {
		padding-left:max(env(safe-area-inset-left),0px);
		padding-right:max(env(safe-area-inset-right),0px);
	}
}

/* Mobile scale follows App Tuning variables instead of a second independent scale. */
@media (max-width: 767px) {
	.delicat-page-layout,
	.delicat-native-archive-main,
	.delicat-native-product-main,
	.delicat-native-page-main,
	.delicat-native-info-main,
	.delicat-v9-server-main,
	.delicat-site,
	.dpn-shell {
		font-size:var(--dbv9-app-body,14px);
		line-height:1.5;
	}

	.delicat-page-layout :where(h1,.delicat-builder-hero__title),
	.delicat-native-archive-main :where(h1),
	.delicat-native-product-main :where(h1),
	.delicat-native-page-main :where(h1),
	.delicat-native-info-main :where(h1),
	.delicat-v9-server-main :where(h1),
	.delicat-site :where(h1),
	.dpn-shell :where(h1) {
		font-size:var(--dbv9-app-h1,27px) !important;
		line-height:1.12;
		letter-spacing:-.015em;
		overflow-wrap:anywhere;
	}

	.delicat-page-layout h2,
	.delicat-native-archive-main h2,
	.delicat-native-product-main h2,
	.delicat-native-page-main h2,
	.delicat-native-info-main h2,
	.delicat-v9-server-main h2,
	.delicat-site h2,
	.dpn-shell h2 {
		font-size:var(--dbv9-app-h2,19px);
		line-height:1.2;
	}

	.delicat-page-layout h3,
	.delicat-native-archive-main h3,
	.delicat-native-product-main h3,
	.delicat-native-page-main h3,
	.delicat-native-info-main h3,
	.delicat-v9-server-main h3,
	.delicat-site h3,
	.dpn-shell h3 {
		font-size:var(--dbv9-app-h3,15px);
		line-height:1.25;
	}

	/* Known small labels. No generic __label/__meta wildcard. */
	.delicat-product-card__tag,
	.delicat-product-card__status,
	.delicat-product-card__price,
	.delicat-carousel__eyebrow,
	.delicat-category-chips__eyebrow,
	.delicat-section__eyebrow,
	.delicat-testimonials__mproduct,
	.delicat-testimonials__mid,
	.dlx-section__title,
	.dsb8-header__badge,
	.dbv9-bottom-nav__label,
	.dbn-item,
	.dnp-review-meta,
	.dnp-reviews-count,
	.dpn-hint {
		font-size:var(--dbv9-app-small,13px) !important;
		line-height:1.35;
	}

	.dbv9-notifications__count,
	.dsb8-header__count,
	.dbn-badge {
		font-size:11px !important;
		min-width:18px;
		min-height:18px;
		line-height:18px;
	}

	.delicat-product-card__title,
	.woocommerce-loop-product__title {
		font-size:14px !important;
		line-height:1.3;
	}

	/* Builder-owned actions only. */
	.delicat-page-layout :where(.button,.wp-element-button,button,input[type="submit"],.delicat-button),
	.delicat-native-archive-main :where(.button,.wp-element-button,button,input[type="submit"]),
	.delicat-native-product-main :where(.button,.wp-element-button,button,input[type="submit"]),
	.delicat-native-page-main :where(.button,.wp-element-button,button,input[type="submit"]),
	.delicat-native-info-main :where(.button,.wp-element-button,button,input[type="submit"]),
	.delicat-v9-server-main :where(.button,.wp-element-button,button,input[type="submit"]),
	.delicat-site :where(.button,.wp-element-button,button,input[type="submit"]),
	.dpn-shell :where(.button,.wp-element-button,button,input[type="submit"]) {
		min-height:var(--dbv9-app-cta,46px);
	}

	.delicat-carousel .delicat-product-card .delicat-product-card__body,
	.delicat-builder-homepage-managed.delicat-design-lovable_reference .delicat-carousel .delicat-product-card .delicat-product-card__body {
		min-height:0;
		padding-top:6px;
	}

	.delicat-product-card__cta,
	.delicat-builder-homepage-managed.delicat-design-lovable_reference .delicat-product-card__cta {
		min-height:36px;
		height:36px;
		padding:0 14px;
		border-radius:10px;
		font-size:12.5px;
		font-weight:800;
		letter-spacing:.02em;
		gap:6px;
		margin-top:10px;
	}
	.delicat-product-card__cta-svg { width:13px; height:13px; flex-basis:13px; }
	.delicat-product-card__heart > svg,
	.delicat-product-card__bubble svg {
		width:19px;
		height:19px;
		fill:none;
		stroke:currentColor;
		stroke-width:2;
		stroke-linecap:round;
		stroke-linejoin:round;
	}
	.delicat-product-card__heart.is-favorite > svg,
	.delicat-product-card__heart[aria-pressed="true"] > svg { fill:currentColor; }

	.dlc-review-icon { width:24px; height:24px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
	.dlc-review-close svg,
	.dlc-review-close-svg { width:18px; height:18px; stroke:currentColor; stroke-width:2.2; stroke-linecap:round; stroke-linejoin:round; }

	/* iOS zoom prevention only inside Builder-owned forms. */
	.delicat-page-layout :where(input,select,textarea),
	.delicat-native-archive-main :where(input,select,textarea),
	.delicat-native-product-main :where(input,select,textarea),
	.delicat-native-page-main :where(input,select,textarea),
	.delicat-native-info-main :where(input,select,textarea),
	.delicat-v9-server-main :where(input,select,textarea),
	.delicat-site :where(input,select,textarea),
	.dpn-shell :where(input,select,textarea) {
		font-size:16px !important;
	}

	.delicat-page-layout textarea,
	.delicat-native-product-main textarea,
	.delicat-native-page-main textarea,
	.delicat-site textarea,
	.dpn-shell textarea { min-height:96px; }

	.dpsr-switcher,
	.dpsr-switcher-list { flex-wrap:wrap; max-width:100%; }
	.dpsr-switcher-option { max-width:100%; min-width:0; box-sizing:border-box; overflow-wrap:anywhere; }
	.dpsr-switcher-option span { min-width:0; overflow:hidden; text-overflow:ellipsis; }

	.delicat-purchase-cart table.shop_table,
	.delicat-purchase-cart table.shop_table td { font-size:14px; }
}

@media (max-width: 400px) {
	.delicat-product-card__title,
	.woocommerce-loop-product__title { font-size:13.5px !important; }
}

/* Legacy pull-to-refresh UI remains available behind a feature filter, but is
 * disabled by default in RC85. These rules are inert unless the script creates it. */
.dlx-ptr {
	position:fixed;
	top:max(env(safe-area-inset-top),4px);
	left:50%;
	z-index:2147483000;
	display:grid;
	place-items:center;
	width:40px;
	height:40px;
	border-radius:999px;
	background:var(--delicat-surface,#fff);
	color:var(--delicat-primary,#8b5cf6);
	box-shadow:0 10px 26px rgba(16,24,40,.18);
	opacity:0;
	transform:translate3d(-50%,0,0);
	pointer-events:none;
}
.dlx-ptr.is-settling { transition:transform .24s cubic-bezier(.2,.8,.2,1),opacity .24s ease; }
.dlx-ptr.is-armed { box-shadow:0 10px 26px rgba(16,24,40,.22),0 0 0 2px currentColor inset; }
.dlx-ptr__ring svg { display:block; width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:2.2; stroke-linecap:round; stroke-linejoin:round; }
.dlx-ptr.is-loading { transition:transform .18s ease; }
.dlx-ptr.is-loading .dlx-ptr__ring { animation:dlx-ptr-spin .7s linear infinite; }
@keyframes dlx-ptr-spin { to { transform:rotate(360deg); } }
