/* OFD Size Guide — front end */

/*
 * Button rules use !important on purpose: many themes (and Elementor) style
 * every <button> inside form.cart (full width, borders, big font). These
 * rules keep the size guide button compact and exactly as set in Settings.
 */

.ofdsg-wrap,
form.cart .ofdsg-wrap,
.elementor .ofdsg-wrap {
	display: flex !important;
	flex-direction: row !important;
	flex-wrap: nowrap !important;
	align-items: center !important;
	justify-content: var(--ofdsg-btn-align, flex-start) !important;
	flex: 0 0 100% !important;
	width: 100% !important;
	max-width: 100% !important;
	margin: 0 0 var(--ofdsg-btn-space, 14px) !important;
	padding: 0 !important;
	background: none !important;
	border: 0 !important;
	clear: both;
}

.ofdsg-wrap button.ofdsg-btn,
.ofdsg-wrap button.ofdsg-btn:visited,
form.cart .ofdsg-wrap button.ofdsg-btn,
.elementor .ofdsg-wrap button.ofdsg-btn {
	-webkit-appearance: none !important;
	appearance: none !important;
	display: inline-flex !important;
	flex: 0 0 auto !important;
	align-items: center !important;
	justify-content: center !important;
	gap: 6px !important;
	float: none !important;
	position: relative !important;
	width: auto !important;
	min-width: 0 !important;
	max-width: 100% !important;
	height: auto !important;
	min-height: 0 !important;
	margin: 0 !important;
	padding: var(--ofdsg-btn-pad, 7px 14px) !important;
	border: 0 !important;
	border-radius: var(--ofdsg-btn-radius, 4px) !important;
	outline: 0;
	background: var(--ofdsg-btn-bg, #000) !important;
	background-image: none !important;
	color: var(--ofdsg-btn-color, #fff) !important;
	font-family: inherit !important;
	font-size: var(--ofdsg-btn-size, 12px) !important;
	font-style: normal !important;
	font-weight: 600 !important;
	line-height: 1.2 !important;
	letter-spacing: var(--ofdsg-btn-tracking, 0.08em) !important;
	text-align: center !important;
	text-transform: var(--ofdsg-btn-transform, uppercase) !important;
	text-decoration: none !important;
	text-shadow: none !important;
	white-space: nowrap !important;
	box-shadow: none !important;
	opacity: 1 !important;
	cursor: pointer;
	transition: background-color .2s ease, color .2s ease, transform .2s ease, box-shadow .2s ease !important;
}

.ofdsg-wrap.ofdsg-wrap--full button.ofdsg-btn {
	width: 100% !important;
}

.ofdsg-wrap button.ofdsg-btn:hover,
.ofdsg-wrap button.ofdsg-btn:focus,
form.cart .ofdsg-wrap button.ofdsg-btn:hover,
form.cart .ofdsg-wrap button.ofdsg-btn:focus {
	background: var(--ofdsg-btn-bg-hover, #333) !important;
	color: var(--ofdsg-btn-color-hover, #fff) !important;
	border: 0 !important;
}

.ofdsg-wrap button.ofdsg-btn:hover {
	transform: translateY(-1px);
	box-shadow: 0 6px 16px -8px rgba(0, 0, 0, .55) !important;
}

.ofdsg-wrap button.ofdsg-btn:focus-visible {
	outline: 2px solid var(--ofdsg-btn-bg, #000) !important;
	outline-offset: 3px !important;
}

.ofdsg-wrap button.ofdsg-btn::before,
.ofdsg-wrap button.ofdsg-btn::after {
	display: none !important;
	content: none !important;
}

.ofdsg-wrap .ofdsg-btn .ofdsg-btn__icon {
	display: inline-block !important;
	flex: 0 0 auto !important;
	width: 1.15em !important;
	height: 1.15em !important;
	margin: 0 !important;
	fill: none;
	vertical-align: middle;
}

.ofdsg-wrap .ofdsg-btn .ofdsg-btn__text {
	display: inline !important;
	margin: 0 !important;
	padding: 0 !important;
	color: inherit !important;
	font: inherit !important;
	letter-spacing: inherit !important;
	text-transform: inherit !important;
}

/* ------------------------------------------------------------------ */
/* Modal                                                               */
/* ------------------------------------------------------------------ */

.ofdsg-modal[hidden] {
	display: none !important;
}

.ofdsg-modal {
	position: fixed;
	inset: 0;
	z-index: 2147483000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	box-sizing: border-box;
	font-family: inherit;
}

.ofdsg-modal *,
.ofdsg-modal *::before,
.ofdsg-modal *::after {
	box-sizing: border-box;
}

.ofdsg-modal__overlay {
	position: absolute;
	inset: 0;
	background: var(--ofdsg-overlay, rgba(0, 0, 0, .72));
	-webkit-backdrop-filter: blur(3px);
	backdrop-filter: blur(3px);
	opacity: 0;
	transition: opacity .25s ease;
}

.ofdsg-modal__dialog {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: var(--ofdsg-modal-width, 760px);
	max-height: calc(100vh - 48px);
	max-height: calc(100dvh - 48px);
	background: #fff;
	color: #111;
	border-radius: var(--ofdsg-modal-radius, 12px);
	box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .55);
	overflow: hidden;
	opacity: 0;
	transform: translateY(18px) scale(.98);
	transition: opacity .28s ease, transform .32s cubic-bezier(.2, .8, .2, 1);
}

.ofdsg-modal.is-open .ofdsg-modal__overlay {
	opacity: 1;
}

.ofdsg-modal.is-open .ofdsg-modal__dialog {
	opacity: 1;
	transform: none;
}

.ofdsg-modal__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 16px 18px 16px 24px;
	background: var(--ofdsg-head-bg, #000);
	color: var(--ofdsg-head-color, #fff);
	flex: 0 0 auto;
}

.ofdsg-modal .ofdsg-modal__title {
	margin: 0;
	padding: 0;
	color: inherit;
	font-family: inherit;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: .12em;
	text-transform: uppercase;
	border: 0;
}

.ofdsg-modal .ofdsg-modal__close {
	-webkit-appearance: none;
	width: 38px !important;
	height: 38px !important;
	padding: 0 !important;
	font-size: 0 !important;
	appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	min-width: 38px;
	margin: 0;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, .25);
	border-color: color-mix(in srgb, currentColor 30%, transparent);
	border-radius: 50%;
	background: transparent;
	color: inherit;
	line-height: 1;
	cursor: pointer;
	box-shadow: none;
	transition: background-color .2s ease, transform .25s ease;
}

.ofdsg-modal .ofdsg-modal__close:hover,
.ofdsg-modal .ofdsg-modal__close:focus {
	background: rgba(255, 255, 255, .14);
	background: color-mix(in srgb, currentColor 15%, transparent);
	color: inherit;
	transform: rotate(90deg);
}

.ofdsg-modal .ofdsg-modal__close:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* Tabs */
.ofdsg-tabs {
	display: flex;
	gap: 6px;
	padding: 14px 24px 0;
	flex: 0 0 auto;
	overflow-x: auto;
	scrollbar-width: none;
}

.ofdsg-tabs::-webkit-scrollbar {
	display: none;
}

.ofdsg-modal .ofdsg-tab {
	-webkit-appearance: none;
	appearance: none;
	margin: 0;
	padding: 8px 16px;
	border: 1px solid #e3e3e3;
	border-radius: 999px;
	background: #fff;
	color: #333;
	font-family: inherit;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .06em;
	text-transform: uppercase;
	line-height: 1.2;
	white-space: nowrap;
	cursor: pointer;
	box-shadow: none;
	transition: all .2s ease;
}

.ofdsg-modal .ofdsg-tab:hover {
	border-color: #111;
	color: #111;
	background: #fff;
}

.ofdsg-modal .ofdsg-tab.is-active {
	background: #111;
	border-color: #111;
	color: #fff;
}

.ofdsg-modal .ofdsg-tab:focus-visible {
	outline: 2px solid #111;
	outline-offset: 2px;
}

/* Body */
.ofdsg-modal__body {
	flex: 1 1 auto;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
	padding: 20px 24px 24px;
}

.ofdsg-panel[hidden] {
	display: none;
}

.ofdsg-panel.is-active {
	animation: ofdsg-fade .3s ease;
}

.ofdsg-figure {
	margin: 0;
	padding: 0;
	border-radius: 8px;
	background: #fafafa;
	overflow: hidden;
	line-height: 0;
}

.ofdsg-figure--zoomable {
	cursor: zoom-in;
}

.ofdsg-modal .ofdsg-img {
	display: block;
	width: 100%;
	max-width: 100%;
	height: auto;
	margin: 0 auto;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	transition: width .3s ease;
}

.ofdsg-figure.is-zoomed {
	cursor: zoom-out;
	overflow: auto;
	max-height: 70vh;
	-webkit-overflow-scrolling: touch;
}

.ofdsg-figure.is-zoomed .ofdsg-img {
	width: 200%;
	max-width: none;
}

.ofdsg-hint {
	margin: 10px 0 0;
	color: #8a8a8a;
	font-size: 12px;
	line-height: 1.4;
	text-align: center;
}

@media (hover: hover) and (min-width: 768px) {
	.ofdsg-hint {
		display: none;
	}
}

.ofdsg-note {
	margin-top: 16px;
	padding: 14px 16px;
	border-left: 3px solid #111;
	border-radius: 0 6px 6px 0;
	background: #f6f6f6;
	color: #333;
	font-size: 14px;
	line-height: 1.6;
}

.ofdsg-note p {
	margin: 0 0 .5em;
}

.ofdsg-note p:last-child {
	margin-bottom: 0;
}

/* Body scroll lock */
html.ofdsg-locked,
html.ofdsg-locked body {
	overflow: hidden !important;
}

/* Mobile: bottom sheet */
@media (max-width: 600px) {
	.ofdsg-modal {
		align-items: flex-end;
		padding: 0;
	}

	.ofdsg-modal__dialog {
		max-width: 100%;
		max-height: 92vh;
		max-height: 92dvh;
		border-radius: var(--ofdsg-modal-radius, 12px) var(--ofdsg-modal-radius, 12px) 0 0;
		transform: translateY(100%);
	}

	.ofdsg-modal__head {
		padding: 14px 14px 14px 18px;
	}

	.ofdsg-tabs {
		padding: 12px 18px 0;
	}

	.ofdsg-modal__body {
		padding: 16px 18px calc(20px + env(safe-area-inset-bottom));
	}
}

@keyframes ofdsg-fade {
	from { opacity: 0; }
	to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
	.ofdsg-btn,
	.ofdsg-modal__overlay,
	.ofdsg-modal__dialog,
	.ofdsg-modal .ofdsg-modal__close,
	.ofdsg-modal .ofdsg-img {
		transition: none !important;
	}

	.ofdsg-panel.is-active {
		animation: none;
	}
}

/* Keep popup controls safe from theme button styles too. */
.ofdsg-modal button.ofdsg-modal__close {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	width: 38px !important;
	min-width: 38px !important;
	height: 38px !important;
	min-height: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 1px solid rgba(255, 255, 255, .25) !important;
	border-color: color-mix(in srgb, currentColor 30%, transparent) !important;
	border-radius: 50% !important;
	background: transparent !important;
	color: inherit !important;
	box-shadow: none !important;
	font-size: 0 !important;
	line-height: 1 !important;
}

.ofdsg-modal button.ofdsg-modal__close:hover,
.ofdsg-modal button.ofdsg-modal__close:focus {
	background: rgba(255, 255, 255, .14) !important;
	background: color-mix(in srgb, currentColor 15%, transparent) !important;
	color: inherit !important;
}

.ofdsg-modal button.ofdsg-modal__close svg {
	width: 20px !important;
	height: 20px !important;
}

.ofdsg-modal button.ofdsg-tab {
	width: auto !important;
	min-width: 0 !important;
	height: auto !important;
	min-height: 0 !important;
	margin: 0 !important;
	padding: 8px 16px !important;
	border: 1px solid #e3e3e3 !important;
	border-radius: 999px !important;
	background: #fff !important;
	color: #333 !important;
	font-family: inherit !important;
	font-size: 12px !important;
	font-weight: 600 !important;
	letter-spacing: .06em !important;
	line-height: 1.2 !important;
	text-transform: uppercase !important;
	box-shadow: none !important;
}

.ofdsg-modal button.ofdsg-tab:hover {
	border-color: #111 !important;
	color: #111 !important;
}

.ofdsg-modal button.ofdsg-tab.is-active {
	background: #111 !important;
	border-color: #111 !important;
	color: #fff !important;
}
