/**
 * Rotitoo App Shell v1.1 — full browsing UX
 */

:root {
	--rotitoo-accent: #b85c4a;
	--rotitoo-accent-soft: rgba(184, 92, 74, 0.12);
	--rotitoo-border-soft: rgba(215, 185, 165, 0.35);
	--rotitoo-shadow-soft: 0 4px 24px rgba(200, 160, 140, 0.14);
	--rotitoo-ease: cubic-bezier(0.4, 0, 0.2, 1);
	--rotitoo-slide: 14px;
}

html {
	-webkit-tap-highlight-color: transparent;
	scroll-behavior: smooth;
}

body {
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

/* ─── Scroll: header shadow on scroll ───────────────────────── */
body.rotitoo-scrolled .whb-header,
body.rotitoo-scrolled .whb-sticky-header {
	box-shadow: 0 2px 20px rgba(30, 20, 15, 0.06);
	transition: box-shadow 0.3s var(--rotitoo-ease);
}

/* ─── Progress bar ──────────────────────────────────────────── */
.rotitoo-nav-progress {
	position: fixed;
	top: 0;
	inset-inline-start: 0;
	inset-inline-end: 0;
	height: 2px;
	z-index: 99999;
	pointer-events: none;
	background: linear-gradient(
		90deg,
		var(--rotitoo-accent),
		#d4a090,
		var(--rotitoo-accent)
	);
	background-size: 200% 100%;
	transform: scaleX(0);
	transform-origin: inline-start;
	opacity: 0;
	transition: transform 0.35s var(--rotitoo-ease), opacity 0.2s ease;
}

.rotitoo-nav-progress.is-active {
	opacity: 1;
	transform: scaleX(0.7);
	animation: rotitooProgressShine 1s linear infinite;
}

.rotitoo-nav-progress.is-done {
	transform: scaleX(1);
	opacity: 0;
	animation: none;
}

@keyframes rotitooProgressShine {
	to { background-position: 200% 0; }
}

/* ─── Page skeleton while loading ───────────────────────────── */
.rotitoo-page-skeleton {
	position: fixed;
	inset: 0;
	z-index: 998;
	pointer-events: none;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s ease, visibility 0.2s ease;
	background: rgba(255, 255, 255, 0.72);
	backdrop-filter: blur(2px);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 24px;
}

.rotitoo-page-skeleton.is-visible {
	opacity: 1;
	visibility: visible;
}

.rotitoo-skeleton-bar {
	width: min(280px, 70vw);
	height: 8px;
	border-radius: 999px;
	background: linear-gradient(90deg, #f0e8e3 25%, #faf6f3 50%, #f0e8e3 75%);
	background-size: 200% 100%;
	animation: rotitooShimmer 1.2s ease infinite;
	margin-bottom: 24px;
}

.rotitoo-skeleton-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 12px;
	width: min(360px, 90vw);
}

.rotitoo-skeleton-grid span {
	aspect-ratio: 1;
	border-radius: 14px;
	background: linear-gradient(90deg, #f0e8e3 25%, #faf6f3 50%, #f0e8e3 75%);
	background-size: 200% 100%;
	animation: rotitooShimmer 1.2s ease infinite;
}

.rotitoo-skeleton-grid span:nth-child(2) { animation-delay: 0.1s; }
.rotitoo-skeleton-grid span:nth-child(3) { animation-delay: 0.2s; }
.rotitoo-skeleton-grid span:nth-child(4) { animation-delay: 0.3s; }

@keyframes rotitooShimmer {
	to { background-position: 200% 0; }
}

/* ─── Page transitions — fast Flutter-like ──────────────────── */
html.is-changing .main-page-wrapper,
.main-page-wrapper.rotitoo-navigating {
	transition: opacity 0.22s cubic-bezier(0.4, 0, 0.2, 1),
		transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
	will-change: opacity, transform;
}

.main-page-wrapper.rotitoo-navigating {
	opacity: 0.55;
	transform: scale(0.992);
}

html.is-animating.is-leaving .main-page-wrapper {
	opacity: 0;
	transform: translateX(calc(-1 * var(--rotitoo-slide))) scale(0.99);
}

html.is-animating.is-rendering .main-page-wrapper {
	opacity: 0;
	transform: translateX(var(--rotitoo-slide)) scale(0.99);
}

html.is-changing.is-rendering .main-page-wrapper {
	opacity: 1;
	transform: translateX(0) scale(1);
}

/* RTL: flip slide direction */
html[dir="rtl"].is-animating.is-leaving .main-page-wrapper,
body.rtl.is-animating.is-leaving .main-page-wrapper {
	transform: translateX(var(--rotitoo-slide));
}

html[dir="rtl"].is-animating.is-rendering .main-page-wrapper,
body.rtl.is-animating.is-rendering .main-page-wrapper {
	transform: translateX(calc(-1 * var(--rotitoo-slide)));
}

@media (prefers-reduced-motion: reduce) {
	html.is-changing .main-page-wrapper {
		transition: opacity 0.12s ease;
		transform: none !important;
	}
	.rotitoo-page-skeleton { display: none; }
}

/* ─── Toast notifications ───────────────────────────────────── */
.rotitoo-toast {
	position: fixed;
	bottom: 24px;
	left: 50%;
	transform: translateX(-50%) translateY(80px);
	z-index: 99998;
	padding: 12px 22px;
	background: #2c2420;
	color: #fff;
	font-size: 0.82rem;
	font-weight: 500;
	border-radius: 999px;
	box-shadow: 0 8px 32px rgba(30, 20, 15, 0.2);
	opacity: 0;
	pointer-events: none;
	transition: transform 0.35s var(--rotitoo-ease), opacity 0.35s ease;
	white-space: nowrap;
}

.rotitoo-toast.is-visible {
	transform: translateX(-50%) translateY(0);
	opacity: 1;
}

@media (max-width: 1024px) {
	.rotitoo-toast {
		bottom: 20px;
	}
}

/* ─── Link / button tap feedback ────────────────────────────── */
.rotitoo-app-shell a:not(.no-ux-tap),
.rotitoo-app-shell button:not(.no-ux-tap) {
	transition: transform 0.15s ease, opacity 0.15s ease;
}

.rotitoo-app-shell .wd-product .product-wrapper {
	transition: box-shadow 0.3s ease, transform 0.25s ease;
}

.rotitoo-app-shell .wd-product:active .product-wrapper {
	transform: scale(0.98);
}

/* Nav active link hint */
.whb-header .woodmart-nav-link.rotitoo-nav-active,
.wd-nav .woodmart-nav-link.rotitoo-nav-active {
	color: var(--rotitoo-accent) !important;
}

/* ─── Add to cart button ────────────────────────────────────── */
.wd-product .wd-add-btn {
	opacity: 1 !important;
	visibility: visible !important;
}

.wd-product .wd-add-btn a,
.wd-product .wd-add-btn .button,
.wd-product .wd-add-btn .add_to_cart_button {
	font-size: 0;
	width: 36px;
	height: 36px;
	min-height: 36px;
	padding: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.96) !important;
	border: 1px solid var(--rotitoo-border-soft) !important;
	color: var(--rotitoo-accent) !important;
	box-shadow: var(--rotitoo-shadow-soft);
}

.wd-header-cart.rotitoo-cart-pulse .wd-tools-icon {
	animation: rotitooCartPulse 0.5s ease;
}

@keyframes rotitooCartPulse {
	0%, 100% { transform: scale(1); }
	50% { transform: scale(1.15); }
}

.wd-add-btn.is-adding a {
	pointer-events: none;
	opacity: 0.6;
}

.wd-add-btn.is-adding a::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 14px;
	height: 14px;
	margin: -7px 0 0 -7px;
	border: 2px solid var(--rotitoo-accent);
	border-top-color: transparent;
	border-radius: 50%;
	animation: rotitooSpin 0.6s linear infinite;
}

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

/* ─── Cart drawer ───────────────────────────────────────────── */
.wd-close-side {
	background: rgba(20, 16, 14, 0.45) !important;
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	transition: opacity 0.3s ease !important;
}

.cart-widget-side {
	--wd-side-hidden-w: min(420px, 100vw);
	background: #fff !important;
	box-shadow: -12px 0 48px rgba(30, 20, 15, 0.12);
	border-inline-start: 1px solid var(--rotitoo-border-soft);
	transition: transform 0.4s var(--rotitoo-ease) !important;
}

.cart-widget-side .wd-heading {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 18px 20px;
	border-bottom: 1px solid var(--rotitoo-border-soft);
	background: #fff;
	position: sticky;
	top: 0;
	z-index: 2;
}

.cart-widget-side .wd-heading .title {
	font-size: 0.95rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: #2c2420;
}

.cart-widget-side .close-side-widget a {
	font-size: 0;
	width: 36px;
	height: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: #f8f4f1;
	border: 1px solid var(--rotitoo-border-soft);
}

.cart-widget-side .woocommerce-mini-cart .mini_cart_item {
	display: flex;
	flex-wrap: wrap;
	gap: 10px 12px;
	padding: 16px 20px !important;
	margin: 0 !important;
	border-bottom: 1px solid rgba(230, 215, 205, 0.4);
}

.cart-widget-side .mini_cart_item > a:not(.remove) {
	display: flex;
	align-items: center;
	gap: 12px;
	flex: 1;
	min-width: 0;
	font-size: 0.82rem;
	font-weight: 500;
	color: #3d3530;
	text-decoration: none;
}

.cart-widget-side .mini_cart_item img {
	width: 72px !important;
	height: 72px !important;
	object-fit: contain !important;
	background: #fff !important;
	border-radius: 10px;
	border: 1px solid var(--rotitoo-border-soft);
	padding: 4px;
}

.cart-widget-side .mini_cart_item .quantity {
	width: 100%;
	padding-inline-start: 84px;
	font-size: 0.75rem;
	color: #9a8580;
}

.cart-widget-side .shopping-cart-widget-footer {
	padding: 16px 20px 24px !important;
	border-top: 1px solid var(--rotitoo-border-soft);
	box-shadow: 0 -4px 20px rgba(200, 160, 140, 0.06);
}

.cart-widget-side .woocommerce-mini-cart__total {
	display: flex;
	justify-content: space-between;
	padding: 12px 0 16px !important;
	font-weight: 600;
	border: none !important;
}

.cart-widget-side .woocommerce-mini-cart__total .amount {
	color: var(--rotitoo-accent);
	font-size: 1.05rem;
}

.cart-widget-side .woocommerce-mini-cart__buttons {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.cart-widget-side .woocommerce-mini-cart__buttons .button {
	width: 100%;
	padding: 14px 20px !important;
	border-radius: 999px !important;
	font-size: 0.82rem !important;
	font-weight: 600 !important;
	letter-spacing: 0.05em !important;
	text-transform: uppercase !important;
}

.cart-widget-side .woocommerce-mini-cart__buttons .checkout {
	background: #2c2420 !important;
	color: #fff !important;
	border: none !important;
}

.wd-header-cart .wd-cart-number {
	background: var(--rotitoo-accent) !important;
}

/* ─── WooCommerce notices ───────────────────────────────────── */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
	border-radius: 12px !important;
	border: none !important;
	box-shadow: var(--rotitoo-shadow-soft);
	font-size: 0.88rem;
}

.woocommerce-message {
	background: #fdfbf9 !important;
	border-inline-start: 3px solid var(--rotitoo-accent) !important;
}

/* ─── Cookie popup ──────────────────────────────────────────── */
.wd-cookies-popup {
	border-radius: 16px !important;
	box-shadow: 0 8px 40px rgba(30, 20, 15, 0.12) !important;
	border: 1px solid var(--rotitoo-border-soft) !important;
	max-width: min(420px, calc(100vw - 32px));
}

.wd-cookies-popup .cookies-accept-btn {
	border-radius: 999px !important;
	padding: 10px 24px !important;
	font-weight: 600 !important;
}

/* ─── Scroll to top ─────────────────────────────────────────── */
.scrollToTop {
	border-radius: 50% !important;
	box-shadow: var(--rotitoo-shadow-soft) !important;
	border: 1px solid var(--rotitoo-border-soft) !important;
	transition: transform 0.25s ease, opacity 0.25s ease !important;
}

.scrollToTop:hover {
	transform: translateY(-2px);
}

/* ─── Mobile menu panel ─────────────────────────────────────── */
.wd-side-hidden.wd-mobile-nav {
	transition: transform 0.38s var(--rotitoo-ease) !important;
}

/* ─── Search form ───────────────────────────────────────────── */
.wd-search-form input[type="search"],
.wd-search-form input[type="text"] {
	border-radius: 999px !important;
}

/* ─── Fade-in sections on scroll ────────────────────────────── */
.rotitoo-reveal {
	opacity: 0;
	transform: translateY(16px);
	transition: opacity 0.5s var(--rotitoo-ease), transform 0.5s var(--rotitoo-ease);
}

.rotitoo-reveal.is-visible {
	opacity: 1;
	transform: translateY(0);
}

/* ─── Touch ─────────────────────────────────────────────────── */
@media (max-width: 1024px) {
	a, button, .button {
		touch-action: manipulation;
	}

	.rotitoo-toast {
		font-size: 0.78rem;
		padding: 10px 18px;
	}
}

/* ─── Focus accessibility ───────────────────────────────────── */
.rotitoo-app-shell a:focus-visible,
.rotitoo-app-shell button:focus-visible {
	outline: 2px solid var(--rotitoo-accent);
	outline-offset: 2px;
}
