/* =========================================================
   Sora & Stone — Stones & Shop Filters
   Uses the theme's design tokens (with fallbacks so it works standalone).
   ========================================================= */

.sas-cf, .sas-stone, .sas-details, .sas-guide, .sas-cf-chips {
	--cf-ink: var(--stone, #3D3530);
	--cf-fg2: var(--fg-2, #5A4F48);
	--cf-fg3: var(--fg-3, #7A6E67);
	--cf-line: var(--mist, #E8E4DF);
	--cf-soft: var(--bg-soft, #FBF8F3);
	--cf-gold: var(--soft-gold, #C9A86B);
	--cf-body: var(--font-body, 'Jost', system-ui, sans-serif);
	--cf-display: var(--font-display, 'Cormorant Garamond', Georgia, serif);
	--cf-ease: var(--ease, cubic-bezier(0.22, 0.61, 0.36, 1));
}

/* ---------- Filter form ---------- */

.sas-cf { font-family: var(--cf-body); }

.sas-cf__status {
	margin: 0 0 4px; padding-bottom: 12px;
	font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--cf-fg3);
	border-bottom: 1px solid var(--cf-line);
}
.sas-cf__status a { color: var(--cf-ink); }

.sas-cf__group summary { list-style: none; }
.sas-cf__group summary::-webkit-details-marker { display: none; }
.sas-cf__n {
	font-style: normal; display: inline-grid; place-items: center;
	min-width: 18px; height: 18px; margin-left: 6px; padding: 0 5px;
	border-radius: 100px; background: var(--cf-ink); color: #fff;
	font-size: 10px; letter-spacing: 0;
}
.sas-cf__plus { position: relative; width: 10px; height: 10px; }
.sas-cf__plus::before, .sas-cf__plus::after {
	content: ''; position: absolute; left: 0; top: 4.5px; width: 10px; height: 1px; background: currentColor;
	transition: transform 220ms var(--cf-ease);
}
.sas-cf__plus::after { transform: rotate(90deg); }
details[open] > summary .sas-cf__plus::after { transform: rotate(0deg); }

.sas-cf__search {
	width: 100%; margin: 12px 0 0; padding: 9px 12px;
	border: 1px solid var(--cf-line); border-radius: 4px; background: #fff;
	font: 13px var(--cf-body); color: var(--cf-ink);
}

.sas-cf__opts { display: flex; flex-direction: column; gap: 2px; padding: 12px 0 2px; }
.sas-cf__opts.is-long:not(.is-expanded) { max-height: 300px; overflow: hidden; mask-image: linear-gradient(#000 80%, transparent); -webkit-mask-image: linear-gradient(#000 80%, transparent); }
.sas-cf__more {
	background: none; border: 0; padding: 6px 0 0; cursor: pointer;
	font: 11px var(--cf-body); letter-spacing: 0.2em; text-transform: uppercase; color: var(--cf-ink); text-decoration: underline;
}
.sas-cf__opts.is-expanded + .sas-cf__more { display: none; }

/* List rows — 40px+ tall touch targets */
.sas-cf__opt {
	display: flex; align-items: center; gap: 10px;
	min-height: 36px; padding: 2px 0;
	font-size: 14px; color: var(--cf-fg2); cursor: pointer;
}
.sas-cf__opt.is-child { padding-left: 22px; }
.sas-cf__opt input { width: 16px; height: 16px; margin: 0; accent-color: var(--cf-ink); flex: none; }
.sas-cf__opt .sas-cf__label { flex: 1; }
.sas-cf__count { font-size: 11px; color: var(--cf-fg3); font-variant-numeric: tabular-nums; }
.sas-cf__opt.is-disabled { opacity: 0.4; cursor: default; }
.sas-cf__opt:not(.is-disabled):hover .sas-cf__label { color: var(--cf-ink); }
.sas-cf__opt input:checked ~ .sas-cf__label { color: var(--cf-ink); font-weight: 500; }

.sas-cf__dot {
	width: 14px; height: 14px; border-radius: 50%; flex: none;
	box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08), 0 0 0 1px #fff;
}

/* Chip-style groups: months, swatches, chips */
.sas-cf__group--months .sas-cf__opts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.sas-cf__group--chips .sas-cf__opts,
.sas-cf__group--swatches .sas-cf__opts { flex-direction: row; flex-wrap: wrap; gap: 6px; }

.sas-cf__group--months .sas-cf__opt,
.sas-cf__group--chips .sas-cf__opt {
	position: relative; justify-content: center; gap: 6px;
	min-height: 38px; padding: 0 12px;
	border: 1px solid var(--cf-line); border-radius: 100px; background: #fff;
	font-size: 12px; letter-spacing: 0.04em;
	transition: border-color 160ms var(--cf-ease), background 160ms var(--cf-ease), color 160ms var(--cf-ease);
}
.sas-cf__group--months .sas-cf__opt { padding: 0; }
.sas-cf__group--months .sas-cf__opt .sas-cf__label,
.sas-cf__group--chips .sas-cf__opt .sas-cf__label { flex: none; }

.sas-cf__group--months input,
.sas-cf__group--chips input,
.sas-cf__group--swatches input {
	position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none;
}
.sas-cf__group--months .sas-cf__opt:has(input:checked),
.sas-cf__group--chips .sas-cf__opt:has(input:checked) {
	background: var(--cf-ink); border-color: var(--cf-ink); color: #fff;
}
.sas-cf__group--months .sas-cf__opt:has(input:checked) .sas-cf__label,
.sas-cf__group--chips .sas-cf__opt:has(input:checked) .sas-cf__label,
.sas-cf__group--chips .sas-cf__opt:has(input:checked) .sas-cf__count { color: #fff; }
.sas-cf__group--months .sas-cf__opt:has(input:focus-visible),
.sas-cf__group--chips .sas-cf__opt:has(input:focus-visible),
.sas-cf__group--swatches .sas-cf__opt:has(input:focus-visible) { outline: 2px solid var(--cf-gold); outline-offset: 2px; }

/* Colour swatches: circles with the name as a tooltip / screen-reader label */
.sas-cf__group--swatches .sas-cf__opt { position: relative; min-height: 0; padding: 3px; border-radius: 50%; border: 1px solid transparent; }
.sas-cf__group--swatches .sas-cf__dot { width: 30px; height: 30px; }
.sas-cf__group--swatches .sas-cf__label {
	position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.sas-cf__group--swatches .sas-cf__opt:has(input:checked) { border-color: var(--cf-ink); }

/* Price */
.sas-cf__price { display: flex; align-items: flex-end; gap: 8px; padding-top: 12px; color: var(--cf-fg3); }
.sas-cf__price label { flex: 1; position: relative; display: flex; flex-direction: column; gap: 4px; }
.sas-cf__price label > span { font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; }
.sas-cf__price i { position: absolute; left: 10px; bottom: 10px; font-style: normal; font-size: 13px; }
.sas-cf__price input {
	width: 100%; padding: 9px 8px 9px 22px; border: 1px solid var(--cf-line); border-radius: 4px; background: #fff;
	font: 14px var(--cf-body); color: var(--cf-ink);
}
.sas-cf__price > span { padding-bottom: 10px; }

/* In-stock switch */
.sas-cf__switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--cf-fg2); cursor: pointer; }
.sas-cf__switch input {
	appearance: none; -webkit-appearance: none; flex: none; order: 2;
	width: 38px; height: 22px; border-radius: 22px; background: var(--cf-line); position: relative; cursor: pointer;
	transition: background 200ms var(--cf-ease);
}
.sas-cf__switch input::after {
	content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff;
	box-shadow: 0 1px 3px rgba(0,0,0,0.2); transition: transform 200ms var(--cf-ease);
}
.sas-cf__switch input:checked { background: var(--cf-ink); }
.sas-cf__switch input:checked::after { transform: translateX(16px); }
.sas-cf__switch input:focus-visible { outline: 2px solid var(--cf-gold); outline-offset: 2px; }

/* "Show N pieces" — sticky at the bottom of the open panel on phones; hidden on desktop once JS is live */
.sas-cf__actions { padding-top: 16px; }
@media (max-width: 879px) {
	.sas-cf__actions {
		position: sticky; bottom: 0; z-index: 2;
		padding: 12px 0 calc(12px + env(safe-area-inset-bottom, 0px));
		background: linear-gradient(to top, var(--bg, #F7F3ED) 75%, transparent);
	}
}
@media (min-width: 880px) {
	.sas-cf-live .sas-cf__actions { display: none; }
}

/* ---------- Active chips above the grid ---------- */

.sas-cf-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.sas-cf-chips:empty { display: none; }
.sas-cf-chip {
	display: inline-flex; align-items: center; gap: 8px;
	padding: 7px 12px 7px 14px; border-radius: 100px;
	background: var(--cf-soft); border: 1px solid var(--cf-line);
	font: 12px var(--cf-body); color: var(--cf-ink); text-decoration: none;
	transition: border-color 160ms var(--cf-ease);
}
.sas-cf-chip:hover { border-color: var(--cf-ink); text-decoration: none; }
.sas-cf-chip span { font-size: 14px; line-height: 1; color: var(--cf-fg3); }
.sas-cf-chip--clear { background: transparent; border-color: transparent; text-decoration: underline; }

.sas-cf-empty { font-family: var(--cf-body); color: var(--cf-fg2); }

/* Loading state while results refresh */
.sas-cf-loading { opacity: 0.45; pointer-events: none; transition: opacity 200ms var(--cf-ease); }

/* ---------- Stone profile ---------- */

.sas-stone {
	display: grid; gap: 24px; align-items: start;
	font-family: var(--cf-body); color: var(--cf-fg2); text-align: left;
}
.sas-stone--archive { max-width: 920px; margin: 32px auto 8px; }
@media (min-width: 700px) {
	.sas-stone { grid-template-columns: minmax(160px, 38%) 1fr; gap: 40px; }
	.sas-stone--product { grid-template-columns: 200px 1fr; }
}
.sas-stone__media { aspect-ratio: 1; border-radius: 4px; overflow: hidden; background: var(--cf-soft); display: grid; place-items: center; }
.sas-stone__img { width: 100%; height: 100%; object-fit: cover; }
.sas-stone__orb {
	width: 58%; aspect-ratio: 1; border-radius: 50%;
	box-shadow: inset -14px -18px 36px rgba(0,0,0,0.22), inset 10px 12px 24px rgba(255,255,255,0.45), 0 10px 30px rgba(61,53,48,0.15);
}
.sas-stone__media .sas-stone__orb { width: 58%; }
@media (max-width: 699px) { .sas-stone__media { max-width: 260px; width: 100%; margin: 0 auto; } }

.sas-stone__name { font-family: var(--cf-display); font-weight: 400; font-size: 30px; color: var(--cf-ink); margin: 0 0 4px; line-height: 1.1; }
.sas-stone__tagline { font-family: var(--cf-display); font-style: italic; font-size: 20px; color: var(--dusty-rose, #B7867A); margin: 0 0 16px; }
.sas-stone__desc, .sas-stone__meaning { font-size: 15px; line-height: 1.7; }
.sas-stone__desc p, .sas-stone__meaning p { margin: 0 0 12px; }
.sas-stone__label { display: block; font-size: 10px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--cf-ink); margin: 4px 0 6px; }

.sas-stone__facts {
	display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
	margin: 20px 0; background: #fff; border: 1px solid var(--cf-line); border-radius: 4px; overflow: hidden;
}
/* Hairlines drawn per cell (right + bottom, clipped at the edges) so a part-filled last row has no grey gaps. */
.sas-stone__facts > div { padding: 12px 14px; box-shadow: 1px 0 0 var(--cf-line), 0 1px 0 var(--cf-line); }
.sas-stone__facts dt { font-size: 10px; letter-spacing: 0.25em; text-transform: uppercase; color: var(--cf-fg3); margin: 0 0 4px; }
.sas-stone__facts dd { margin: 0; font-size: 14px; color: var(--cf-ink); }

.sas-stone__care { border-top: 1px solid var(--cf-line); border-bottom: 1px solid var(--cf-line); padding: 12px 0; margin: 0 0 16px; }
.sas-stone__care summary { cursor: pointer; font-size: 11px; letter-spacing: 0.25em; text-transform: uppercase; color: var(--cf-ink); }
.sas-stone__care p { margin: 12px 0 0; font-size: 14px; line-height: 1.7; }

.sas-stone-section {
	max-width: var(--maxw, 1200px); margin: 64px auto; padding: 48px var(--gutter, 20px) 0;
	border-top: 1px solid var(--cf-line, #E8E4DF); text-align: center;
}
.sas-stone-section .sas-stone { text-align: left; max-width: 920px; margin: 32px auto 0; }
.sas-stone-section .sas-stone + .sas-stone { margin-top: 48px; padding-top: 48px; border-top: 1px solid var(--cf-line, #E8E4DF); }

/* ---------- Details list in the product summary ---------- */

.sas-details { margin: 20px 0; padding: 0; border-top: 1px solid var(--cf-line); font-family: var(--cf-body); }
.sas-details > div { display: flex; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--cf-line); }
.sas-details dt { flex: 0 0 42%; margin: 0; font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--cf-fg3); padding-top: 2px; }
.sas-details dd { margin: 0; font-size: 14px; color: var(--cf-ink); }
.sas-details a { color: inherit; text-decoration: underline; text-decoration-color: var(--cf-line); text-underline-offset: 3px; }
.sas-details a:hover { text-decoration-color: currentColor; }

/* ---------- [sas_stone_guide] ---------- */

.sas-guide { font-family: var(--cf-body); }
.sas-guide__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
@media (min-width: 700px) { .sas-guide__grid { grid-template-columns: repeat(4, 1fr); gap: 28px; } }
.sas-guide__card { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--cf-ink); text-align: center; }
.sas-guide__card:hover { text-decoration: none; }
.sas-guide__media { aspect-ratio: 1; border-radius: 4px; overflow: hidden; background: var(--cf-soft); display: grid; place-items: center; margin-bottom: 8px; transition: transform 300ms var(--cf-ease); }
.sas-guide__card:hover .sas-guide__media { transform: translateY(-2px); }
.sas-guide__media img { width: 100%; height: 100%; object-fit: cover; }
.sas-guide__media .sas-stone__orb { width: 52%; }
.sas-guide__name { font-family: var(--cf-display); font-size: 20px; }
.sas-guide__tag { font-family: var(--cf-display); font-style: italic; font-size: 14px; color: var(--cf-fg3); }
.sas-guide__month { font-size: 10px; letter-spacing: 0.25em; text-transform: uppercase; color: var(--cf-gold); }
.sas-guide__month-row { padding: 32px 0; border-top: 1px solid var(--cf-line); }
.sas-guide__h { font-family: var(--cf-display); font-weight: 400; font-size: 28px; margin: 0 0 20px; }
.sas-guide__h a { color: var(--cf-ink); text-decoration: none; }
