/**
 * Rotitoo — App-like UX (site-wide)
 * Cart drawer, mobile nav, performance-friendly polish.
 */

: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-app-bar-h: 62px;
}

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

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

/* ─── Add to cart — always visible (desktop + mobile) ───────── */
.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);
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.wd-product .wd-add-btn a:hover {
	transform: scale(1.08);
	box-shadow: 0 6px 20px rgba(220, 175, 155, 0.28);
}

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

/* ─── Cart side panel — app-style sheet ─────────────────────── */
.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-left: 1px solid var(--rotitoo-border-soft);
}

.cart-widget-side .wd-heading {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 18px 20px;
	margin: 0;
	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: 1rem;
	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);
	transition: background 0.2s ease;
}

.cart-widget-side .close-side-widget a:hover {
	background: #f0e8e3;
}

/* Mini cart items */
.cart-widget-side .woocommerce-mini-cart .mini_cart_item {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 10px 12px;
	padding: 16px 20px !important;
	margin: 0 !important;
	border-bottom: 1px solid rgba(230, 215, 205, 0.4);
	background: #fff;
	transition: background 0.2s ease;
}

.cart-widget-side .woocommerce-mini-cart .mini_cart_item:hover {
	background: #fdfbf9 !important;
}

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

.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;
	flex-shrink: 0;
}

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

.cart-widget-side .mini_cart_item .amount,
.cart-widget-side .woocommerce-Price-amount {
	font-weight: 600;
	color: #2c2420;
}

.cart-widget-side .remove {
	top: 14px !important;
	inset-inline-end: 16px !important;
	width: 24px;
	height: 24px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: #f8f4f1 !important;
	color: #9a8580 !important;
	font-size: 14px !important;
	line-height: 1 !important;
	transition: background 0.2s, color 0.2s;
}

.cart-widget-side .remove:hover {
	background: var(--rotitoo-accent-soft) !important;
	color: var(--rotitoo-accent) !important;
}

/* Footer totals + buttons */
.cart-widget-side .shopping-cart-widget-footer {
	padding: 16px 20px 24px !important;
	background: #fff;
	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;
	align-items: center;
	padding: 12px 0 16px !important;
	margin: 0 !important;
	font-size: 0.9rem;
	font-weight: 600;
	color: #2c2420;
	border: none !important;
}

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

.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.06em !important;
	text-transform: uppercase !important;
	text-align: center;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cart-widget-side .woocommerce-mini-cart__buttons .checkout {
	background: #2c2420 !important;
	color: #fff !important;
	border: none !important;
	box-shadow: 0 4px 16px rgba(44, 36, 32, 0.2);
}

.cart-widget-side .woocommerce-mini-cart__buttons .checkout:hover {
	transform: translateY(-1px);
	box-shadow: 0 6px 24px rgba(44, 36, 32, 0.28);
}

.cart-widget-side .woocommerce-mini-cart__buttons .wc-forward:not(.checkout) {
	background: #fff !important;
	color: #2c2420 !important;
	border: 1px solid var(--rotitoo-border-soft) !important;
}

/* Empty cart */
.cart-widget-side .wd-empty-mini-cart {
	text-align: center;
	padding: 40px 24px !important;
}

.cart-widget-side .wd-empty-mini-cart p {
	font-size: 0.9rem;
	color: #9a8580;
	margin-bottom: 20px;
}

.cart-widget-side .wd-empty-mini-cart .btn {
	border-radius: 999px;
	padding: 12px 28px;
	font-weight: 600;
	letter-spacing: 0.05em;
}

/* ─── Header cart icon polish ───────────────────────────────── */
.wd-header-cart .wd-tools-icon {
	transition: transform 0.25s ease;
}

.wd-header-cart:hover .wd-tools-icon {
	transform: scale(1.05);
}

.wd-header-cart .wd-cart-number {
	background: var(--rotitoo-accent) !important;
	font-size: 0.65rem;
	min-width: 18px;
	height: 18px;
	border-radius: 999px;
}

/* ─── Mobile app bottom bar ─────────────────────────────────── */
.rotitoo-app-bar {
	display: none;
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	z-index: 390;
	height: var(--rotitoo-app-bar-h);
	background: rgba(255, 255, 255, 0.96);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	border-top: 1px solid var(--rotitoo-border-soft);
	box-shadow: 0 -4px 24px rgba(200, 160, 140, 0.1);
	padding-bottom: env(safe-area-inset-bottom, 0);
}

.rotitoo-app-bar__inner {
	display: flex;
	align-items: stretch;
	justify-content: space-around;
	height: 100%;
	max-width: 480px;
	margin: 0 auto;
}

.rotitoo-app-bar__item {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 3px;
	padding: 6px 4px;
	color: #9a8580;
	text-decoration: none;
	font-size: 0.62rem;
	font-weight: 500;
	letter-spacing: 0.02em;
	transition: color 0.2s ease;
	border: none;
	background: none;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.rotitoo-app-bar__item svg {
	width: 22px;
	height: 22px;
	stroke: currentColor;
	fill: none;
	stroke-width: 1.75;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.rotitoo-app-bar__item.is-active,
.rotitoo-app-bar__item:active {
	color: var(--rotitoo-accent);
}

.rotitoo-app-bar__item--cart {
	position: relative;
}

.rotitoo-app-bar__badge {
	position: absolute;
	top: 4px;
	right: calc(50% - 22px);
	min-width: 16px;
	height: 16px;
	padding: 0 4px;
	background: var(--rotitoo-accent);
	color: #fff;
	font-size: 0.58rem;
	font-weight: 700;
	border-radius: 999px;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
}

@media (max-width: 1024px) {
	.rotitoo-app-bar {
		display: block;
	}

	body {
		padding-bottom: calc(var(--rotitoo-app-bar-h) + env(safe-area-inset-bottom, 0));
	}

	.wd-sticky-social {
		bottom: calc(var(--rotitoo-app-bar-h) + 12px) !important;
	}

	.scrollToTop {
		bottom: calc(var(--rotitoo-app-bar-h) + 12px) !important;
	}
}

/* ─── Page transitions feel ───────────────────────────────────── */
.website-wrapper {
	animation: rotitooFadeIn 0.35s ease;
}

@keyframes rotitooFadeIn {
	from { opacity: 0.92; }
	to   { opacity: 1; }
}

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

	.wd-product .product-image-link {
		display: block;
	}
}

/* ─── Loading state on add-to-cart ──────────────────────────── */
.wd-add-btn.is-adding a {
	pointer-events: none;
	opacity: 0.6;
}

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

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