/* =========================================================
   SS Brochure Fan Gallery
   ========================================================= */

.sbf-widget {
	--sbf-max-width: 720px;
	--sbf-card-w: 130px;
	--sbf-card-h: 190px;
	--sbf-angle: 11deg;
	--sbf-offset: 26px;
	--sbf-card-radius: 8px;
	--sbf-accent_color: #ff6a1a;
	--sbf-bg_color: transparent;
	--sbf-text_dark: #231a1a;
	--sbf-text_muted: #7a7a7a;
	--sbf-modal-w: 420px;
	--sbf-modal-radius: 14px;
	--sbf-overlay: rgba(20,14,10,0.72);
	--sbf-anim-duration: 700ms;
	--sbf-anim-stagger: 80ms;

	position: relative;
	direction: rtl;
	font-family: inherit;
	background: var(--sbf-bg_color);
}
.sbf-widget *, .sbf-widget *::before, .sbf-widget *::after { box-sizing: border-box; }
.sbf-widget img { max-width: 100%; display: block; }
.sbf-widget button { font-family: inherit; }

.sbf-inner {
	max-width: var(--sbf-max-width);
	margin: 0 auto;
	padding: 34px 16px 26px;
	text-align: center;
}

/* ---------- Heading ---------- */
.sbf-heading { margin-bottom: 6px; }
.sbf-heading-top { display: block; font-size: 14px; color: var(--sbf-text_dark); font-weight: 500; }
.sbf-heading-main { font-size: clamp(30px, 5vw, 42px); font-weight: 900; color: var(--sbf-accent_color); line-height: 1.15; margin: 2px 0; }
.sbf-heading-bottom { display: block; font-size: 14px; color: var(--sbf-text_dark); font-weight: 500; }

/* ---------- Fan layout ---------- */
.sbf-fan-wrap { position: relative; padding: 26px 10px 8px; overflow-x: auto; overflow-y: visible; }
.sbf-fan {
	position: relative;
	height: calc(var(--sbf-card-h) + 40px);
	display: flex;
	align-items: flex-end;
	justify-content: center;
}
.sbf-slot {
	position: absolute;
	bottom: 6px;
	left: 50%;
	width: var(--sbf-card-w);
	height: var(--sbf-card-h);
	transform-origin: 50% 100%;
	transform:
		translateX(calc(-50% + (var(--dist)) * var(--sbf-offset)))
		rotate(calc(var(--dist) * var(--sbf-angle)));
	z-index: calc(30 - (var(--dist) * var(--dist)));
}

.sbf-card {
	all: unset;
	display: block;
	width: 100%;
	height: 100%;
	border-radius: var(--sbf-card-radius);
	overflow: hidden;
	cursor: pointer;
	box-shadow: 0 10px 24px rgba(30,15,5,0.22), 0 2px 6px rgba(30,15,5,0.12);
	background: #fff;
	border: 3px solid #fff;
	transition: opacity var(--sbf-anim-duration) cubic-bezier(.22,.9,.32,1),
	            transform var(--sbf-anim-duration) cubic-bezier(.22,.9,.32,1),
	            box-shadow .25s ease;
}
.sbf-card:hover { box-shadow: 0 16px 32px rgba(30,15,5,0.3), 0 4px 10px rgba(30,15,5,0.16); }
.sbf-card img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- CTA ---------- */
.sbf-cta { margin-top: 14px; }
.sbf-cta-btn {
	display: inline-block;
	padding: 11px 34px;
	border-radius: 999px;
	background: var(--sbf-accent_color);
	color: #fff;
	font-weight: 700;
	font-size: 14px;
	font-style: italic;
	transition: transform .2s ease, box-shadow .2s ease;
	box-shadow: 0 8px 20px rgba(255,106,26,0.35);
}
.sbf-cta-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(255,106,26,0.45); }

/* =========================================================
   ENTRANCE ANIMATION — rise-up + 3 selectable styles
   ========================================================= */
.sbf-reveal { transition: opacity var(--sbf-anim-duration) ease, transform var(--sbf-anim-duration) ease; }
.sbf-heading.sbf-reveal, .sbf-cta.sbf-reveal { opacity: 0; transform: translateY(20px); }
.sbf-heading.sbf-in-view, .sbf-cta.sbf-in-view { opacity: 1; transform: translateY(0); }

/* The card's static fan position lives on .sbf-slot (never animated).
   The card itself only animates opacity + an extra rise offset, layered
   on top of the slot's rotate/offset transform via translateY + scale. */
.sbf-card.sbf-reveal { opacity: 0; }

/* rise-fan: unfold outward from the center card first */
.sbf-widget[data-anim-style="rise-fan"] .sbf-card.sbf-reveal { transform: translateY(90px) scale(0.82) rotate(0deg); }
.sbf-widget[data-anim-style="rise-fan"] .sbf-card.sbf-in-view { opacity: 1; transform: translateY(0) scale(1) rotate(0deg); }

/* rise-sequential: left to right using --i */
.sbf-widget[data-anim-style="rise-sequential"] .sbf-card.sbf-reveal { transform: translateY(70px) scale(0.9); }
.sbf-widget[data-anim-style="rise-sequential"] .sbf-card.sbf-in-view { opacity: 1; transform: translateY(0) scale(1); transition-delay: calc(var(--sbf-anim-stagger) * var(--i, 0)); }

/* rise-bounce: overshoot easing */
.sbf-widget[data-anim-style="rise-bounce"] .sbf-card.sbf-reveal { transform: translateY(110px) scale(0.75); }
.sbf-widget[data-anim-style="rise-bounce"] .sbf-card { transition-timing-function: cubic-bezier(.34,1.56,.64,1); }
.sbf-widget[data-anim-style="rise-bounce"] .sbf-card.sbf-in-view { opacity: 1; transform: translateY(0) scale(1); }

/* Generic per-card stagger (used by rise-fan and rise-bounce, based on
   distance-from-center via inline --dist; JS also sets a computed
   --abs-dist custom property so CSS can stagger outward from the middle) */
.sbf-widget[data-anim-style="rise-fan"] .sbf-card.sbf-in-view,
.sbf-widget[data-anim-style="rise-bounce"] .sbf-card.sbf-in-view {
	transition-delay: calc(var(--sbf-anim-stagger) * var(--abs-dist, 0));
}

@media (prefers-reduced-motion: reduce) {
	.sbf-reveal { transition: none !important; opacity: 1 !important; transform: none !important; }
}

/* =========================================================
   LIGHTBOX MODAL
   ========================================================= */
.sbf-modal {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	opacity: 0;
	visibility: hidden;
	transition: opacity .3s ease, visibility .3s ease;
}
.sbf-modal.sbf-modal-open { opacity: 1; visibility: visible; }
.sbf-modal-overlay { position: absolute; inset: 0; background: var(--sbf-overlay); backdrop-filter: blur(3px); }
.sbf-modal-box {
	position: relative;
	z-index: 2;
	width: 100%;
	max-width: var(--sbf-modal-w);
	max-height: 88vh;
	overflow-y: auto;
	background: #fff;
	border-radius: var(--sbf-modal-radius);
	padding: 18px 18px 24px;
	transform: scale(0.88) translateY(20px);
	opacity: 0;
	transition: transform .35s cubic-bezier(.2,.8,.3,1.2), opacity .3s ease;
}
.sbf-modal.sbf-modal-open .sbf-modal-box { transform: scale(1) translateY(0); opacity: 1; }
.sbf-modal-close {
	all: unset;
	position: absolute;
	top: 10px;
	left: 10px;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: #f1eeee;
	color: var(--sbf-text_dark);
	font-size: 20px;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background .2s ease;
}
.sbf-modal-close:hover { background: #e6e2e2; }
.sbf-modal-image { border-radius: calc(var(--sbf-modal-radius) - 6px); overflow: hidden; margin-bottom: 16px; }
.sbf-modal-image img { width: 100%; height: auto; }
.sbf-modal-footer { text-align: center; }
.sbf-modal-title { font-size: 16px; font-weight: 700; color: var(--sbf-text_dark); margin-bottom: 12px; }
.sbf-modal-order-btn {
	display: inline-block;
	padding: 11px 30px;
	border-radius: 999px;
	background: var(--sbf-accent_color);
	color: #fff;
	font-weight: 700;
	font-size: 14px;
	transition: transform .2s ease, box-shadow .2s ease;
	box-shadow: 0 8px 20px rgba(255,106,26,0.3);
}
.sbf-modal-order-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(255,106,26,0.4); }

body.sbf-lock-scroll { overflow: hidden; }

/* =========================================================
   RESPONSIVE — the fan itself scales down on tablet/mobile via
   the responsive size/angle/offset controls above (no override
   needed here). An optional "flat scrolling strip" layout is
   available for very small screens by turning on the
   "mobile_flat_mode" style switcher, which sets data-mobile-mode="strip".
   ========================================================= */
@media (max-width: 640px) {
	.sbf-widget[data-mobile-mode="strip"] .sbf-fan-wrap { padding: 20px 6px 10px; -webkit-overflow-scrolling: touch; }
	.sbf-widget[data-mobile-mode="strip"] .sbf-fan {
		position: relative;
		height: auto;
		width: max-content;
		min-width: 100%;
		justify-content: flex-start;
		gap: 14px;
		padding: 0 8px;
	}
	.sbf-widget[data-mobile-mode="strip"] .sbf-slot {
		position: relative;
		bottom: auto;
		left: auto;
		transform: none !important;
		z-index: 1 !important;
		flex: none;
	}
	.sbf-widget[data-mobile-mode="strip"][data-anim-style] .sbf-card.sbf-reveal { transform: translateY(40px) scale(0.94) !important; }
	.sbf-widget[data-mobile-mode="strip"][data-anim-style] .sbf-card.sbf-in-view { transform: translateY(0) scale(1) !important; transition-delay: calc(var(--sbf-anim-stagger) * var(--i, 0)) !important; }
	.sbf-widget[data-mobile-mode="strip"] .sbf-card { box-shadow: 0 8px 18px rgba(30,15,5,0.18); }
	.sbf-modal-box { max-width: 92vw; }
}
