/**
 * Styles for Arkiplot Product Options shortcode: [apo_product_prices]
 * Premium, modern and responsive design.
 */

.apo-product-prices-wrapper {
	margin: 2em 0;
	font-family: inherit;
	background: rgba(255, 255, 255, 0.7);
	backdrop-filter: blur(10px);
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: 12px;
	padding: 1.5em;
	box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.04);
}

/* Search bar styling */
.apo-product-prices-search-container {
	margin-bottom: 1.5em;
	position: relative;
}

.apo-product-prices-search-input {
	width: 100%;
	padding: 0.8em 1.2em;
	font-size: 0.95em;
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: 8px;
	background: #ffffff;
	box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
	transition: all 0.3s ease;
	outline: none;
}

.apo-product-prices-search-input:focus {
	border-color: #2271b1;
	box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.15), inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

/* Table layout */
.apo-product-prices-table {
	width: 100%;
	border-collapse: collapse;
	text-align: left;
	font-size: 0.95em;
}

.apo-product-prices-thead th {
	padding: 1em;
	font-weight: 600;
	color: #444444;
	border-bottom: 2px solid rgba(0, 0, 0, 0.06);
	background: rgba(0, 0, 0, 0.01);
}

.apo-product-prices-tr {
	border-bottom: 1px solid rgba(0, 0, 0, 0.05);
	transition: background-color 0.2s ease;
}

.apo-product-prices-tr:hover {
	background-color: rgba(34, 113, 177, 0.02);
}

.apo-product-prices-td {
	padding: 1.2em 1em;
	vertical-align: middle;
}

/* Badges */
.apo-product-prices-badge {
	display: inline-block;
	padding: 0.25em 0.6em;
	font-size: 0.8em;
	font-weight: 600;
	border-radius: 4px;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.apo-product-prices-badge--fixed {
	background-color: #e1f5fe;
	color: #0288d1;
}

.apo-product-prices-badge--m2 {
	background-color: #efebe9;
	color: #5d4037;
}

.apo-product-prices-badge--adjustment {
	background-color: #e8f5e9;
	color: #2e7d32;
	font-size: 0.85em;
}

.apo-product-prices-badge--discount {
	background-color: #fbe9e7;
	color: #d84315;
	font-size: 0.85em;
}

/* Option count info */
.apo-product-prices-opt-count {
	font-size: 0.85em;
	color: #666666;
	display: block;
	margin-top: 0.2em;
}

/* Expand Button */
.apo-product-prices-toggle-btn {
	background: #ffffff;
	border: 1px solid rgba(0, 0, 0, 0.15);
	border-radius: 6px;
	padding: 0.5em 1em;
	font-size: 0.85em;
	font-weight: 500;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
	transition: all 0.2s ease;
	color: #333333;
}

.apo-product-prices-toggle-btn:hover {
	background: #f6f7f7;
	border-color: rgba(0, 0, 0, 0.25);
	color: #000000;
}

.apo-product-prices-toggle-btn .apo-arrow {
	display: inline-block;
	transition: transform 0.3s ease;
	border: solid currentColor;
	border-width: 0 2px 2px 0;
	padding: 2px;
	transform: rotate(45deg);
	margin-top: -3px;
}

.apo-product-prices-tr.is-expanded .apo-product-prices-toggle-btn {
	background: #f0f6fa;
	border-color: #a7d1ee;
	color: #115588;
}

.apo-product-prices-tr.is-expanded .apo-product-prices-toggle-btn .apo-arrow {
	transform: rotate(-135deg);
	margin-top: 1px;
}

/* Options Drawer (Accordion) */
.apo-product-prices-drawer-tr {
	background: rgba(0, 0, 0, 0.005);
	border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.apo-product-prices-options-drawer {
	overflow: hidden;
	transition: max-height 0.3s ease-out, opacity 0.2s ease-out;
	max-height: 0;
	opacity: 0;
}

.apo-product-prices-options-drawer.is-open {
	opacity: 1;
}

.apo-product-prices-options-content {
	padding: 1.5em;
	border-left: 3px solid #2271b1;
}

/* Accordion internal structure */
.apo-product-prices-template-sec {
	margin-bottom: 1.5em;
}

.apo-product-prices-template-sec:last-child {
	margin-bottom: 0;
}

.apo-product-prices-template-title {
	font-size: 1.05em;
	font-weight: 600;
	margin: 0 0 1em 0;
	color: #2271b1;
	border-bottom: 1px solid rgba(34, 113, 177, 0.15);
	padding-bottom: 0.3em;
}

.apo-product-prices-fields-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 1.5em;
}

.apo-product-prices-field-card {
	background: #ffffff;
	border: 1px solid rgba(0, 0, 0, 0.06);
	border-radius: 8px;
	padding: 1em;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.apo-product-prices-field-label {
	font-weight: 600;
	color: #333333;
	font-size: 0.9em;
	display: block;
	margin-bottom: 0.6em;
	border-bottom: 1px dashed rgba(0, 0, 0, 0.08);
	padding-bottom: 0.3em;
}

.apo-product-prices-options-list {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 0.4em;
}

.apo-product-prices-option-item {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 0.85em;
	color: #555555;
	padding: 0.2em 0;
}

.apo-product-prices-option-name {
	font-weight: 500;
}

/* Mobile responsive adjustments */
@media screen and (max-width: 768px) {
	.apo-product-prices-thead {
		display: none;
	}

	.apo-product-prices-tr {
		display: flex;
		flex-direction: column;
		padding: 1em 0;
		border-bottom: 1.5px solid rgba(0, 0, 0, 0.08);
		position: relative;
	}

	.apo-product-prices-td {
		padding: 0.4em 1em;
	}

	.apo-product-prices-td[data-label] {
		display: flex;
		justify-content: space-between;
		align-items: center;
	}

	.apo-product-prices-td[data-label]::before {
		content: attr(data-label);
		font-weight: 600;
		color: #666666;
		font-size: 0.85em;
		text-transform: uppercase;
		margin-right: 1em;
	}

	.apo-product-prices-drawer-tr {
		display: block;
		border-bottom: none;
	}

	.apo-product-prices-options-content {
		padding: 1em;
		border-left: 2px solid #2271b1;
	}

	.apo-product-prices-fields-grid {
		grid-template-columns: 1fr;
		gap: 1em;
	}
}

/* Empty search result message */
.apo-product-prices-no-results {
	padding: 2em;
	text-align: center;
	color: #666666;
	font-style: italic;
}

/* =========================================================================
 * [apo_tabla_comparativa] — front-end comparison table.
 * Mirrors the admin "6. Tabla comparativa". Scoped under .apo-comparison-wrapper
 * because the admin styles (.apo-admin / .widefat) are not loaded on the front.
 * ========================================================================= */
.apo-comparison-wrapper {
	margin: 2em 0;
	font-family: inherit;
	color: #1d2327;
}

.apo-comparison-count {
	margin: 0 0 0.6em;
	font-weight: 600;
}

/* Barra de filtros: buscador + categoría. */
.apo-comparison-wrapper .apo-comparison-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6em;
	margin: 0 0 0.8em;
}

.apo-comparison-wrapper .apo-comparison-search,
.apo-comparison-wrapper .apo-comparison-filter-cat {
	padding: 0.55em 0.7em;
	border: 1px solid rgba(0, 0, 0, 0.15);
	border-radius: 8px;
	font-size: 0.95em;
	background: #ffffff;
	color: inherit;
	outline: none;
}

.apo-comparison-wrapper .apo-comparison-search {
	flex: 1 1 240px;
	min-width: 180px;
}

.apo-comparison-wrapper .apo-comparison-search:focus,
.apo-comparison-wrapper .apo-comparison-filter-cat:focus {
	border-color: #2271b1;
	box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.15);
}

.apo-comparison-wrapper .apo-comparison-noresults {
	margin: 0.8em 0 0;
	padding: 1.2em;
	text-align: center;
	color: #666666;
	font-style: italic;
}

.apo-comparison-wrapper .apo-cmp-scroll {
	overflow-x: auto;
	border: 1px solid rgba(0, 0, 0, 0.1);
	border-radius: 10px;
	background: #ffffff;
	box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.04);
}

.apo-comparison-wrapper .apo-comparison-table {
	/* "separate" (no "collapse") para que position: sticky funcione en las
	   celdas de las columnas congeladas (Nombre / Total) en Chrome. */
	border-collapse: separate;
	border-spacing: 0;
	width: 100%;
	font-size: 0.92em;
	background: #ffffff;
}

.apo-comparison-wrapper .apo-comparison-table th,
.apo-comparison-wrapper .apo-comparison-table td {
	/* Solo borde derecho + inferior: con border-spacing 0 un borde completo se
	   duplicaria entre celdas. El borde del contenedor dibuja el lado superior/izq. */
	border-right: 1px solid #e2e4e7;
	border-bottom: 1px solid #e2e4e7;
	padding: 0.6em 0.8em;
	vertical-align: top;
	text-align: left;
}

.apo-comparison-wrapper .apo-comparison-table thead th {
	background: #f6f7f7;
	position: sticky;
	top: 0;
	z-index: 2;
	white-space: nowrap;
}

/* Fondo de fila vía una variable, para que las columnas congeladas (sticky)
   sigan exactamente el mismo color que el resto de la fila —rayado y hover
   incluidos— sin overrides por celda. */
.apo-comparison-wrapper .apo-comparison-table tbody td {
	--apo-row-bg: #ffffff;
	background-color: var( --apo-row-bg );
}

.apo-comparison-wrapper .apo-comparison-table tbody tr:nth-child(even) td {
	--apo-row-bg: #fafbfc;
}

/* Hover de fila: destaca el fondo de TODA la fila (incluidas las columnas
   congeladas Nombre y Total). */
.apo-comparison-wrapper .apo-comparison-table tbody tr:hover td {
	--apo-row-bg: #eaf2fb;
}

/* Columnas congeladas: Nombre (izquierda) y Total base + opciones (derecha)
   quedan fijas al hacer scroll horizontal. Fondo opaco (siguiendo el rayado de
   la fila) para tapar las celdas que se desplazan por detras. */
.apo-comparison-wrapper .apo-comparison-table .apo-col-name,
.apo-comparison-wrapper .apo-comparison-table .apo-col-total {
	position: sticky;
	z-index: 1;
}

.apo-comparison-wrapper .apo-comparison-table .apo-col-name {
	left: 0;
	box-shadow: inset -1px 0 0 #e2e4e7;
}

.apo-comparison-wrapper .apo-comparison-table .apo-col-total {
	right: 0;
	box-shadow: inset 1px 0 0 #e2e4e7;
}

/* Las celdas congeladas son opacas vía background-color: var(--apo-row-bg)
   (regla de tbody td), así que siguen el rayado y el hover de su fila. */

/* Esquinas (header sticky + columna congelada): por encima de todo. */
.apo-comparison-wrapper .apo-comparison-table thead th.apo-col-name,
.apo-comparison-wrapper .apo-comparison-table thead th.apo-col-total {
	z-index: 3;
}

/* Hover de columna: tinte muy leve en la columna actual (la clase la pone el
   JS sobre cada celda de esa columna, header incluido). Se pinta como capa
   translucida (background-image) sobre el background-color de la celda, asi se
   ve en cualquier fila y se combina con el hover de fila en la interseccion. */
.apo-comparison-wrapper .apo-comparison-table .apo-col-hover {
	background-image: linear-gradient( rgba( 34, 113, 177, 0.05 ), rgba( 34, 113, 177, 0.05 ) );
}

/* Sort buttons in the header. */
.apo-comparison-wrapper .apo-sort-btn {
	background: none;
	border: 0;
	padding: 0;
	margin: 0;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	color: inherit;
	display: inline-flex;
	align-items: center;
	gap: 0.3em;
}

.apo-comparison-wrapper .apo-sort-btn:hover {
	color: #2271b1;
}

.apo-comparison-wrapper .apo-sort-ind::after {
	content: '\2195';
	opacity: 0.35;
}

.apo-comparison-wrapper th[aria-sort="ascending"] .apo-sort-ind::after {
	content: '\2191';
	opacity: 1;
}

.apo-comparison-wrapper th[aria-sort="descending"] .apo-sort-ind::after {
	content: '\2193';
	opacity: 1;
}

.apo-comparison-wrapper th[aria-sort="ascending"] .apo-sort-btn,
.apo-comparison-wrapper th[aria-sort="descending"] .apo-sort-btn {
	color: #2271b1;
}

/* Name + SKU column. */
.apo-comparison-wrapper .apo-col-name {
	min-width: 220px;
}

.apo-comparison-wrapper .apo-col-name a {
	color: #2271b1;
	text-decoration: none;
}

.apo-comparison-wrapper .apo-col-name a:hover {
	text-decoration: underline;
}

.apo-comparison-wrapper .apo-cmp-sku {
	display: block;
	margin-top: 0.15em;
	color: #646970;
	font-size: 0.85em;
	font-variant-numeric: tabular-nums;
}

.apo-comparison-wrapper .apo-cmp-meta {
	display: block;
	margin-top: 0.1em;
	color: #646970;
	font-size: 0.85em;
}

.apo-comparison-wrapper .apo-cmp-edit {
	display: inline-block;
	margin-top: 0.45em;
	padding: 0.25em 0.8em;
	border: 1px solid #2271b1;
	border-radius: 6px;
	color: #2271b1;
	background: #fff;
	font-size: 0.85em;
	line-height: 1.5;
	text-decoration: none;
}

.apo-comparison-wrapper .apo-cmp-edit:hover {
	background: #2271b1;
	color: #fff;
}

/* Option groups + quantity tiers. */
.apo-comparison-wrapper .apo-cmp-group {
	min-width: 240px;
}

.apo-comparison-wrapper .apo-cmp-group > strong {
	display: block;
	margin-bottom: 0.3em;
}

.apo-comparison-wrapper .apo-cmp-qty {
	min-width: 200px;
}

.apo-comparison-wrapper .apo-qty-mode {
	margin-bottom: 0.5em;
	max-width: 100%;
}

.apo-comparison-wrapper .apo-qty-tiers > strong {
	display: block;
	margin: 0.3em 0 0.2em;
}

.apo-comparison-wrapper .apo-qty-free {
	display: flex;
	align-items: center;
	gap: 0.4em;
}

.apo-comparison-wrapper .apo-cmp-qty-input {
	width: 80px;
}

.apo-comparison-wrapper .apo-cmp-opts {
	margin: 0;
	padding-left: 0;
	list-style: none;
}

.apo-comparison-wrapper .apo-cmp-opts li {
	font-size: 0.95em;
	padding: 0.05em 0;
}

.apo-comparison-wrapper .apo-cmp-opt {
	display: flex;
	align-items: flex-start;
	gap: 0.45em;
	margin: 0;
	cursor: pointer;
}

.apo-comparison-wrapper .apo-cmp-opt input[type="radio"] {
	margin: 0.2em 0 0;
	flex: 0 0 auto;
}

.apo-comparison-wrapper .apo-cmp-price {
	color: #2271b1;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

/* Totals column. */
.apo-comparison-wrapper .apo-col-total {
	min-width: 200px;
}

.apo-comparison-wrapper .apo-cmp-total-line {
	display: block;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

.apo-comparison-wrapper .apo-cmp-total-line.apo-cmp-opt-line {
	white-space: normal;
	font-size: 0.88em;
	color: #50575e;
	padding-left: 0.6em;
}

.apo-comparison-wrapper .apo-cmp-total-line.apo-cmp-sub {
	margin-top: 0.35em;
	padding-top: 0.35em;
	border-top: 1px solid #dcdcde;
}

.apo-comparison-wrapper .apo-cmp-total-line.apo-cmp-total-sum {
	margin-top: 0.15em;
	font-size: 1.05em;
}
