/* Giftablewear Size Guide v2.3
   Size swatches + Size Guide modal.
   Fully scoped; native Woo variation select remains in DOM for WooCommerce logic. */

/* -------------------------------------------------
   SIZE LABEL + SIZE GUIDE
------------------------------------------------- */

.gwsg-trigger-source {
	margin: 6px 0 12px;
}

.gwsg-trigger-source.gwsg-moved {
	display: inline-flex;
	margin: 0 0 0 10px;
	vertical-align: middle;
}

.gwsg-trigger {
	appearance: none;
	display: inline-flex;
	align-items: center;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: inherit;
	font: inherit;
	font-size: 11px;
	line-height: 1.25;
	font-weight: 600;
	cursor: pointer;
}

.gwsg-trigger span {
	border-bottom: 1px solid currentColor;
}

.gwsg-trigger:hover,
.gwsg-trigger:focus-visible {
	opacity: .72;
}

.gwsg-trigger:focus-visible,
.gwsg-close:focus-visible,
.gwsg-size-option:focus-visible {
	outline: 2px solid #17171b;
	outline-offset: 2px;
}

.variations_form .variations .gwsg-size-label-cell {
	white-space: nowrap;
}

.variations_form .variations .gwsg-size-label-cell > label {
	display: inline-block;
	margin: 0;
	vertical-align: middle;
}

/* -------------------------------------------------
   SIZE BUTTONS
------------------------------------------------- */

/* Keep Woo's native select functional, but visually hide only the Size select. */
.variations_form .gwsg-size-value-cell select.gwsg-native-size-select {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
	opacity: 0 !important;
	pointer-events: none !important;
}

.gwsg-size-options {
	display: grid;
	grid-template-columns: repeat(5, minmax(42px, 1fr));
	gap: 7px;
	width: 100%;
	margin: 2px 0 0;
}

.gwsg-size-option {
	appearance: none;
	min-width: 0;
	height: 38px;
	margin: 0;
	padding: 0 8px;
	border: 1px solid #d9dadd;
	border-radius: 0;
	background: #fff;
	color: #30343a;
	font: inherit;
	font-size: 12px;
	line-height: 1;
	font-weight: 600;
	text-align: center;
	cursor: pointer;
	transition:
		border-color .15s ease,
		background-color .15s ease,
		color .15s ease;
}

.gwsg-size-option:hover:not(:disabled) {
	border-color: #17171b;
}

.gwsg-size-option.is-selected {
	border-color: #17171b;
	background: #17171b;
	color: #fff;
}

.gwsg-size-option:disabled,
.gwsg-size-option.is-disabled {
	position: relative;
	opacity: .38;
	cursor: not-allowed;
}

/* Hide WooCommerce "Clear" reset link for the Size-only selector UI. */
.variations_form .reset_variations {
	display: none !important;
}

/* -------------------------------------------------
   SIZE GUIDE MODAL
------------------------------------------------- */

.gwsg-dialog {
	width: min(360px, calc(100vw - 40px));
	max-width: none;
	margin: auto;
	padding: 0;
	border: 0;
	border-radius: 12px;
	background: #fff;
	color: #17171b;
	box-shadow: 0 18px 60px rgba(0, 0, 0, .18);
	overflow: hidden;
}

.gwsg-dialog::backdrop {
	background: rgba(0, 0, 0, .38);
	backdrop-filter: blur(1px);
}

.gwsg-panel {
	padding: 24px 26px 22px;
	box-sizing: border-box;
}

.gwsg-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 18px;
	margin-bottom: 16px;
}

.gwsg-header h2 {
	margin: 0 0 4px !important;
	padding: 0 !important;
	font-family: inherit;
	font-size: 18px !important;
	line-height: 1.25 !important;
	font-weight: 650 !important;
	color: #17171b !important;
}

.gwsg-header p {
	margin: 0 !important;
	padding: 0 !important;
	font-size: 11px !important;
	line-height: 1.35 !important;
	color: #7a7f84 !important;
}

.gwsg-close {
	appearance: none;
	flex: 0 0 30px;
	width: 30px;
	height: 30px;
	margin: -5px -5px 0 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #3d4145;
	font-family: inherit;
	font-size: 23px;
	font-weight: 300;
	line-height: 28px;
	text-align: center;
	cursor: pointer;
}

.gwsg-close:hover {
	background: #f5f5f3;
}

.gwsg-grid {
	width: 228px;
	max-width: 100%;
	margin: 0 auto;
	font-size: 12px;
	line-height: 1.2;
	font-variant-numeric: tabular-nums;
}

.gwsg-row {
	display: grid;
	grid-template-columns: 56px 76px 76px;
	column-gap: 10px;
	align-items: center;
	min-height: 28px;
	border-bottom: 1px solid #ececea;
}

.gwsg-row > span {
	display: block;
	margin: 0;
	padding: 6px 0;
}

.gwsg-row > span:first-child {
	font-weight: 600;
	text-align: left;
}

.gwsg-row > span:nth-child(2),
.gwsg-row > span:nth-child(3) {
	text-align: center;
}

.gwsg-grid-head {
	min-height: 25px;
	font-size: 9px;
	font-weight: 650;
	letter-spacing: .045em;
	text-transform: uppercase;
	color: #777c81;
}

.gwsg-note {
	max-width: 260px;
	margin: 12px auto 0 !important;
	padding: 0 !important;
	font-size: 10px !important;
	line-height: 1.5 !important;
	color: #70757a !important;
}

.gwsg-note strong {
	font-weight: 600;
	color: #50555a;
}

/* -------------------------------------------------
   MOBILE
------------------------------------------------- */

@media (max-width: 689px) {
	.gwsg-trigger-source.gwsg-moved {
		margin-left: 8px;
	}

	.gwsg-trigger {
		font-size: 10.5px;
	}

	.gwsg-size-options {
		grid-template-columns: repeat(5, minmax(0, 1fr));
		gap: 6px;
	}

	.gwsg-size-option {
		height: 36px;
		padding: 0 4px;
		font-size: 11px;
	}

	.gwsg-dialog {
		width: 100%;
		max-width: none;
		max-height: 86vh;
		margin: auto 0 0;
		border-radius: 16px 16px 0 0;
		box-shadow: 0 -10px 40px rgba(0, 0, 0, .16);
	}

	.gwsg-panel {
		padding: 20px 22px calc(18px + env(safe-area-inset-bottom));
		overflow-y: auto;
	}

	.gwsg-header {
		margin-bottom: 13px;
	}

	.gwsg-header h2 {
		font-size: 17px !important;
	}

	.gwsg-grid {
		width: 218px;
		font-size: 11px;
	}

	.gwsg-row {
		grid-template-columns: 52px 73px 73px;
		column-gap: 10px;
		min-height: 27px;
	}

	.gwsg-row > span {
		padding: 5px 0;
	}

	.gwsg-grid-head {
		font-size: 8.5px;
	}

	.gwsg-note {
		margin-top: 10px !important;
		font-size: 9.5px !important;
		line-height: 1.45 !important;
	}
}

/* -------------------------------------------------
   FACTUAL PURCHASE REASSURANCE
------------------------------------------------- */
.gwsg-trust {
	display: grid;
	gap: 7px;
	margin: 18px 0 0;
	padding: 16px 0 0;
	border-top: 1px solid #ececea;
	color: #666b70;
	font-size: 12px;
	line-height: 1.4;
}


.gwsg-trust-item {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin: 0;
	color: #666b70;
	text-decoration: none !important;
}

.gwsg-trust-text {
	border-bottom: 1px solid transparent;
	transition: color .15s ease, border-color .15s ease;
}

.gwsg-trust-item:hover .gwsg-trust-text {
	color: #17171b;
	border-bottom-color: rgba(23, 23, 27, .25);
}

.gwsg-check {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 16px;
	width: 16px;
	height: 16px;
	margin-top: 1px;
	border: 1px solid #17171b;
	border-radius: 50%;
	color: #17171b;
	font-size: 9px;
	line-height: 1;
	font-weight: 700;
}

@media (max-width: 689px) {
	.gwsg-trust {
		gap: 6px;
		margin-top: 15px;
		padding-top: 14px;
		font-size: 11.5px;
	}

}

