/* =========================================================================
   Shiwora FAQ & Subscribe — frontend widget
   Warm, handmade aesthetic. Colour + position come from inline CSS vars
   (--sfs-accent, --sfs-offset) set per the admin settings.
   ========================================================================= */
.sfs-widget {
	--sfs-accent: #c2185b;
	--sfs-offset: 45%;
	--sfs-ink: #2a2326;
	--sfs-muted: #8a7d82;
	--sfs-line: #efe4e7;
	--sfs-card: #fffdfc;
	position: fixed;
	top: var(--sfs-offset);
	transform: translateY(-50%);
	z-index: 99998;
	font-family: inherit;
	line-height: 1.5;
}
.sfs-widget * { box-sizing: border-box; }
.sfs-side-right { right: var(--sfs-edge, 18px); }
.sfs-side-left  { left: var(--sfs-edge, 18px); }

/* ---------- Launcher ---------- */
.sfs-launcher {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	border: none;
	cursor: pointer;
	padding: 12px 16px;
	border-radius: 999px;
	background: var(--sfs-accent);
	background: linear-gradient(135deg, var(--sfs-accent), color-mix(in srgb, var(--sfs-accent) 70%, #ff7e5f));
	color: #fff;
	box-shadow: 0 10px 26px -8px color-mix(in srgb, var(--sfs-accent) 60%, transparent), 0 2px 6px rgba(0,0,0,.12);
	font-size: 14px;
	font-weight: 700;
	font-family: inherit;
	transition: transform .2s cubic-bezier(.2,.8,.2,1), box-shadow .2s ease;
}
.sfs-side-left .sfs-launcher { flex-direction: row-reverse; }
.sfs-launcher:hover { transform: translateY(-2px) scale(1.02); }
.sfs-launcher:active { transform: translateY(0) scale(.99); }

.sfs-launcher__label {
	max-width: 0;
	overflow: hidden;
	white-space: nowrap;
	opacity: 0;
	transition: max-width .35s cubic-bezier(.2,.8,.2,1), opacity .25s ease;
}
.sfs-launcher:hover .sfs-launcher__label,
.sfs-widget[data-open="true"] .sfs-launcher__label { max-width: 200px; opacity: 1; }

.sfs-launcher__icon { display: inline-flex; position: relative; width: 26px; height: 26px; }
.sfs-launcher__icon svg { position: absolute; inset: 0; margin: auto; transition: opacity .2s ease, transform .3s ease; }
.sfs-icon-close { opacity: 0; transform: rotate(-45deg); }
.sfs-widget[data-open="true"] .sfs-icon-open { opacity: 0; transform: rotate(45deg); }
.sfs-widget[data-open="true"] .sfs-icon-close { opacity: 1; transform: rotate(0); }

/* Bell ring — periodic wobble to draw attention (stops when open) */
.sfs-bell { transform-origin: 50% 4px; }
@keyframes sfsRing {
	0%, 58%, 100% { transform: rotate(0); }
	62% { transform: rotate(16deg); }
	66% { transform: rotate(-13deg); }
	70% { transform: rotate(10deg); }
	74% { transform: rotate(-7deg); }
	78% { transform: rotate(4deg); }
	82% { transform: rotate(-2deg); }
}
.sfs-widget:not([data-open="true"]) .sfs-bell { animation: sfsRing 3.6s ease-in-out infinite; }

/* New-notification count badge */
.sfs-badge {
	position: absolute;
	top: -8px;
	right: -8px;
	min-width: 19px;
	height: 19px;
	padding: 0 5px;
	border-radius: 999px;
	background: #ff3b30;
	color: #fff;
	border: 2px solid #fff;
	font-size: 11px;
	font-weight: 800;
	line-height: 15px;
	text-align: center;
	box-shadow: 0 2px 6px rgba(0,0,0,.25);
	z-index: 3;
}
.sfs-badge[hidden] { display: none; }

/* ---------- Promo bubble (attention for non-subscribers) ---------- */
.sfs-promo {
	position: absolute;
	bottom: calc(100% + 12px);
	max-width: 232px;
	background: #fff;
	color: var(--sfs-ink);
	border: 1px solid var(--sfs-line);
	border-radius: 14px;
	padding: 12px 32px 12px 14px;
	box-shadow: 0 14px 32px -12px rgba(42,35,38,.5);
	font-size: 13.5px;
	font-weight: 600;
	line-height: 1.45;
	cursor: pointer;
	opacity: 0;
	transition: opacity .3s ease;
	animation: sfsPromoBob 2.4s ease-in-out infinite;
}
.sfs-promo.is-in { opacity: 1; }
.sfs-promo[hidden] { display: none; }
.sfs-side-right .sfs-promo { right: 0; }
.sfs-side-left  .sfs-promo { left: 0; }
.sfs-promo::after {
	content: "";
	position: absolute;
	bottom: -7px;
	width: 14px;
	height: 14px;
	background: #fff;
	border-right: 1px solid var(--sfs-line);
	border-bottom: 1px solid var(--sfs-line);
	transform: rotate(45deg);
}
.sfs-side-right .sfs-promo::after { right: 24px; }
.sfs-side-left  .sfs-promo::after { left: 24px; }
.sfs-promo__close {
	position: absolute;
	top: 4px;
	right: 6px;
	width: 22px;
	height: 22px;
	border: none;
	background: transparent;
	color: var(--sfs-muted);
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	border-radius: 50%;
	z-index: 2;
}
.sfs-promo__close:hover { background: rgba(0,0,0,.06); color: var(--sfs-ink); }
@keyframes sfsPromoBob {
	0%, 100% { transform: translateY(0); }
	50% { transform: translateY(-5px); }
}

/* ---------- Panel ---------- */
.sfs-panel {
	position: fixed;
	top: 50%;
	transform: translateY(-50%);
	width: 340px;
	max-width: calc(100vw - 36px);
	max-height: min(78vh, 580px);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	background: var(--sfs-card);
	border: 1px solid var(--sfs-line);
	border-radius: 20px;
	box-shadow: 0 24px 60px -20px rgba(42,35,38,.45), 0 8px 22px -16px rgba(0,0,0,.25);
	animation: sfsPanelIn .28s cubic-bezier(.2,.9,.3,1);
}
.sfs-side-right .sfs-panel { right: 18px; }
.sfs-side-left  .sfs-panel { left: 18px; }
/* The panel uses display:flex, which would otherwise override the [hidden]
   attribute. This makes hidden truly hide it (closed by default + close button). */
.sfs-panel[hidden] { display: none; }
@keyframes sfsPanelIn {
	from { opacity: 0; transform: translateY(-50%) scale(.96); }
	to   { opacity: 1; transform: translateY(-50%) scale(1); }
}

.sfs-panel__close {
	position: absolute;
	top: 8px;
	right: 10px;
	width: 36px;
	height: 36px;
	border: none;
	background: rgba(0,0,0,.06);
	color: var(--sfs-muted);
	border-radius: 50%;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	z-index: 5;
	touch-action: manipulation;
	transition: background .2s, color .2s;
}
.sfs-panel__close:hover { background: rgba(0,0,0,.08); color: var(--sfs-ink); }

/* Tabs */
.sfs-tabs {
	display: flex;
	gap: 4px;
	flex: 0 0 auto;
	padding: 14px 14px 0;
	background: linear-gradient(180deg, color-mix(in srgb, var(--sfs-accent) 10%, #fff), transparent);
}
.sfs-tab {
	flex: 1;
	border: none;
	background: transparent;
	padding: 10px 4px;
	font-size: 12.5px;
	font-weight: 700;
	font-family: inherit;
	color: var(--sfs-muted);
	cursor: pointer;
	white-space: nowrap;
	border-radius: 10px 10px 0 0;
	border-bottom: 2px solid transparent;
	transition: color .2s, border-color .2s;
}
.sfs-tab.is-active { color: var(--sfs-accent); border-bottom-color: var(--sfs-accent); }
.sfs-tab--link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	text-decoration: none;
}
.sfs-tab--link::after {
	content: "↗";
	font-size: 11px;
	margin-left: 3px;
	opacity: .6;
}
.sfs-tab--link:hover { color: var(--sfs-accent); }

.sfs-tabpanel {
	padding: 20px;
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
}
.sfs-tabpanel.is-hidden { display: none; }
.sfs-tabpanel::-webkit-scrollbar { width: 8px; }
.sfs-tabpanel::-webkit-scrollbar-track { background: transparent; }
.sfs-tabpanel::-webkit-scrollbar-thumb {
	background: color-mix(in srgb, var(--sfs-accent) 35%, #d9d2d5);
	border-radius: 8px;
	border: 2px solid transparent;
	background-clip: padding-box;
}
.sfs-tabpanel { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--sfs-accent) 35%, #d9d2d5) transparent; }

.sfs-panel__title { font-size: 17px; font-weight: 800; margin: 6px 0 14px; color: var(--sfs-ink); padding-right: 24px; }

/* Accordion */
.sfs-accordion { display: flex; flex-direction: column; gap: 8px; }
.sfs-acc { border: 1px solid var(--sfs-line); border-radius: 12px; overflow: hidden; background: #fff; }
.sfs-acc__q {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	text-align: left;
	border: none;
	background: transparent;
	padding: 13px 14px;
	font-size: 14px;
	font-weight: 600;
	font-family: inherit;
	color: var(--sfs-ink);
	cursor: pointer;
}
.sfs-acc__chevron { color: var(--sfs-muted); flex: 0 0 auto; transition: transform .25s ease; }
.sfs-acc.is-open .sfs-acc__chevron { transform: rotate(180deg); }
.sfs-acc__a { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.sfs-acc.is-open .sfs-acc__a { max-height: 600px; }
.sfs-acc__a-inner { padding: 0 14px 14px; font-size: 13.5px; line-height: 1.65; color: #5b5054; }
.sfs-acc__a-inner p { margin: 0 0 8px; }
.sfs-acc__a-inner p:last-child { margin-bottom: 0; }

.sfs-empty { color: var(--sfs-muted); font-size: 14px; text-align: center; padding: 18px 0; }

/* Notifications feed */
.sfs-notifs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.sfs-notif__link {
	display: flex;
	gap: 12px;
	align-items: center;
	padding: 10px;
	border-radius: 12px;
	text-decoration: none;
	color: inherit;
	transition: background .15s ease;
}
.sfs-notif__link:hover { background: color-mix(in srgb, var(--sfs-accent) 8%, #fff); }
.sfs-notif__thumb {
	width: 46px;
	height: 46px;
	border-radius: 10px;
	object-fit: cover;
	flex: 0 0 auto;
	background: #f3eef0;
}
.sfs-notif__thumb--ph { display: grid; place-items: center; color: var(--sfs-accent); }
.sfs-notif__info { display: flex; flex-direction: column; min-width: 0; }
.sfs-notif__type {
	font-size: 10.5px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: .6px;
	color: var(--sfs-accent);
}
.sfs-notif__title {
	font-size: 14px;
	font-weight: 600;
	color: var(--sfs-ink);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.sfs-notif__time { font-size: 12px; color: var(--sfs-muted); }

/* Subscribe */
.sfs-sub__intro { font-size: 13.5px; line-height: 1.6; color: #5b5054; margin: 0 0 16px; }
.sfs-sub-field {
	display: flex;
	align-items: center;
	gap: 8px;
	border: 1.5px solid var(--sfs-line);
	border-radius: 12px;
	padding: 10px 12px;
	margin-bottom: 12px;
	color: var(--sfs-muted);
	transition: border-color .2s, box-shadow .2s;
}
.sfs-sub-field:focus-within {
	border-color: var(--sfs-accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--sfs-accent) 16%, transparent);
}
.sfs-sub-field svg { flex: 0 0 auto; }
.sfs-sub-field input {
	border: none;
	outline: none;
	background: transparent;
	font-size: 14px;
	font-family: inherit;
	width: 100%;
	color: var(--sfs-ink);
}
.sfs-sub-btn {
	width: 100%;
	border: none;
	cursor: pointer;
	padding: 12px 16px;
	border-radius: 12px;
	background: var(--sfs-accent);
	background: linear-gradient(135deg, var(--sfs-accent), color-mix(in srgb, var(--sfs-accent) 70%, #ff7e5f));
	color: #fff;
	font-size: 14.5px;
	font-weight: 700;
	font-family: inherit;
	transition: transform .15s ease, filter .2s ease;
}
.sfs-sub-btn:hover { filter: brightness(1.04); transform: translateY(-1px); }
.sfs-sub-btn:disabled { opacity: .65; cursor: default; transform: none; }
.sfs-sub-msg { font-size: 13px; margin: 10px 0 0; min-height: 1em; }
.sfs-sub-msg.is-ok { color: #1eaf5d; }
.sfs-sub-msg.is-err { color: #d23f3f; }

/* ============================================================
   FAQ PAGE  ([sfs_faqs] shortcode)
   ============================================================ */
.sfs-faqpage {
	--sfs-accent: #c2185b;
	--sfs-ink: #2a2326;
	--sfs-muted: #8a7d82;
	--sfs-line: #efe4e7;
	--sfs-card: #fffdfc;
	max-width: 820px;
	margin: 0 auto;
	font-family: inherit;
	color: var(--sfs-ink);
}
.sfs-faqpage * { box-sizing: border-box; }

.sfs-faqpage__head {
	text-align: center;
	padding: 34px 20px 30px;
	margin-bottom: 22px;
	border-radius: 22px;
	background:
		radial-gradient(120% 120% at 50% -20%, color-mix(in srgb, var(--sfs-accent) 14%, #fff), transparent 60%),
		linear-gradient(180deg, color-mix(in srgb, var(--sfs-accent) 8%, #fff), #fff);
	border: 1px solid var(--sfs-line);
}
.sfs-faqpage__eyebrow {
	display: inline-block;
	font-size: 12px;
	font-weight: 800;
	letter-spacing: 1.5px;
	text-transform: uppercase;
	color: #fff;
	background: var(--sfs-accent);
	padding: 5px 14px;
	border-radius: 999px;
	margin-bottom: 14px;
}
.sfs-faqpage__title {
	font-size: clamp(26px, 4vw, 38px);
	line-height: 1.15;
	margin: 0 0 10px;
	color: var(--sfs-ink);
}
.sfs-faqpage__intro {
	font-size: 16px;
	color: var(--sfs-muted);
	margin: 0 auto;
	max-width: 560px;
}

.sfs-faqpage__list { display: flex; flex-direction: column; gap: 12px; }
.sfs-faqpage .sfs-acc {
	border: 1px solid var(--sfs-line);
	border-radius: 16px;
	background: var(--sfs-card);
	box-shadow: 0 1px 2px rgba(42,35,38,.04), 0 14px 30px -22px rgba(42,35,38,.4);
	overflow: hidden;
	transition: box-shadow .2s ease, border-color .2s ease;
}
.sfs-faqpage .sfs-acc.is-open { border-color: color-mix(in srgb, var(--sfs-accent) 45%, var(--sfs-line)); }
.sfs-faqpage .sfs-acc__q {
	font-size: 16.5px;
	font-weight: 700;
	padding: 18px 22px;
	color: var(--sfs-ink);
}
.sfs-faqpage .sfs-acc__chevron { color: var(--sfs-accent); }
.sfs-faqpage .sfs-acc__a-inner {
	padding: 0 22px 20px;
	font-size: 15px;
	line-height: 1.7;
	color: #5b5054;
}
.sfs-faqpage .sfs-acc__a-inner a {
	color: var(--sfs-accent);
	text-decoration: underline;
	font-weight: 600;
}
.sfs-faqpage .sfs-acc__a-inner a:hover { text-decoration: none; }
.sfs-faqpage__empty { text-align: center; color: var(--sfs-muted); padding: 30px 0; }

/* ---------- Mobile: stable bottom-anchored button + bottom-sheet panel ---------- */
@media (max-width: 600px) {
	/* Anchor to the bottom in pixels so it never drifts while scrolling. */
	.sfs-widget {
		top: auto;
		bottom: var(--sfs-m-bottom, 24px);
		transform: none;
	}
	.sfs-widget[data-mside="right"] { right: var(--sfs-m-edge, 14px); left: auto; }
	.sfs-widget[data-mside="left"]  { left: var(--sfs-m-edge, 14px); right: auto; }

	/* Full-width bottom sheet. The compound selectors override the
	   desktop side-anchoring rules (same specificity, later in source). */
	.sfs-side-right .sfs-panel,
	.sfs-side-left .sfs-panel {
		position: fixed;
		top: auto;
		left: 12px;
		right: 12px;
		bottom: calc(var(--sfs-m-bottom, 24px) + 62px);
		width: auto;
		max-width: none;
		max-height: 68vh;
		transform: none;
		animation: sfsSheetIn .26s cubic-bezier(.2,.9,.3,1);
	}
	@keyframes sfsSheetIn {
		from { opacity: 0; transform: translateY(16px); }
		to   { opacity: 1; transform: translateY(0); }
	}
}

@media (prefers-reduced-motion: reduce) {
	.sfs-launcher, .sfs-panel, .sfs-acc__chevron, .sfs-acc__a, .sfs-bell, .sfs-promo { animation: none !important; transition: none !important; }
}
