/**
 * Vivaia Size Chart Frontend Styles
 * Version: 1.0.0
 */

/* ============================================
   Size Chart Trigger Button
   ============================================ */

.vivaia-size-chart-wrapper {
	display: inline-block;
	margin: 10px 0;
}

.vivaia-size-chart-trigger {
	background: transparent !important;
	background-color: transparent !important;
	border: none;
	color: #000 !important;
	cursor: pointer;
	font-size: 14px;
	font-weight: 500;
	padding: 0;
	text-decoration: underline !important;
}

.vivaia-size-chart-trigger:hover,
.vivaia-size-chart-trigger:active,
.vivaia-size-chart-trigger:focus {
	background: transparent !important;
	background-color: transparent !important;
	color: #000 !important;
	text-decoration: underline !important;
}

/* ============================================
   Modal Overlay & Dialog
   ============================================ */

.vivaia-size-chart-modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 999999;
	overflow: hidden;
}

.vivaia-size-chart-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.5);
	animation: fadeIn 0.3s ease;
}

.vivaia-size-chart-dialog {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	padding: 20px;
	overflow-y: auto;
	animation: fadeIn 0.3s ease;
}

.vivaia-size-chart-content {
	position: relative;
	background: #fff;
	border-radius: 8px;
	max-width: 680px;
	width: 100%;
	max-height: 90vh;
	overflow-y: auto;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
	animation: slideUp 0.3s ease;
}

@keyframes fadeIn {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes slideUp {
	from {
		opacity: 0;
		transform: translateY(30px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* ============================================
   Dialog Header
   ============================================ */

.vivaia-size-chart-content .dialog-header {
	position: sticky;
	top: 0;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20px 24px;
	background: #fff;
	border-bottom: 1px solid #e5e5e5;
	z-index: 10;
}

.vivaia-size-chart-content .header-title-text {
	font-size: 20px;
	font-weight: 600;
	color: #000;
}

.vivaia-close-btn {
	background: transparent;
	border: none;
	color: #000;
	cursor: pointer;
	padding: 4px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: opacity 0.2s ease;
}

.vivaia-close-btn:hover {
	opacity: 0.6;
}

/* ============================================
   Dialog Body
   ============================================ */

.vivaia-size-chart-content .dialog-body {
	padding: 24px;
}

.vivaia-size-chart-content .size-guide-title {
	font-size: 14px;
	line-height: 1.6;
	color: #333;
	margin-bottom: 20px;
	text-align: left;
}

/* ============================================
   Size Guide Container
   ============================================ */

.vivaia-size-chart-content .size-guide-container {
	margin-bottom: 24px;
}

.size-guide-table-container {
	margin-bottom: 16px;
}

/* ============================================
   Unit Toggle Buttons
   ============================================ */

.unit-of-measurement {
	display: flex;
	gap: 0;
	margin-bottom: 16px;
	border: 1px solid #ddd;
	border-radius: 4px;
	overflow: hidden;
	width: fit-content;
}

.unit-item {
	background: #fff !important;
	background-color: #fff !important;
	border: none;
	color: #666 !important;
	cursor: pointer;
	font-size: 14px;
	font-weight: 500;
	padding: 8px 20px;
	transition: all 0.2s ease;
	border-right: 1px solid #ddd;
}

.unit-item:last-child {
	border-right: none;
}

.unit-item.active {
	background: #000 !important;
	background-color: #000 !important;
	color: #fff !important;
}

.unit-item:not(.active):hover {
	background: #f5f5f5 !important;
	background-color: #f5f5f5 !important;
}

/* ============================================
   Size Table
   ============================================ */

.size-guide-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
	background: #fff;
	margin-bottom: 12px;
}

.size-guide-table thead {
	background: #000;
	color: #fff;
}

.size-guide-table thead th {
	padding: 12px 10px;
	text-align: center;
	font-weight: 600;
	font-size: 14px;
	vertical-align: middle;
}

.size-guide-table tbody tr {
	border-bottom: 1px solid #e5e5e5;
}

.size-guide-table tbody tr.item-tr-even {
	background: #f9f9f9;
}

.size-guide-table tbody tr.item-tr-odd {
	background: #fff;
}

.size-guide-table tbody td {
	padding: 10px;
	text-align: center;
	color: #333;
}

.size-guide-table tbody td div {
	display: block;
}

/* Country Dropdown */
.country-td {
	min-width: 80px;
}

.select-wrapper {
	position: relative;
	display: inline-block;
}

.country-select {
	appearance: none;
	background: #000;
	border: 1px solid #fff;
	border-radius: 4px;
	color: #fff;
	cursor: pointer;
	font-size: 14px;
	font-weight: 600;
	padding: 6px 28px 6px 12px;
	background-image: url('data:image/svg+xml;charset=UTF-8,<svg width="12" height="8" viewBox="0 0 12 8" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1 1L6 6L11 1" stroke="white" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>');
	background-repeat: no-repeat;
	background-position: right 8px center;
	background-size: 12px;
}

.country-select:hover {
	opacity: 0.9;
}

.country-select option {
	background: #fff;
	color: #000;
}

.foot-length-td,
.foot-normal-td {
	min-width: 100px;
}

/* ============================================
   Table Disclaimers
   ============================================ */

.table-explain {
	font-size: 12px;
	line-height: 1.5;
	color: #666;
	margin-bottom: 6px;
}

/* ============================================
   Divider
   ============================================ */

.hr-in-size-guide {
	border: none;
	border-top: 1px solid #e5e5e5;
	margin: 24px 0;
}

/* ============================================
   Content Sections
   ============================================ */

.vivaia-size-chart-content .item-container {
	margin-bottom: 24px;
}

.vivaia-size-chart-content .item-title {
	margin-bottom: 16px;
}

.vivaia-size-chart-content .item-title-text {
	font-size: 16px;
	font-weight: 600;
	color: #000;
}

.vivaia-size-chart-content .item-content img {
	width: 100%;
	height: auto;
	display: block;
	border-radius: 4px;
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 768px) {
	.vivaia-size-chart-dialog {
		padding: 10px;
	}

	.vivaia-size-chart-content {
		max-width: 100%;
		max-height: 95vh;
		border-radius: 8px;
	}

	.vivaia-size-chart-content .dialog-header {
		padding: 16px 20px;
	}

	.vivaia-size-chart-content .header-title-text {
		font-size: 18px;
	}

	.vivaia-size-chart-content .dialog-body {
		padding: 20px;
	}

	.vivaia-size-chart-content .size-guide-title {
		font-size: 13px;
	}

	.size-guide-table {
		font-size: 12px;
	}

	.size-guide-table thead th {
		padding: 10px 6px;
		font-size: 12px;
	}

	.size-guide-table tbody td {
		padding: 8px 6px;
	}

	.country-select {
		font-size: 12px;
		padding: 4px 24px 4px 8px;
	}

	.unit-item {
		font-size: 12px;
		padding: 6px 16px;
	}

	.vivaia-size-chart-content .item-title-text {
		font-size: 14px;
	}

	.table-explain {
		font-size: 11px;
	}
}

@media (max-width: 480px) {
	.vivaia-size-chart-content .dialog-header {
		padding: 14px 16px;
	}

	.vivaia-size-chart-content .header-title-text {
		font-size: 16px;
	}

	.vivaia-size-chart-content .dialog-body {
		padding: 16px;
	}

	.size-guide-table {
		font-size: 11px;
	}

	.size-guide-table thead th {
		padding: 8px 4px;
		font-size: 11px;
	}

	.size-guide-table tbody td {
		padding: 6px 4px;
	}

	.country-select {
		font-size: 11px;
		padding: 4px 20px 4px 6px;
	}

	.unit-item {
		font-size: 11px;
		padding: 5px 12px;
	}

	.vivaia-size-chart-content .item-title-text {
		font-size: 13px;
	}
}

/* ============================================
   Scrollbar Styling
   ============================================ */

.vivaia-size-chart-content::-webkit-scrollbar {
	width: 8px;
}

.vivaia-size-chart-content::-webkit-scrollbar-track {
	background: #f1f1f1;
	border-radius: 4px;
}

.vivaia-size-chart-content::-webkit-scrollbar-thumb {
	background: #ccc;
	border-radius: 4px;
}

.vivaia-size-chart-content::-webkit-scrollbar-thumb:hover {
	background: #999;
}
