/* EZRA SHOP — Transitions. Page fade in/out + add-to-cart toast. RTL-safe. */

/* ---------- Page transition: fade-IN (CSS-only, runs on load) ---------- */
body.ezra-page-trans {
	animation: ezra-pt-fade var(--ezra-pt-dur, 400ms) ease both;
}
body.ezra-page-trans--fade-up {
	animation-name: ezra-pt-fade-up;
}
body.ezra-page-trans--zoom {
	animation-name: ezra-pt-zoom;
}
@keyframes ezra-pt-fade {
	from { opacity: 0; }
	to   { opacity: 1; }
}
@keyframes ezra-pt-fade-up {
	from { opacity: 0; transform: translateY(14px); }
	to   { opacity: 1; transform: none; }
}
@keyframes ezra-pt-zoom {
	from { opacity: 0; transform: scale(0.985); }
	to   { opacity: 1; transform: none; }
}

/* fade-OUT on internal navigation (JS adds .ezra-leaving) */
body.ezra-leaving {
	animation: ezra-pt-leave var(--ezra-pt-dur, 400ms) ease both;
}
@keyframes ezra-pt-leave {
	from { opacity: 1; }
	to   { opacity: 0; transform: translateY(-8px); }
}

/* Respect users who prefer no motion. */
@media (prefers-reduced-motion: reduce) {
	body.ezra-page-trans,
	body.ezra-leaving {
		animation: none !important;
	}
}

/* ---------- Skeleton (wireframe) loading overlay ---------- */
.ezra-skel {
	position: fixed;
	inset: 0;
	z-index: 999999;
	background: #fff;
	overflow: hidden;
	padding: 28px 24px;
	direction: rtl;
}
.ezra-skel-wrap {
	max-width: 1180px;
	margin: 0 auto;
}
.ezra-skel-block {
	display: block;
	background: var(--ezra-skel-color, #e9e9e9);
	border-radius: 8px;
	position: relative;
	overflow: hidden;
}
/* the recurring colour-sweep that signals loading */
.ezra-skel-block::after {
	content: "";
	position: absolute;
	inset: 0;
	transform: translateX(-100%);
	background: linear-gradient( 90deg, transparent, rgba(255, 255, 255, 0.7), transparent );
	animation: ezra-skel-shimmer 1.3s infinite;
}
@keyframes ezra-skel-shimmer {
	100% { transform: translateX(100%); }
}
@media (prefers-reduced-motion: reduce) {
	.ezra-skel-block::after { animation: none; }
}

/* archive wireframe */
.ezra-skel-toolbar {
	height: 46px;
	border-radius: 999px;
	max-width: 440px;
	margin: 0 auto 30px;
}
.ezra-skel-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 26px;
}
.ezra-skel-card { display: flex; flex-direction: column; gap: 12px; }
.ezra-skel-cardimg { height: 240px; border-radius: 12px; }
.ezra-skel-cardline { height: 15px; width: 85%; }
.ezra-skel-cardline.short { width: 45%; }

/* product wireframe */
.ezra-skel-product { display: flex; gap: 44px; flex-wrap: wrap; }
.ezra-skel-gallery { flex: 1 1 360px; height: 480px; border-radius: 14px; }
.ezra-skel-info { flex: 1 1 300px; display: flex; flex-direction: column; gap: 18px; padding-top: 12px; }
.ezra-skel-title { height: 34px; width: 70%; }
.ezra-skel-price { height: 28px; width: 38%; }
.ezra-skel-btn { height: 50px; width: 210px; border-radius: 999px; margin: 6px 0; }
.ezra-skel-text { height: 14px; width: 100%; }
.ezra-skel-text.short { width: 55%; }

/* generic wireframe */
.ezra-skel-generic { display: flex; flex-direction: column; gap: 20px; }
.ezra-skel-hero { height: 300px; border-radius: 14px; }

@media (max-width: 782px) {
	.ezra-skel { padding: 18px 14px; }
	.ezra-skel-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
	.ezra-skel-cardimg { height: 150px; }
	.ezra-skel-product { gap: 22px; }
	.ezra-skel-gallery { flex-basis: 100%; height: 320px; }
	.ezra-skel-hero { height: 200px; }
}

/* ---------- Add-to-cart toast ---------- */
.ezra-cart-toast {
	position: fixed;
	z-index: 100002;
	display: inline-flex;
	align-items: center;
	gap: 14px;
	max-width: calc(100vw - 32px);
	background: var(--ezra-trans-accent, #111);
	color: #fff;
	font-family: 'Assistant', sans-serif;
	font-size: 0.95rem;
	font-weight: 600;
	line-height: 1.3;
	padding: 13px 20px;
	border-radius: 12px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
	opacity: 0;
	transition: opacity 0.3s ease, transform 0.3s ease;
}
.ezra-cart-toast-link {
	color: #fff;
	text-decoration: underline;
	font-weight: 700;
	white-space: nowrap;
}
.ezra-cart-toast-link:hover {
	color: #fff;
	opacity: 0.85;
}

/* Hide WooCommerce's default inline "View cart" link (opt-in via the setting). */
body.ezra-hide-wc-cart-msg a.added_to_cart {
	display: none !important;
}

/* ---------- Built-in side cart (slides in from the left) ---------- */
.ezra-sidecart {
	position: fixed;
	inset: 0;
	z-index: 100005;
}
.ezra-sidecart[hidden] {
	display: none;
}
.ezra-sidecart-overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.45);
	opacity: 0;
	transition: opacity 0.3s ease;
}
.ezra-sidecart.is-open .ezra-sidecart-overlay {
	opacity: 1;
}
.ezra-sidecart-panel {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	width: min(420px, 90vw);
	background: #fff;
	box-shadow: 0 0 40px rgba(0, 0, 0, 0.25);
	transform: translateX(-100%);
	transition: transform 0.32s ease;
	display: flex;
	flex-direction: column;
	font-family: 'Assistant', sans-serif;
}
.ezra-sidecart.is-open .ezra-sidecart-panel {
	transform: translateX(0);
}
.ezra-sidecart-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 18px 20px;
	border-bottom: 1px solid #eee;
}
.ezra-sidecart-title {
	font-size: 1.2rem;
	font-weight: 800;
	color: #111;
}
.ezra-sidecart-close {
	background: none;
	border: 0;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	color: #111;
}
.ezra-sidecart-body {
	flex: 1 1 auto;
	overflow: auto;
	padding: 16px 20px;
	color: #111;
}
.ezra-sidecart-body .woocommerce-mini-cart__buttons .button {
	border-radius: 999px;
}
.ezra-sidecart-body .woocommerce-mini-cart__buttons .checkout {
	background: var(--ezra-trans-accent, #111);
	color: #fff;
}

/* Positions + entrance offset (resets to 0 on .is-visible) */
.ezra-cart-toast--bottom-end {
	bottom: 24px;
	inset-inline-end: 24px;
	transform: translateY(16px);
}
.ezra-cart-toast--bottom-center {
	bottom: 24px;
	left: 50%;
	transform: translate(-50%, 16px);
}
.ezra-cart-toast--top-center {
	top: 24px;
	left: 50%;
	transform: translate(-50%, -16px);
}
.ezra-cart-toast.is-visible {
	opacity: 1;
}
.ezra-cart-toast--bottom-end.is-visible {
	transform: translateY(0);
}
.ezra-cart-toast--bottom-center.is-visible,
.ezra-cart-toast--top-center.is-visible {
	transform: translate(-50%, 0);
}

@media (max-width: 600px) {
	.ezra-cart-toast--bottom-end {
		inset-inline-end: 16px;
		bottom: 16px;
	}
	.ezra-cart-toast--bottom-center,
	.ezra-cart-toast--top-center {
		width: calc(100vw - 28px);
		justify-content: center;
	}
}
