/**
 * PowerX Accordion Menu Component Styles
 *
 * Architecture (Tasks 373 & 397):
 * - Unified [data-state="open"] / [data-state="closed"] and .is-open / .is-closed single selector family.
 * - Low-specificity, clean CSS rules referencing universal design tokens.
 * - SSOT 4px radius standard and zero hover lift.
 *
 * TABLE OF CONTENTS:
 * -----------------------------------------------------------------------------
 * 1.0 - Accordion Scope & Heading
 * 2.0 - Items & Interactive Trigger
 * 3.0 - Unified Open & Active States (Single Selector Family)
 * 4.0 - Category Titles & Counter Badges
 * 5.0 - Dynamic Icons (Chevron, Caret, Plus/Minus)
 * 6.0 - Collapsible Panel & Transitions
 * 7.0 - Sub-Items Nested Tree List
 * 8.0 - Direct Items Mode List
 * 9.0 - Categories Only Mode (Reyon Gezgini / Pure Category Navigation)
 * -----------------------------------------------------------------------------
 *
 * @package PowerX_Core
 * @version 0.0.1
 */

/* =============================================================================
   1.0 - ACCORDION SCOPE & HEADING
   ============================================================================= */
.powerx-accordion-menu {
	width: 100%;
	font-family: inherit;
}

.px-acc-widget-heading {
	margin-bottom: 16px;
	padding-bottom: 12px;
	border-bottom: 1px solid var(--powerx-neutral-150, #eaeaef);
}

.px-acc-widget-title {
	font-size: 21px;
	font-weight: 700;
	color: var(--powerx-neutral-900, #212134);
	margin: 0;
	line-height: 1.25;
	letter-spacing: -0.015em;
}

.px-acc-items-wrapper {
	display: flex;
	flex-direction: column;
	gap: 0;
}

/* =============================================================================
   2.0 - ITEMS & INTERACTIVE TRIGGER
   ============================================================================= */
.px-acc-item {
	position: relative;
	border-bottom: 1px solid var(--powerx-neutral-150, #eaeaef);
}

.px-acc-item:last-child {
	border-bottom: none;
}

.px-acc-trigger {
	width: 100%;
	min-height: 44px;
	background: transparent;
	border: none;
	box-shadow: none;
	padding: 11px 0;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	text-align: left;
	cursor: pointer;
	color: var(--powerx-neutral-800, #32324d);
	font-size: 15px;
	font-weight: 600;
	line-height: 1.35;
	outline: none;
	appearance: none;
	-webkit-appearance: none;
	transition: color 0.2s ease;
}

.px-acc-trigger:hover {
	color: var(--powerx-primary-500, #4945ff);
}

.px-acc-trigger:focus-visible {
	outline: 2px solid var(--powerx-primary-500, #4945ff);
	outline-offset: 2px;
	border-radius: var(--powerx-radius-sm, 4px);
}

/* =============================================================================
   3.0 - UNIFIED OPEN & ACTIVE STATES (TASK 373: SINGLE SELECTOR FAMILY)
   ============================================================================= */
.px-acc-item[data-state="open"] > .px-acc-trigger,
.px-acc-item.is-open > .px-acc-trigger,
.px-acc-item.is-current-term > .px-acc-trigger {
	color: var(--powerx-primary-500, #4945ff);
	font-weight: 700;
}

/* =============================================================================
   4.0 - CATEGORY TITLES & COUNTER BADGES
   ============================================================================= */
.px-acc-title-group {
	flex: 1 1 auto;
	min-width: 0;
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.px-acc-category-title {
	display: block;
	flex: 1 1 auto;
	min-width: 0;
	white-space: normal;
	overflow-wrap: break-word;
	word-break: normal;
	line-height: 1.35;
}

.px-acc-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: var(--px-acc-badge-padding, 2px 7px);
	font-size: 11px;
	font-weight: 600;
	line-height: 1;
	background: var(--powerx-neutral-100, #f6f6f9);
	color: var(--powerx-neutral-600, #666687);
	border-radius: var(--powerx-radius-sm, 4px);
	flex-shrink: 0;
}

/* =============================================================================
   5.0 - DYNAMIC ICONS (CHEVRON, CARET, PLUS/MINUS)
   ============================================================================= */
.px-acc-icon {
	flex-shrink: 0;
	width: 20px;
	height: 20px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: var(--powerx-neutral-500, #8e8ea9);
	transition: transform 0.25s ease, color 0.2s ease;
}

.px-acc-trigger:hover .px-acc-icon {
	color: var(--powerx-primary-500, #4945ff);
}

.px-acc-svg {
	transition: transform 0.25s ease;
}

.px-acc-item[data-state="open"] .px-acc-svg-chevron,
.px-acc-item.is-open .px-acc-svg-chevron {
	transform: rotate(180deg);
}

.px-acc-icon[data-icon="caret"] .px-acc-svg {
	transform: rotate(-90deg);
}

.px-acc-item[data-state="open"] .px-acc-icon[data-icon="caret"] .px-acc-svg,
.px-acc-item.is-open .px-acc-icon[data-icon="caret"] .px-acc-svg {
	transform: rotate(0deg);
}

.px-acc-item[data-state="open"] .px-acc-icon,
.px-acc-item.is-open .px-acc-icon {
	color: var(--powerx-primary-500, #4945ff);
}

.px-acc-svg-minus {
	display: none;
}

.px-acc-item[data-state="open"] .px-acc-svg-plus,
.px-acc-item.is-open .px-acc-svg-plus {
	display: none;
}

.px-acc-item[data-state="open"] .px-acc-svg-minus,
.px-acc-item.is-open .px-acc-svg-minus {
	display: block;
}

/* =============================================================================
   6.0 - COLLAPSIBLE PANEL & TRANSITIONS
   ============================================================================= */
.px-acc-panel {
	max-height: 0;
	opacity: 0;
	overflow: hidden;
}

.px-acc-panel[hidden] {
	display: none;
}

.px-acc-item[data-state="open"] > .px-acc-panel,
.px-acc-item.is-open > .px-acc-panel {
	max-height: none;
	opacity: 1;
	overflow: visible;
}

.powerx-accordion-menu.px-acc-ready .px-acc-panel {
	transition: max-height 0.28s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
}

.px-acc-panel-inner {
	padding: 2px 0 10px 0;
}

/* =============================================================================
   7.0 - SUB-ITEMS NESTED TREE LIST
   ============================================================================= */
.px-acc-sublist {
	margin: 0;
	padding: 0;
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.px-acc-sublist.px-acc-parent-direct-products {
	margin-top: var(--powerx-spacing-xs, 6px);
}

.px-acc-subitem {
	margin: 0;
	padding: 0;
	list-style: none;
}

.px-acc-sublink {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 0;
	color: var(--powerx-neutral-600, #666687);
	text-decoration: none;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.35;
	background: transparent;
	transition: color 0.2s ease;
}

.px-acc-bullet {
	width: var(--px-menu-bullet-size, 5px);
	height: var(--px-menu-bullet-size, 5px);
	border-radius: 50%;
	background-color: var(--px-menu-bullet-color, var(--powerx-neutral-400, #a5a5ba));
	flex-shrink: 0;
	display: inline-block;
	transition: background-color 0.2s ease;
}

.px-acc-subtext {
	flex: 1 1 auto;
	min-width: 0;
	white-space: normal;
	overflow-wrap: break-word;
	word-break: normal;
	line-height: 1.35;
}

.px-acc-sublink:hover {
	color: var(--powerx-primary-500, #4945ff);
}

.px-acc-sublink:hover .px-acc-bullet {
	background-color: var(--powerx-primary-500, #4945ff);
}

.px-acc-subitem.is-active-item .px-acc-sublink,
.px-acc-subitem.active-product .px-acc-sublink,
.px-acc-direct-item.is-active-item .px-acc-direct-link,
.px-acc-direct-item.active-product .px-acc-direct-link {
	color: var(--powerx-primary-500, #4945ff);
	font-weight: 700;
}

.px-acc-subitem.is-active-item .px-acc-bullet,
.px-acc-subitem.active-product .px-acc-bullet,
.px-acc-direct-item.is-active-item .px-acc-bullet,
.px-acc-direct-item.active-product .px-acc-bullet {
	background-color: var(--powerx-primary-500, #4945ff);
}

.px-acc-sublink:hover,
.px-acc-direct-link:hover,
.px-acc-trigger:hover {
	transform: none !important;
}

/* 7.1 Subcategory nested groups & trees */
.px-acc-subcat-group {
	margin-top: 6px;
	margin-bottom: 6px;
}

.px-acc-subcat-group:first-child {
	margin-top: 2px;
}

.px-acc-subcat-group:last-child {
	margin-bottom: 2px;
}

.px-acc-subcat-header {
	display: flex;
	align-items: center;
	padding: var(--px-acc-subcat-header-padding, 4px 0 4px 2px);
}

.px-acc-subcat-title-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 14px;
	font-weight: 600;
	color: var(--powerx-neutral-800, #1e293b);
	text-decoration: none;
	line-height: 1.35;
	transition: color 0.2s ease;
}

.px-acc-subcat-title-link:hover,
.px-acc-subcat-title-link.is-current-page {
	color: var(--powerx-neutral-900, #0f172a);
	font-weight: 700;
}

.px-acc-subcat-group.is-active-subcat > .px-acc-subcat-header .px-acc-subcat-title-link {
	color: var(--powerx-neutral-900, #0f172a);
	font-weight: 700;
}

.px-acc-subcat-products,
.px-acc-parent-direct-products,
.px-acc-sublist {
	margin-left: 6px;
	padding-left: 10px;
	border-left-width: var(--px-menu-tree-line-width, 1px);
	border-left-style: var(--px-menu-tree-line-style, solid);
	border-left-color: var(--px-menu-tree-line-color, var(--powerx-neutral-200, #e2e8f0));
	margin-top: 2px;
}

/* =============================================================================
   8.0 - DIRECT ITEMS MODE LIST
   ============================================================================= */
.px-acc-direct-list {
	margin: 0;
	padding: 0;
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 0;
}

.px-acc-direct-item {
	margin: 0;
	padding: 0;
	list-style: none;
	border-bottom: 1px solid var(--powerx-neutral-100, #f1f5f9);
}

.px-acc-direct-item:last-child {
	border-bottom: none;
}

.px-acc-direct-link {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 13px 0;
	color: var(--powerx-neutral-700, #334155);
	text-decoration: none;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.35;
	background: transparent;
	transition: color 0.2s ease;
}

.px-acc-direct-link .px-acc-bullet {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background-color: var(--powerx-neutral-400, #94a3b8);
	flex-shrink: 0;
	display: inline-block;
	transition: background-color 0.2s ease;
}

.px-acc-direct-link .px-acc-subtext {
	font-size: 16px;
	font-weight: 600;
	line-height: 1.35;
}

.px-acc-direct-link:hover {
	color: var(--powerx-neutral-900, #0f172a);
}

.px-acc-direct-link:hover .px-acc-bullet {
	background-color: var(--powerx-neutral-900, #0f172a);
}

.px-acc-empty {
	padding: 6px 0;
	font-size: 13px;
	color: var(--powerx-neutral-400, #94a3b8);
	font-style: italic;
}

/* =============================================================================
   9.0 - CATEGORIES ONLY MODE (REYON GEZGINI / PURE CATEGORY NAVIGATION)
   ============================================================================= */
.px-acc-categories-only-mode .px-acc-item {
	border-bottom: 1px solid var(--powerx-neutral-150, #eaeaef);
}

.px-acc-cat-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	min-height: 44px;
	gap: 8px;
}

.px-acc-cat-link {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	align-items: center;
	padding: 11px 0;
	color: var(--powerx-neutral-800, #32324d);
	font-size: 15px;
	font-weight: 600;
	line-height: 1.35;
	text-decoration: none;
	background: transparent;
	transition: color 0.2s ease;
}

.px-acc-cat-link:hover {
	color: var(--powerx-primary-500, #4945ff);
}

.px-acc-cat-link:focus-visible {
	outline: 2px solid var(--powerx-primary-500, #4945ff);
	outline-offset: 2px;
	border-radius: var(--powerx-radius-sm, 4px);
}

.px-acc-item.is-current-term > .px-acc-cat-row > .px-acc-cat-link,
.px-acc-cat-link.is-current-page {
	color: var(--powerx-primary-500, #4945ff);
	font-weight: 700;
}

.px-acc-cat-toggle {
	flex-shrink: 0;
	width: 36px;
	height: 36px;
	min-height: 36px;
	padding: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: transparent;
	border: none;
	box-shadow: none;
	cursor: pointer;
	color: var(--powerx-neutral-600, #666687);
	border-radius: var(--powerx-radius-sm, 4px);
	outline: none;
	transition: color 0.2s ease, background-color 0.2s ease;
}

.px-acc-cat-toggle:hover {
	color: var(--powerx-primary-500, #4945ff);
	background-color: var(--powerx-neutral-100, #f6f6f9);
}

.px-acc-cat-toggle:focus-visible {
	outline: 2px solid var(--powerx-primary-500, #4945ff);
	outline-offset: 2px;
}

.px-acc-item[data-state="open"] > .px-acc-cat-row > .px-acc-cat-toggle,
.px-acc-item.is-open > .px-acc-cat-row > .px-acc-cat-toggle {
	color: var(--powerx-primary-500, #4945ff);
}

/* Subcategory List in Categories Only Mode */
.px-acc-subcat-only-list {
	list-style: none;
	margin: 0;
	padding: 4px 0 12px 14px;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.px-acc-subcat-only-item {
	margin: 0;
	padding: 0;
}

.px-acc-subcat-only-link {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 7px 10px;
	font-size: 14px;
	font-weight: 500;
	color: var(--powerx-neutral-700, #4a4a68);
	text-decoration: none;
	border-radius: var(--powerx-radius-sm, 4px);
	background: transparent;
	transition: color 0.15s ease, background-color 0.15s ease;
}

.px-acc-subcat-only-link:hover {
	color: var(--powerx-primary-500, #4945ff);
	background-color: var(--powerx-neutral-100, #f6f6f9);
}

.px-acc-subcat-only-link:focus-visible {
	outline: 2px solid var(--powerx-primary-500, #4945ff);
	outline-offset: 1px;
}

.px-acc-subcat-only-link.is-current-page {
	color: var(--powerx-primary-500, #4945ff);
	font-weight: 600;
	background-color: var(--powerx-primary-50, rgba(73, 69, 255, 0.06));
}

.px-acc-subcat-only-link .px-acc-bullet {
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background-color: var(--powerx-neutral-400, #a5a5ba);
	flex-shrink: 0;
	display: inline-block;
	transition: background-color 0.15s ease;
}

.px-acc-subcat-only-link:hover .px-acc-bullet,
.px-acc-subcat-only-link.is-current-page .px-acc-bullet {
	background-color: var(--powerx-primary-500, #4945ff);
}

.px-acc-subcat-only-link .px-acc-subtext {
	flex: 1 1 auto;
	min-width: 0;
	line-height: 1.35;
}
