/* YB Product Guides storefront table and modal. */
/* Table colors and spacing follow the Yonex theme tokens when available. */

.ybpg-guide-content {
	min-width: 0;
}

.ybpg-guide-section + .ybpg-guide-section {
	margin-top: var(--space-xl, 2rem);
	padding-top: var(--space-lg, 1.5rem);
	border-top: var(--border-default, 1px solid #d9dde2);
}

.ybpg-guide-section-title {
	margin: 0 0 var(--space-md, 1rem);
}

.ybpg-guide-intro {
	margin: 0 0 var(--space-md, 1rem);
}

.ybpg-guide-intro > *:last-child {
	margin-bottom: 0;
}

.ybpg-guide-image-wrap {
	margin: var(--space-md, 1rem) 0;
}

.ybpg-guide-image {
	display: block;
	max-width: 100%;
	height: auto;
	border-radius: var(--radius-xs, 4px);
}

.ybpg-table-shell {
	min-width: 0;
	max-width: 100%;
	border: var(--border-default, 1px solid #e7eaee);
	border-radius: var(--radius-sm, 8px);
	background: var(--color-white, #fff);
	overflow: hidden;
}

.ybpg-table-overflow-hint {
	margin: 0;
	padding: 0.45rem 0.7rem;
	background: var(--color-surface-blue, #eef5fb);
	color: var(--color-text-muted, #555);
	font-size: 0.85em;
}

.ybpg-table-scroll {
	max-width: 100%;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.ybpg-table-scroll:focus-visible {
	outline: 2px solid var(--color-brand-blue, #006bb6);
	outline-offset: -2px;
}

.ybpg-size-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.92em;
}

.ybpg-size-table caption {
	padding: 0.55rem 0.65rem;
	text-align: left;
	font-weight: var(--font-weight-semibold, 600);
	white-space: normal;
	overflow-wrap: break-word;
}

.ybpg-size-table th,
.ybpg-size-table td {
	padding: 0.55rem 0.65rem;
	border-right: var(--border-default, 1px solid #e7eaee);
	border-bottom: var(--border-default, 1px solid #e7eaee);
	text-align: center;
	vertical-align: middle;
	white-space: nowrap;
}

.ybpg-size-table tr > :last-child {
	border-right: 0;
}

.ybpg-size-table tbody tr:last-child > * {
	border-bottom: 0;
}

.ybpg-size-table thead th {
	background: var(--top-bar-bg, var(--color-brand-blue-dark, #00518a));
	color: var(--color-white, #fff);
	font-weight: var(--font-weight-semibold, 600);
}

.ybpg-size-table tbody tr:nth-child(even) > * {
	background: var(--color-surface-soft, #fafafa);
}

.ybpg-size-table tbody th[scope="row"] {
	font-weight: var(--font-weight-bold, 700);
	color: var(--color-brand-blue-deep, #003f70);
}

@media (hover: hover) and (pointer: fine) {
	.ybpg-size-table tbody tr:hover > * {
		background: var(--color-surface-blue, #eef5fb);
	}
}

.ybpg-modal-trigger {
	display: inline-flex;
	align-items: center;
	padding: 0.6rem 0.9rem;
	border: 1px solid currentColor;
	border-radius: var(--radius-xs, 4px);
	background: transparent;
	color: inherit;
	font: inherit;
	font-weight: var(--font-weight-semibold, 600);
	margin: var(--space-xs, 0.5rem) 0;
	cursor: pointer;
}

.ybpg-modal-trigger:focus-visible,
.ybpg-modal-close:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

.ybpg-modal {
	position: fixed;
	inset: 0;
	box-sizing: border-box;
	width: min(640px, 92vw);
	max-width: 96vw;
	max-height: 86vh;
	margin: auto;
	padding: 0;
	border: 0;
	border-radius: var(--radius-sm, 8px);
	background: var(--color-white, #fff);
	color: inherit;
	box-shadow: var(--shadow-md, 0 16px 48px rgba(0, 0, 0, 0.28));
	overflow: hidden;
}

.ybpg-modal[open] {
	display: flex;
	flex-direction: column;
}

.ybpg-modal-header {
	position: relative;
	z-index: 2;
	flex: 0 0 auto;
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: var(--space-sm, 0.75rem);
	padding: var(--space-md, 1rem) var(--space-lg, 1.5rem);
	border-bottom: var(--border-default, 1px solid #d9dde2);
	background: var(--color-white, #fff);
}

.ybpg-modal-sticky-header {
	position: fixed;
	z-index: 1;
	box-sizing: border-box;
	overflow: hidden;
	background: var(--top-bar-bg, var(--color-brand-blue-dark, #00518a));
	color: var(--color-white, #fff);
	pointer-events: none;
}

.ybpg-modal-sticky-header[hidden] {
	display: none;
}

.ybpg-modal-sticky-header-track {
	display: flex;
	align-items: stretch;
	width: max-content;
	min-width: 100%;
	white-space: nowrap;
}

.ybpg-modal-sticky-header-cell {
	box-sizing: border-box;
	flex: 0 0 auto;
	height: 100%;
	padding: 0.55rem 0.65rem;
	border-right: var(--border-default, 1px solid #e7eaee);
	border-bottom: var(--border-default, 1px solid #e7eaee);
	background: var(--top-bar-bg, var(--color-brand-blue-dark, #00518a));
	color: var(--color-white, #fff);
	font-size: 0.92em;
	font-weight: var(--font-weight-semibold, 600);
	line-height: normal;
	text-align: center;
	white-space: nowrap;
}

.ybpg-modal-sticky-header-cell:last-child {
	border-right: 0;
}

.ybpg-modal-body {
	flex: 1 1 auto;
	min-width: 0;
	min-height: 0;
	padding: var(--space-lg, 1.5rem);
	overflow-x: hidden;
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
}

.ybpg-modal::backdrop {
	background: var(--color-overlay, rgba(0, 0, 0, 0.64));
}

.ybpg-modal-close {
	box-sizing: border-box;
	flex: 0 0 44px;
	width: 44px;
	min-width: 44px;
	height: 44px;
	min-height: 44px;
	display: grid;
	place-items: center;
	padding: 0;
	border: 0;
	border-radius: var(--radius-xs, 4px);
	background: transparent;
	color: inherit;
	font-size: 1.6rem;
	line-height: 1;
	cursor: pointer;
}

.ybpg-modal-title {
	flex: 1 1 auto;
	min-width: 0;
	margin: 0;
	font-size: 1.3rem;
	overflow-wrap: anywhere;
}

@media (max-width: 600px) {
	.ybpg-modal {
		width: 96vw;
		max-height: 92vh;
	}

	.ybpg-modal-header {
		gap: var(--space-xs, 0.5rem);
		padding: 0.5rem 0.75rem;
	}

	.ybpg-modal-body {
		padding: 1rem;
	}

	.ybpg-size-table th,
	.ybpg-size-table td {
		padding: 0.42rem 0.35rem;
	}

	.ybpg-modal-sticky-header-cell {
		padding: 0.42rem 0.35rem;
	}
}
