/* ============================================
   IO Pricing - Mobile First Styles
   ============================================ */

.io-pricing {
	--io-pricing-primary: var(--wp--preset--color--primary, #d87d02);
	--io-pricing-secondary: var(--wp--preset--color--secondary, #ffe2c7);
	--io-pricing-tertiary: var(--wp--preset--color--tertiary, #F6F6F6);
	--io-pricing-foreground: var(--wp--preset--color--foreground, #000000);
	--io-pricing-background: var(--wp--preset--color--background, #ffffff);
	--io-pricing-radius: 6px;
	--io-pricing-transition: 0.25s ease;

	font-family: var(--wp--preset--font-family--source-tt-norms-pro, -apple-system, BlinkMacSystemFont, sans-serif);
	width: 100%;
	box-sizing: border-box;
	max-width: var(--wp--style--global--content-size, 860px);
	margin-left: auto;
	margin-right: auto;
}

.io-pricing *,
.io-pricing *::before,
.io-pricing *::after {
	box-sizing: border-box;
}

/* --- Toolbar (search + print) --- */

.io-pricing-toolbar {
	display: flex;
	gap: 12px;
	align-items: center;
	margin-bottom: 16px;
}

.io-pricing-search {
	flex: 1;
}

.io-pricing-search-input {
	width: 100%;
	padding: 12px 16px 12px 42px;
	border: 2px solid var(--io-pricing-tertiary);
	border-radius: var(--io-pricing-radius);
	font-size: 0.95rem;
	font-family: inherit;
	background-color: var(--io-pricing-background);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: 12px center;
	background-size: 18px;
	transition: border-color var(--io-pricing-transition);
	outline: none;
	color: var(--io-pricing-foreground);
}

.io-pricing-search-input:focus {
	border-color: var(--io-pricing-primary);
}

.io-pricing-search-input::placeholder {
	color: #999;
}

/* --- Print button --- */

.io-pricing-print-btn {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 10px 16px;
	border: 2px solid var(--io-pricing-tertiary);
	border-radius: var(--io-pricing-radius);
	background: var(--io-pricing-background);
	color: var(--io-pricing-foreground);
	font-family: inherit;
	font-size: 0.9rem;
	cursor: pointer;
	white-space: nowrap;
	transition: border-color var(--io-pricing-transition), background-color var(--io-pricing-transition);
}

.io-pricing-print-btn:hover {
	border-color: var(--io-pricing-primary);
	background: var(--io-pricing-secondary);
}

.io-pricing-print-btn span {
	display: none;
}

@media (min-width: 768px) {
	.io-pricing-print-btn span {
		display: inline;
	}
}

/* --- List section --- */

.io-pricing-list {
	margin-bottom: 40px;
}

.io-pricing-list:last-child {
	margin-bottom: 0;
}

/* --- List header (title + valid from) --- */

.io-pricing-list-header {
	margin-bottom: 16px;
}

.io-pricing-title {
	font-size: 1.3rem;
	font-weight: 700;
	margin: 0 0 4px 0;
	color: var(--io-pricing-foreground);
}

.io-pricing-meta {
	font-size: 0.8rem;
	color: var(--io-pricing-foreground);
	opacity: 0.5;
	margin: 0;
}

.io-pricing-meta strong {
	opacity: 1;
	color: var(--io-pricing-primary);
}

/* --- Category accordion --- */

.io-pricing-category {
	margin-bottom: 2px;
}

.io-pricing-category-header {
	display: flex;
	align-items: center;
	width: 100%;
	padding: 12px 16px;
	background: var(--io-pricing-tertiary);
	border: none;
	cursor: pointer;
	font-family: inherit;
	font-size: 0.8rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	text-align: left;
	color: var(--io-pricing-foreground);
	border-radius: var(--io-pricing-radius);
	transition: background-color var(--io-pricing-transition);
}

.io-pricing-category-header:hover {
	background: var(--io-pricing-secondary);
}

.io-pricing-category-count {
	margin-left: 8px;
	opacity: 0.4;
	font-weight: 400;
	font-size: 0.75rem;
}

.io-pricing-chevron {
	margin-left: auto;
	width: 8px;
	height: 8px;
	border-right: 2px solid var(--io-pricing-foreground);
	border-bottom: 2px solid var(--io-pricing-foreground);
	transform: rotate(45deg);
	transition: transform var(--io-pricing-transition);
	opacity: 0.4;
	flex-shrink: 0;
}

.io-pricing-category.open .io-pricing-chevron {
	transform: rotate(-135deg);
}

.io-pricing-category-body {
	max-height: 0;
	overflow: hidden;
	transition: max-height 0.4s ease;
}

.io-pricing-category.open .io-pricing-category-body {
	max-height: 10000px;
}

/* --- Table base --- */

.io-pricing-table {
	width: 100%;
	border-collapse: collapse;
}

/* --- Mobile: Card layout (default) --- */

.io-pricing-table thead {
	display: none;
}

.io-pricing-table tbody tr {
	display: block;
	padding: 12px 16px;
	margin: 4px 0;
	background: var(--io-pricing-background);
	border: 1px solid var(--io-pricing-tertiary);
	border-radius: var(--io-pricing-radius);
}

.io-pricing-table tbody tr.io-pricing-hidden {
	display: none !important;
}

.io-pricing-table tbody td {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	padding: 3px 0;
	font-size: 0.85rem;
	color: var(--io-pricing-foreground);
}

.io-pricing-table tbody td::before {
	content: attr(data-label);
	font-weight: 500;
	margin-right: 16px;
	opacity: 0.5;
	flex-shrink: 0;
	font-size: 0.8rem;
}

.io-pricing-table tbody td:first-child {
	padding-bottom: 6px;
	margin-bottom: 4px;
	border-bottom: 1px solid var(--io-pricing-tertiary);
}

.io-pricing-table tbody td:first-child::before {
	display: none;
}

.io-pricing-price {
	color: var(--io-pricing-primary);
	font-weight: 700;
	white-space: nowrap;
}

/* --- Desktop: Table layout (>=768px) --- */

@media (min-width: 768px) {
	.io-pricing-title {
		font-size: 1.5rem;
	}

	.io-pricing-table thead {
		display: table-header-group;
	}

	.io-pricing-table thead th {
		padding: 4px 12px;
		text-align: left;
		font-weight: 500;
		font-size: 0.65rem;
		text-transform: uppercase;
		letter-spacing: 0.03em;
		color: var(--io-pricing-foreground);
		opacity: 0.4;
		border-bottom: 1px solid var(--io-pricing-tertiary);
	}

	.io-pricing-table thead th:first-child {
		width: 30%;
	}

	.io-pricing-table thead th:nth-child(2) {
		width: 40%;
	}

	.io-pricing-table thead th:nth-child(3),
	.io-pricing-table thead th:nth-child(4),
	.io-pricing-table thead th:nth-child(5) {
		width: 10%;
		white-space: nowrap;
		text-align: right;
	}

	.io-pricing-table tbody tr {
		display: table-row;
		padding: 0;
		margin: 0;
		border: none;
		border-radius: 0;
		border-bottom: 1px solid var(--io-pricing-tertiary);
		transition: background-color 0.15s ease;
	}

	.io-pricing-table tbody tr:hover {
		background-color: #f1f5f9;
	}

	.io-pricing-table tbody td {
		display: table-cell;
		padding: 10px 12px;
		font-size: 0.85rem;
		vertical-align: middle;
	}

	.io-pricing-table tbody td::before {
		display: none;
	}

	.io-pricing-table tbody td:first-child {
		border-bottom: none;
		margin-bottom: 0;
		padding-bottom: 10px;
	}

	.io-pricing-table tbody td:nth-child(3),
	.io-pricing-table tbody td:nth-child(4),
	.io-pricing-table tbody td:nth-child(5) {
		white-space: nowrap;
		text-align: right;
	}
}

/* --- No results --- */

.io-pricing-no-results {
	padding: 40px 16px;
	text-align: center;
	color: var(--io-pricing-foreground);
	opacity: 0.4;
	font-size: 0.95rem;
}

.io-pricing-empty {
	padding: 40px 16px;
	text-align: center;
	color: var(--io-pricing-foreground);
	opacity: 0.4;
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
	/* Hide non-essential elements */
	.io-pricing-toolbar,
	.io-pricing-print-btn,
	.io-pricing-chevron,
	.io-pricing-no-results {
		display: none !important;
	}

	/* Hide site chrome */
	header,
	footer,
	nav,
	.wp-site-blocks > header,
	.wp-site-blocks > footer,
	.site-header,
	.site-footer,
	.site-navigation,
	#wpadminbar {
		display: none !important;
	}

	/* Reset container */
	.io-pricing {
		font-size: 9pt;
		max-width: 100%;
		width: 100%;
		color: #000;
	}

	/* Show all lists (no tabs in print) */
	.io-pricing-list {
		display: block !important;
		page-break-inside: avoid;
		margin-bottom: 24pt;
	}

	/* Title styling for print */
	.io-pricing-title {
		font-size: 14pt;
		font-weight: 700;
		margin-bottom: 2pt;
		color: #000;
	}

	.io-pricing-meta {
		font-size: 9pt;
		margin-bottom: 8pt;
		opacity: 1;
		color: #333;
	}

	.io-pricing-meta strong {
		color: #000;
	}

	/* Expand all categories */
	.io-pricing-category-body {
		max-height: none !important;
		overflow: visible !important;
	}

	.io-pricing-category {
		page-break-inside: avoid;
		margin-bottom: 4pt;
	}

	.io-pricing-category-header {
		display: block !important;
		width: 100% !important;
		background: #d87d02 !important;
		color: #fff !important;
		padding: 4pt 8pt;
		font-size: 8pt;
		border-radius: 0;
		cursor: default;
		letter-spacing: 0.05em;
		-webkit-print-color-adjust: exact;
		print-color-adjust: exact;
	}

	.io-pricing-category-count {
		display: none;
	}

	/* Force table layout */
	.io-pricing-table {
		width: 100%;
		border-collapse: collapse;
	}

	.io-pricing-table thead {
		display: table-header-group !important;
	}

	.io-pricing-table thead th {
		padding: 3pt 6pt;
		font-size: 7pt;
		text-transform: uppercase;
		border-bottom: 1pt solid #000;
		text-align: left;
		font-weight: 600;
		opacity: 1;
		color: #000;
	}

	.io-pricing-table thead th:first-child {
		width: 30%;
	}

	.io-pricing-table thead th:nth-child(2) {
		width: 40%;
	}

	.io-pricing-table thead th:nth-child(3),
	.io-pricing-table thead th:nth-child(4),
	.io-pricing-table thead th:nth-child(5) {
		width: 10%;
		text-align: right;
	}

	.io-pricing-table tbody tr {
		display: table-row !important;
		padding: 0;
		margin: 0;
		border: none;
		border-radius: 0;
		border-bottom: 0.5pt solid #ccc;
		background: none !important;
	}

	.io-pricing-table tbody td {
		display: table-cell !important;
		padding: 3pt 6pt;
		font-size: 8pt;
		vertical-align: middle;
		color: #000;
	}

	.io-pricing-table tbody td::before {
		display: none !important;
	}

	.io-pricing-table tbody td:first-child {
		border-bottom: none;
		margin-bottom: 0;
		padding-bottom: 3pt;
	}

	.io-pricing-table tbody td:nth-child(4),
	.io-pricing-table tbody td:nth-child(5) {
		text-align: right;
	}

	.io-pricing-price {
		color: #000 !important;
		font-weight: 600;
	}

	/* Page setup */
	@page {
		margin: 1.5cm;
		size: A4;
	}
}
