/* PP WooCommerce Product Options — frontend styles */

/* Size guide trigger button */
.pp-size-guide-trigger-wrap {
	box-sizing: border-box;
	margin: 20px 0;
}

.pp-size-guide-trigger {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: none;
	border: none;
	padding: 0;
	color: #2c6aa0;
	text-decoration: none;
	cursor: pointer;
	font-size: 0.95em;
}

.pp-size-guide-trigger:hover {
	color: #1a4a75;
}

.pp-size-guide-trigger .dashicons {
	font-size: 18px;
	width: 18px;
	height: 18px;
}

/* Modal */
.pp-modal {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 100000;
}

.pp-modal.pp-modal--open {
	display: block;
}

.pp-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba( 0, 0, 0, 0.6 );
}

.pp-modal__dialog {
	position: relative;
	background: #fff;
	max-width: 640px;
	width: 92%;
	margin: 5vh auto;
	max-height: 88vh;
	overflow-y: auto;
	padding: 32px 32px 28px;
	border-radius: 4px;
	box-shadow: 0 10px 40px rgba( 0, 0, 0, 0.25 );
}

.pp-modal__close {
	position: absolute;
	top: 14px;
	right: 18px;
	background: none;
	border: none;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	color: #222;
}

.pp-modal__title {
	margin-top: 0;
	margin-bottom: 1em;
	padding-right: 24px;
}

/* Size guide dialog — header, unit toggle, tabs */
.pp-size-guide-dialog {
	max-width: 720px;
	padding-top: 28px;
}

.pp-size-guide-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 20px;
}

.pp-size-guide-title {
	margin: 0;
	font-size: 28px;
	font-weight: 800;
	color: #111;
	line-height: 1.1;
}

.pp-unit-toggle {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	flex: 0 0 auto;
	margin-right: 28px;
}

.pp-unit-toggle__label {
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.03em;
	color: #999;
	cursor: default;
	transition: color 0.15s ease;
}

.pp-unit-toggle__label.is-active {
	color: #111;
}

.pp-unit-switch {
	position: relative;
	flex: 0 0 auto;
	width: 44px;
	height: 24px;
	border: none;
	border-radius: 999px;
	background: #ccc;
	padding: 0;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.pp-unit-switch[aria-checked="true"] {
	background: #111;
}

.pp-unit-switch__thumb {
	position: absolute;
	top: 3px;
	left: 3px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 3px rgba( 0, 0, 0, 0.3 );
	transition: transform 0.2s ease;
}

.pp-unit-switch[aria-checked="true"] .pp-unit-switch__thumb {
	transform: translateX( 20px );
}

.pp-size-guide-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 20px;
	padding-bottom: 4px;
}

.pp-size-guide-tab {
	background: #ececec;
	border: none;
	border-radius: 999px;
	padding: 8px 18px;
	margin-right: 0;
	font-size: 13px;
	font-weight: 700;
	color: #555;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.pp-size-guide-tab:hover {
	background: #dcdcdc;
}

.pp-size-guide-tab.is-active {
	background: #111;
	color: #fff;
}

.pp-size-guide-tab.is-active:hover {
	background: #111;
}

.pp-size-guide-section {
	display: none;
}

.pp-size-guide-section.is-active {
	display: block;
}

.pp-size-guide-note {
	font-size: 16px;
	font-weight: 700;
	color: #111;
	margin: 0 0 16px;
	line-height: 1.4;
}

.pp-size-guide-note strong {
	font-weight: 800;
}

.pp-size-guide-table-wrap {
	overflow-x: auto;
}

.pp-size-guide-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
}

.pp-size-guide-dialog[data-pp-unit="cm"] .pp-size-guide-table.pp-unit-in,
.pp-size-guide-dialog[data-pp-unit="in"] .pp-size-guide-table.pp-unit-cm {
	display: none;
}

.pp-size-guide-table th {
	background: #111;
	color: #fff;
	text-transform: uppercase;
	font-size: 12px;
	letter-spacing: 0.03em;
	padding: 12px 10px;
	text-align: center;
	font-weight: 700;
}

.pp-size-guide-table td {
	padding: 12px 10px;
	text-align: center;
	border-bottom: 1px solid #eee;
}

.pp-size-guide-table tbody tr:nth-child(even) {
	background: #efefef;
}

.pp-size-guide-table tbody tr:nth-child(odd) {
	background: #f8f8f8;
}

.pp-size-guide-table td:first-child {
	font-weight: 600;
}

.pp-size-guide-extra {
	margin-top: 20px;
}

.pp-size-guide-image img {
	max-width: 100%;
	height: auto;
	margin-bottom: 1em;
}

.pp-size-guide-content table {
	width: 100%;
	border-collapse: collapse;
}

.pp-size-guide-content table th,
.pp-size-guide-content table td {
	border: 1px solid #ddd;
	padding: 6px 10px;
	text-align: center;
}

.pp-size-guide-content table th {
	background: #f5f5f5;
}

@media ( max-width: 600px ) {
	.pp-size-guide-header {
		flex-wrap: wrap;
	}

	.pp-unit-toggle {
		margin-right: 0;
	}
}

/* Embroidery / embellishment box(es) */
.pp-embellishment-subheading {
	font-size: 15px;
	font-weight: 700;
	color: #111;
	margin: 20px 0 0;
}

.pp-embellishment-boxes {
	display: grid;
	/* Fits 2 per row; each track never narrower than 150px, and never
	   narrower than half the row (so it caps at 2 columns, not 3+),
	   collapsing to a single column on narrow summaries automatically. */
	grid-template-columns: repeat( auto-fit, minmax( max( 150px, calc( 50% - 5px ) ), 1fr ) );
	gap: 10px;
	margin: 8px 0 20px;
}

.pp-embellishment-box {
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	justify-content: flex-start;
	gap: 6px;
	background: #f8f8f8;
	border: 1px solid #e5e5e5;
	border-radius: 4px;
	padding: 12px 10px;
	width: 100%;
}

.pp-embellishment-box__position {
	display: inline-block;
	margin: 0 0 2px;
	padding: 4px 10px;
	background: #111;
	color: #fff;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.pp-embellishment-box * {
	box-sizing: border-box;
}

.pp-embellishment-box__content {
	width: 100%;
}

.pp-embellishment-box__image img {
	display: block;
	margin: 0 auto;
	max-width: 48px;
	height: auto;
	border-radius: 2px;
}

.pp-embellishment-box__label {
	margin: 0 0 4px;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.3;
}

.pp-embellishment-box__text-field {
	margin: 0 auto;
	max-width: 100%;
}

.pp-embellishment-box__text-field label {
	display: block;
	margin-bottom: 4px;
	font-size: 12px;
	font-weight: 500;
	text-align: center;
}

.pp-embellishment-box__text-field input[type="text"] {
	width: 100%;
	max-width: 100%;
	text-align: center;
}

@media ( max-width: 420px ) {
	.pp-embellishment-boxes {
		grid-template-columns: 1fr;
	}
}
