/* ==========================================================================
   Size guide popup (inc/size-guide.php, assets/js/size-guide.js).
   Phones: a sheet that slides up from the bottom. 768px and up: a compact
   centred window. Uses the site's own fonts, magenta and square corners.
   ========================================================================== */

.ad-sg {
	--sg-accent: var(--wd-primary-color, #c01157);
	--sg-ink: #1a1a1a;
	--sg-muted: #6f6f6f;
	--sg-line: #e8e3e5;
	--sg-tint: #f7f2f4;
	--sg-title: var(--wd-title-font, "Rosarivo", Georgia, serif);
	--sg-text: var(--wd-text-font, "Karla", Arial, sans-serif);

	position: fixed;
	inset: auto 0 0 0;
	margin: 0;
	padding: 0;
	border: 0;
	width: 100%;
	max-width: 100%;
	max-height: 88vh;
	max-height: 88dvh;
	background: #fff;
	color: var(--sg-ink);
	font-family: var(--sg-text);
	font-size: 14px;
	line-height: 1.5;
	overflow: hidden;
	transform: translateY(100%);
	transition: transform .28s cubic-bezier(.2, .8, .2, 1), opacity .2s ease;
	box-shadow: 0 -8px 30px rgba(0, 0, 0, .12);
}

html .ad-sg {
	margin: 0;
}

.ad-sg[open] {
	display: flex;
	flex-direction: column;
}

.ad-sg.is-open {
	transform: none;
}

.ad-sg.is-dragging {
	transition: none;
}

.ad-sg::backdrop {
	background: rgba(20, 14, 17, .5);
}

html.ad-sg-lock,
html.ad-sg-lock body {
	overflow: hidden;
}

@media (min-width: 768px) {
	html .ad-sg {
		inset: 0;
		margin: auto;
		width: min(520px, calc(100vw - 48px));
		height: fit-content;
		max-height: min(86vh, 780px);
		opacity: 0;
		transform: translateY(12px);
		box-shadow: 0 20px 60px rgba(0, 0, 0, .2);
	}
	.ad-sg.is-open {
		opacity: 1;
		transform: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ad-sg {
		transition: none;
	}
}

.ad-sg__sheet {
	display: flex;
	flex-direction: column;
	min-height: 0;
	max-height: inherit;
	width: 100%;
}

/* Resets: keep the theme's global button/select/table styles out. */
.ad-sg button,
.ad-sg select {
	font-family: var(--sg-text);
	text-transform: none;
	letter-spacing: normal;
	box-shadow: none;
}

.ad-sg .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* Header ------------------------------------------------------------------ */

.ad-sg__head {
	position: relative;
	flex: none;
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 22px 16px 14px 20px;
	border-bottom: 1px solid var(--sg-line);
	touch-action: none;
}

.ad-sg__handle {
	position: absolute;
	top: 8px;
	left: 50%;
	width: 40px;
	height: 4px;
	margin-left: -20px;
	border-radius: 2px;
	background: #d8d2d5;
}

@media (min-width: 768px) {
	.ad-sg__head {
		padding-top: 20px;
		touch-action: auto;
	}
	.ad-sg__handle {
		display: none;
	}
}

.ad-sg__heading {
	flex: 1;
	min-width: 0;
}

.ad-sg .ad-sg__title {
	margin: 0;
	font-family: var(--sg-title);
	font-size: 22px;
	font-weight: 400;
	line-height: 1.2;
	color: var(--sg-ink);
	text-transform: none;
}

.ad-sg__product {
	margin: 2px 0 0;
	font-size: 13px;
	color: var(--sg-muted);
}

.ad-sg .ad-sg__close {
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	min-height: 0;
	margin: -8px -6px 0 0;
	padding: 0;
	border: 0;
	background: none;
	color: var(--sg-ink);
	cursor: pointer;
}

.ad-sg__close svg {
	width: 20px;
	height: 20px;
}

.ad-sg .ad-sg__close:hover,
.ad-sg .ad-sg__close:focus-visible {
	color: var(--sg-accent);
	background: none;
}

/* Body -------------------------------------------------------------------- */

.ad-sg__body {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
	padding: 16px 20px 20px;
}

.ad-sg__units {
	display: inline-flex;
	border: 1px solid var(--sg-ink);
}

.ad-sg .ad-sg__units button {
	min-width: 36px;
	min-height: 0;
	height: 28px;
	padding: 0 8px;
	border: 0;
	background: #fff;
	color: var(--sg-ink);
	font-size: 13px;
	font-weight: 600;
	line-height: 28px;
	cursor: pointer;
}

.ad-sg .ad-sg__units button[aria-pressed="true"] {
	background: var(--sg-ink);
	color: #fff;
}

/* Bra size finder --------------------------------------------------------- */

.ad-sg__finder {
	margin-bottom: 18px;
	padding: 14px 16px;
	background: var(--sg-tint);
}

.ad-sg__finder-title {
	margin: 0 0 10px;
	font-family: var(--sg-title);
	font-size: 16px;
	color: var(--sg-ink);
}

.ad-sg__selects {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
}

.ad-sg__select {
	display: block;
	margin: 0;
}

.ad-sg .ad-sg__select select {
	width: 100%;
	height: 42px;
	padding: 0 34px 0 12px;
	border: 1px solid #d9d2d5;
	border-radius: 0;
	background-color: #fff;
	color: var(--sg-ink);
	font-size: 15px;
}

.ad-sg__result:not(:empty) {
	margin-top: 12px;
	font-size: 14px;
	line-height: 1.45;
}

.ad-sg__result strong {
	color: var(--sg-accent);
}

.ad-sg .ad-sg__choose {
	display: inline-block;
	margin-top: 10px;
	min-height: 0;
	height: 36px;
	padding: 0 16px;
	border: 1px solid var(--sg-accent);
	background: var(--sg-accent);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .04em;
	text-transform: uppercase;
	line-height: 34px;
	cursor: pointer;
}

.ad-sg .ad-sg__choose:hover {
	background: #9c0d46;
	border-color: #9c0d46;
}

/* Table ------------------------------------------------------------------- */

.ad-sg__table-wrap {
	margin: 0 -4px;
}

.ad-sg .ad-sg__table {
	width: 100%;
	margin: 0;
	border: 0;
	border-collapse: collapse;
	table-layout: fixed;
	font-size: 14px;
}

.ad-sg .ad-sg__table th,
.ad-sg .ad-sg__table td {
	padding: 9px 4px;
	border: 0;
	border-bottom: 1px solid var(--sg-line);
	background: none;
	color: var(--sg-ink);
	font-family: var(--sg-text);
	font-size: 14px;
	font-weight: 400;
	line-height: 1.3;
	letter-spacing: normal;
	text-align: center;
	text-transform: none;
	vertical-align: middle;
	transition: background-color .15s ease;
}

.ad-sg .ad-sg__table thead th {
	padding-top: 6px;
	padding-bottom: 8px;
	border-bottom: 1px solid var(--sg-ink);
	font-weight: 700;
	font-size: 15px;
}

.ad-sg .ad-sg__table .ad-sg__unit-head {
	width: 36%;
	text-align: left;
	padding-left: 4px;
}

.ad-sg .ad-sg__table tbody th[scope="row"] {
	text-align: left;
	padding-left: 4px;
	color: var(--sg-muted);
	font-size: 13px;
}

.ad-sg .ad-sg__table .ad-sg__group-row th {
	padding: 16px 4px 6px;
	text-align: left;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--sg-ink);
}

.ad-sg .ad-sg__group:first-of-type .ad-sg__group-row th {
	padding-top: 10px;
}

.ad-sg__group-hint {
	display: block;
	margin-top: 2px;
	font-size: 12px;
	font-weight: 400;
	letter-spacing: normal;
	text-transform: none;
	color: var(--sg-muted);
}

.ad-sg__tag {
	display: inline-block;
	margin-left: 6px;
	padding: 1px 6px;
	border: 1px solid var(--sg-accent);
	color: var(--sg-accent);
	font-size: 10px;
	letter-spacing: .06em;
	vertical-align: 1px;
}

.ad-sg__fit-main {
	display: block;
	font-weight: 700;
	white-space: nowrap;
}

.ad-sg__fit-alt {
	display: block;
	margin-top: 1px;
	font-size: 11.5px;
	color: var(--sg-muted);
	line-height: 1.35;
}

.ad-sg__empty {
	color: #b5b0b2;
}

.ad-sg .ad-sg__table .is-selected {
	background: var(--sg-tint);
}

.ad-sg .ad-sg__table thead th.is-selected {
	color: var(--sg-accent);
	box-shadow: inset 0 -2px 0 var(--sg-accent);
}

.ad-sg .ad-sg__table thead th.is-match::after {
	content: "";
	display: block;
	width: 6px;
	height: 6px;
	margin: 3px auto 0;
	border-radius: 50%;
	background: var(--sg-accent);
}

.ad-sg[data-unit="cm"] .ad-sg__in,
.ad-sg[data-unit="in"] .ad-sg__cm {
	display: none;
}

/* "Being confirmed" state ------------------------------------------------- */

.ad-sg__pending {
	display: flex;
	gap: 14px;
	align-items: flex-start;
	padding: 16px;
	background: var(--sg-tint);
}

.ad-sg__pending p {
	margin: 0;
}

.ad-sg__pending-icon {
	flex: none;
	width: 28px;
	height: 28px;
	color: var(--sg-accent);
}

/* Tips -------------------------------------------------------------------- */

.ad-sg .ad-sg__tips {
	margin: 18px 0 0;
	padding: 0;
	list-style: none;
}

.ad-sg .ad-sg__tips li {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	margin: 0;
	padding: 8px 0;
	font-size: 13.5px;
	line-height: 1.45;
	color: #4a4a4a;
}

.ad-sg__tip-icon {
	flex: none;
	width: 22px;
	height: 22px;
	margin-top: -1px;
	color: var(--sg-accent);
}

.ad-sg__tip-icon svg,
.ad-sg__pending-icon svg {
	display: block;
	width: 100%;
	height: 100%;
}

/* How to measure ---------------------------------------------------------- */

.ad-sg__measure {
	margin-top: 10px;
	border-top: 1px solid var(--sg-line);
	border-bottom: 1px solid var(--sg-line);
}

.ad-sg__measure summary {
	position: relative;
	padding: 14px 28px 14px 0;
	font-family: var(--sg-title);
	font-size: 16px;
	color: var(--sg-ink);
	cursor: pointer;
	list-style: none;
}

.ad-sg__measure summary::-webkit-details-marker {
	display: none;
}

.ad-sg__measure summary::after {
	content: "+";
	position: absolute;
	right: 4px;
	top: 50%;
	transform: translateY(-50%);
	font-family: var(--sg-text);
	font-size: 22px;
	font-weight: 300;
	color: var(--sg-accent);
}

.ad-sg__measure[open] summary::after {
	content: "\2212";
}

.ad-sg__measure-inner {
	display: grid;
	grid-template-columns: 112px 1fr;
	gap: 14px;
	padding: 4px 0 16px;
}

@media (min-width: 768px) {
	.ad-sg__measure-inner {
		grid-template-columns: 128px 1fr;
		gap: 20px;
	}
}

.ad-sg__figure {
	width: 100%;
	height: auto;
}

.ad-sg__silhouette {
	fill: none;
	stroke: #3a3a3a;
	stroke-width: 1.3;
	stroke-linecap: round;
}

.ad-sg__line {
	stroke: var(--sg-accent);
	stroke-width: 1.3;
	stroke-dasharray: 3 3;
}

.ad-sg__dot {
	fill: var(--sg-accent);
}

.ad-sg__num {
	fill: #fff;
	font-family: var(--sg-text);
	font-size: 11px;
	font-weight: 700;
	text-anchor: middle;
}

.ad-sg .ad-sg__steps {
	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: sgstep;
}

.ad-sg .ad-sg__steps li {
	position: relative;
	margin: 0 0 9px;
	padding-left: 26px;
	font-size: 13px;
	line-height: 1.45;
	color: #4a4a4a;
	counter-increment: sgstep;
}

.ad-sg .ad-sg__steps li::before {
	content: counter(sgstep);
	position: absolute;
	left: 0;
	top: 1px;
	width: 17px;
	height: 17px;
	border-radius: 50%;
	background: var(--sg-accent);
	color: #fff;
	font-size: 10px;
	font-weight: 700;
	line-height: 17px;
	text-align: center;
}

.ad-sg__steps strong {
	display: block;
	color: var(--sg-ink);
}

.ad-sg__measure-hint {
	grid-column: 1 / -1;
	margin: 0;
	font-size: 12px;
	color: var(--sg-muted);
}

.ad-sg__note {
	margin-top: 16px;
	padding-left: 12px;
	border-left: 2px solid var(--sg-accent);
	font-size: 13px;
	color: #4a4a4a;
}

.ad-sg__note p:last-child {
	margin-bottom: 0;
}

/* Footer ------------------------------------------------------------------ */

.ad-sg__foot {
	flex: none;
	padding: 12px 20px;
	padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
	border-top: 1px solid var(--sg-line);
	background: #fff;
}

.ad-sg .ad-sg__wa {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	height: 44px;
	background: var(--sg-accent);
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .04em;
	text-transform: uppercase;
	text-decoration: none;
	transition: background-color .15s ease;
}

.ad-sg .ad-sg__wa:hover,
.ad-sg .ad-sg__wa:focus-visible {
	background: #9c0d46;
	color: #fff;
}

.ad-sg__wa svg {
	width: 18px;
	height: 18px;
}

.ad-sg__disclaimer {
	margin: 8px 0 0;
	font-size: 11.5px;
	color: var(--sg-muted);
	text-align: center;
}

.ad-sg :focus-visible {
	outline: 2px solid var(--sg-accent);
	outline-offset: 2px;
}
