/**
 * Frontend CSS — Tabs ACCHI
 * Diseño alineado al mockup: nav izquierda + grilla en contenedor gris.
 */

:root {
	--acchi-tabs-accent: #ffd500;
	--acchi-tabs-accent-dark: #e6c000;
	--acchi-tabs-text: #1a1a1a;
	--acchi-tabs-muted: #8a8a8a;
	--acchi-tabs-nav-inactive: #9a9a9a;
	--acchi-tabs-panel-bg: #f2f2f2;
	--acchi-tabs-card-bg: #ffffff;
	--acchi-tabs-radius: 16px;
	--acchi-tabs-card-radius: 14px;
	--acchi-tabs-shadow: none;
}

.acchi-tabs {
	--acchi-tabs-nav-width: min(220px, 22%);
	color: var(--acchi-tabs-text);
	width: 100%;
	max-width: none;
	margin: 0 0 2rem;
	font-size: 1rem;
	line-height: 1.5;
	box-sizing: border-box;
	display: block;
}

.acchi-tabs *,
.acchi-tabs *::before,
.acchi-tabs *::after {
	box-sizing: border-box;
}

.acchi-tabs__header {
	text-align: center;
	margin-bottom: 2rem;
}

.acchi-tabs h2.acchi-tabs__title,
.acchi-tabs .acchi-tabs__title {
	margin: 0 0 0.5rem !important;
	font-size: 28px !important;
	font-weight: 700 !important;
	line-height: 1.2 !important;
	color: var(--acchi-tabs-text) !important;
	letter-spacing: normal !important;
	font-family: inherit !important;
}

.acchi-tabs .acchi-tabs__subtitle {
	margin: 0 auto;
	max-width: 42rem;
	font-size: 17px !important;
	line-height: 1.45 !important;
	color: var(--acchi-tabs-muted) !important;
	font-family: inherit !important;
}

/* Layout: nav fuera del panel gris (como el mockup) */
.acchi-tabs__layout {
	display: grid;
	grid-template-columns: var(--acchi-tabs-nav-width) minmax(0, 1fr);
	gap: 1.5rem 2rem;
	align-items: start;
	width: 100%;
	background: transparent;
	border: 0;
	border-radius: 0;
	padding: 0;
	box-shadow: none;
}

/* Nav — Items Padre */
.acchi-tabs__nav {
	position: sticky;
	top: 1rem;
	padding-top: 0.5rem;
}

.acchi-tabs__nav-list {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.acchi-tabs__nav-item {
	display: block;
	width: 100%;
	text-align: left;
	background: transparent;
	border: 0;
	border-left: 4px solid transparent;
	padding: 0.95rem 0.85rem 0.95rem 1rem;
	font: inherit;
	font-size: 1rem;
	font-weight: 400;
	color: var(--acchi-tabs-nav-inactive);
	cursor: pointer;
	border-radius: 0;
	transition: color 0.15s ease, border-color 0.15s ease, font-weight 0.15s ease;
}

.acchi-tabs__nav-item:hover,
.acchi-tabs__nav-item:focus-visible {
	color: var(--acchi-tabs-text);
	background: transparent;
	outline: none;
}

.acchi-tabs__nav-item.is-active {
	font-weight: 700;
	color: var(--acchi-tabs-text);
	border-left-color: #000;
	background: transparent;
}

.acchi-tabs__nav-label {
	display: block;
	line-height: 1.35;
}

/* Selector mobile (oculto en desktop) */
.acchi-tabs__nav-select-label,
.acchi-tabs__nav-select {
	display: none;
}

.acchi-tabs__nav-select-label {
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--acchi-tabs-muted);
	margin-bottom: 0.35rem;
}

.acchi-tabs__nav-select {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	appearance: none;
	-webkit-appearance: none;
	padding: 0.85rem 2.75rem 0.85rem 1rem;
	font: inherit;
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.35;
	color: var(--acchi-tabs-text);
	background-color: #fff;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%231a1a1a' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 1rem center;
	background-size: 12px 8px;
	border: 1px solid #d8d8d8;
	border-radius: 10px;
	cursor: pointer;
}

.acchi-tabs__nav-select:focus {
	outline: 2px solid var(--acchi-tabs-accent);
	outline-offset: 2px;
	border-color: var(--acchi-tabs-accent);
}

/* Panels: contenedor gris redondeado solo para las tarjetas */
.acchi-tabs__panels {
	min-width: 0;
	width: 100%;
}

.acchi-tabs__panel {
	background: var(--acchi-tabs-panel-bg);
	border-radius: var(--acchi-tabs-radius);
	padding: 2rem 2rem 2rem;
	width: 100%;
}

.acchi-tabs__panel[hidden] {
	display: none !important;
}

.acchi-tabs__panel-title.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.acchi-tabs__empty {
	color: var(--acchi-tabs-muted);
	margin: 0;
	text-align: center;
	padding: 2rem 1rem;
}

/* Grid — Items Hijo */
.acchi-tabs__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 2rem 1.75rem;
	padding-top: 0.75rem;
	width: 100%;
}

.acchi-tabs__card {
	position: relative;
	margin: 0.75rem 0 0;
	background: var(--acchi-tabs-card-bg);
	border: 0;
	border-radius: var(--acchi-tabs-card-radius);
	box-shadow: none;
	transition: transform 0.15s ease;
	min-height: 168px;
}

.acchi-tabs__card:hover,
.acchi-tabs__card:focus-within {
	transform: translateY(-2px);
	box-shadow: none;
}

.acchi-tabs__card-body {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	width: 100%;
	height: 100%;
	padding: 2.15rem 1.35rem 1.4rem;
	pointer-events: none;
}

.acchi-tabs__card-trigger {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: inherit;
	background: transparent;
	cursor: pointer;
	z-index: 2;
}

.acchi-tabs__card-trigger:focus-visible {
	outline: 2px solid #000;
	outline-offset: 3px;
}

.acchi-tabs__card-trigger .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.acchi-tabs__card-icon {
	position: absolute;
	top: 0;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 52px;
	height: 52px;
	border-radius: 50%;
	background: var(--acchi-tabs-accent);
	color: #000;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 1.2rem;
	line-height: 1;
	box-shadow: none;
	pointer-events: none;
	z-index: 3;
}

.acchi-tabs__card-icon .dashicons,
.acchi-tabs__card-icon [class^="fa-"],
.acchi-tabs__card-icon [class*=" fa-"],
.acchi-tabs__card-icon .fas,
.acchi-tabs__card-icon .far,
.acchi-tabs__card-icon .fab {
	color: #000 !important;
	width: auto;
	height: auto;
	font-size: 1.2rem;
	line-height: 1;
}

/* Tipografía alineada al mockup (Avada infla h4 → forzar) */
.acchi-tabs h4.acchi-tabs__card-title,
.acchi-tabs .acchi-tabs__card-title {
	margin: 0.35rem 0 0.4rem !important;
	padding: 0 !important;
	font-size: 1.125rem !important; /* ~18px */
	font-weight: 700 !important;
	line-height: 1.3 !important;
	color: var(--acchi-tabs-text) !important;
	letter-spacing: normal !important;
	text-transform: none !important;
}

.acchi-tabs .acchi-tabs__card-summary {
	margin: 0 !important;
	font-size: 0.8125rem !important; /* ~13px */
	font-weight: 400 !important;
	color: var(--acchi-tabs-muted) !important;
	line-height: 1.4 !important;
	max-width: 32em;
}

/* Modales (contenedor fuera de las tarjetas) */
.acchi-tabs__modals {
	display: contents;
}

/* Modal — estilos autónomos (el modal se mueve a body al abrir) */
.acchi-tabs__modal {
	--acchi-tabs-accent: #ffd500;
	--acchi-tabs-text: #1a1a1a;
	--acchi-tabs-muted: #8a8a8a;
	position: fixed;
	inset: 0;
	z-index: 999999;
	align-items: center;
	justify-content: center;
	padding: 1.5rem;
	box-sizing: border-box;
	font-family: inherit;
}

.acchi-tabs__modal[hidden] {
	display: none !important;
}

.acchi-tabs__modal:not([hidden]) {
	display: flex !important;
}

.acchi-tabs__modal-overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
	cursor: pointer;
	border: 0;
}

.acchi-tabs__modal-dialog {
	position: relative;
	z-index: 1;
	width: min(480px, 100%);
	max-height: min(88vh, 760px);
	overflow: auto;
	background: #fff;
	border-radius: 18px;
	padding: 0;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
	outline: none;
}

.acchi-tabs__modal-close {
	position: absolute;
	top: 0.85rem;
	right: 0.85rem;
	z-index: 3;
	width: 36px;
	height: 36px;
	border: 1px solid #e8e8e8;
	border-radius: 50%;
	background: #fff;
	color: #555;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.acchi-tabs__modal-close:hover,
.acchi-tabs__modal-close:focus-visible {
	background: #f5f5f5;
	color: #1a1a1a;
	border-color: #ccc;
	outline: none;
}

.acchi-tabs__modal-header {
	padding: 2.25rem 2.5rem 1.25rem;
	text-align: center;
}

.acchi-tabs__modal-icon {
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: var(--acchi-tabs-accent);
	color: #000;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 1.25rem;
	line-height: 1;
	margin: 0 auto 1rem;
	flex-shrink: 0;
}

.acchi-tabs__modal-icon .dashicons,
.acchi-tabs__modal-icon [class^="fa-"],
.acchi-tabs__modal-icon [class*=" fa-"],
.acchi-tabs__modal-icon .fas,
.acchi-tabs__modal-icon .far,
.acchi-tabs__modal-icon .fab {
	color: #000 !important;
	width: auto;
	height: auto;
	font-size: 1.25rem;
	line-height: 1;
}

.acchi-tabs__modal-title,
h4.acchi-tabs__modal-title {
	margin: 0 !important;
	padding: 0 !important;
	font-size: 1.125rem !important;
	font-weight: 700 !important;
	line-height: 1.35 !important;
	color: var(--acchi-tabs-text) !important;
	text-align: center !important;
	font-family: inherit !important;
	letter-spacing: normal !important;
	text-transform: none !important;
}

.acchi-tabs__modal-body {
	padding: 0 2.5rem 2.25rem;
	font-size: 0.875rem;
	line-height: 1.6;
	color: var(--acchi-tabs-muted);
	text-align: left;
}

.acchi-tabs__modal-body > *:first-child {
	margin-top: 0;
}

.acchi-tabs__modal-body > *:last-child {
	margin-bottom: 0;
}

.acchi-tabs__modal-body p {
	margin: 0 0 0.75rem;
}

.acchi-tabs__modal-body ul,
.acchi-tabs__modal-body ol {
	margin: 0 0 0.75rem;
	padding-left: 1.25rem;
}

.acchi-tabs__modal-body img {
	max-width: 100%;
	height: auto;
	border-radius: 8px;
}

body.acchi-tabs-modal-open {
	overflow: hidden;
}

body.acchi-tabs-modal-open .acchi-tabs__card {
	transform: none !important;
}

/* Mobile: padres arriba + grilla a 1 columna, sin overflow horizontal */
@media (max-width: 768px) {
	.acchi-tabs {
		--acchi-tabs-nav-width: 100%;
		width: 100% !important;
		max-width: 100% !important;
		overflow-x: hidden;
		box-sizing: border-box;
	}

	.acchi-tabs__header {
		padding: 0 0.25rem;
		margin-bottom: 1.25rem;
	}

	.acchi-tabs h2.acchi-tabs__title,
	.acchi-tabs .acchi-tabs__title {
		font-size: 24px !important;
	}

	.acchi-tabs .acchi-tabs__subtitle {
		font-size: 15px !important;
		padding: 0 0.25rem;
	}

	.acchi-tabs__layout {
		display: flex !important;
		flex-direction: column !important;
		grid-template-columns: none !important;
		gap: 0.85rem;
		width: 100%;
		max-width: 100%;
		min-width: 0;
	}

	.acchi-tabs__nav {
		position: static;
		padding-top: 0;
		margin: 0;
		width: 100%;
		max-width: 100%;
		min-width: 0;
	}

	/* Mobile: dropdown en lugar de tabs horizontales */
	.acchi-tabs__nav-select-label,
	.acchi-tabs__nav-select {
		display: block;
	}

	.acchi-tabs__nav-list {
		display: none !important;
	}

	.acchi-tabs__panels {
		width: 100%;
		max-width: 100%;
		min-width: 0;
	}

	.acchi-tabs__panel {
		padding: 1.75rem 0.9rem 1.15rem;
		border-radius: 14px;
		width: 100%;
		max-width: 100%;
		box-sizing: border-box;
		overflow: visible;
	}

	.acchi-tabs__grid {
		display: grid !important;
		grid-template-columns: 1fr !important;
		gap: 1.5rem;
		padding-top: 0.35rem;
		width: 100%;
		max-width: 100%;
		min-width: 0;
	}

	.acchi-tabs__card {
		width: 100%;
		max-width: 100%;
		min-width: 0;
		min-height: 0;
		margin: 1rem 0 0;
		box-shadow: none !important;
	}

	.acchi-tabs__card-body {
		padding: 1.85rem 1rem 1.15rem;
		width: 100%;
		max-width: 100%;
		box-sizing: border-box;
	}

	.acchi-tabs__card-icon {
		width: 44px;
		height: 44px;
		font-size: 1.05rem;
	}

	.acchi-tabs h4.acchi-tabs__card-title,
	.acchi-tabs .acchi-tabs__card-title {
		font-size: 1rem !important; /* ~16px en mobile */
		word-wrap: break-word;
		overflow-wrap: anywhere;
	}

	.acchi-tabs .acchi-tabs__card-summary {
		font-size: 0.8125rem !important;
		max-width: 100%;
		word-wrap: break-word;
		overflow-wrap: anywhere;
	}

	.acchi-tabs__modal {
		padding: 1rem;
	}

	.acchi-tabs__modal-dialog {
		width: min(420px, calc(100vw - 2rem));
		border-radius: 16px;
	}

	.acchi-tabs__modal-header {
		padding: 2rem 1.5rem 1rem;
	}

	.acchi-tabs__modal-body {
		padding: 0 1.5rem 1.75rem;
		font-size: 0.8125rem;
	}

	.acchi-tabs__modal-title,
	h4.acchi-tabs__modal-title {
		font-size: 1rem !important;
	}
}

@media (prefers-reduced-motion: reduce) {
	.acchi-tabs__nav-item,
	.acchi-tabs__card {
		transition: none;
	}
}
