/**
 * My Account Sidebar - Frontend Styles
 *
 * BEM Naming Convention: wc-addons-sidebar__element--modifier
 *
 * @package My_Account_Extensions
 * @version 1.0.0
 * @since 1.0.0
 * @lastmod 2025-10-25
 *
 * Session (2025-10-25 | 04:37): Mobile/Touch Device Click & Hover Optimization
 * - Added comprehensive touch device handling (lines 1193-1297)
 * - Uses @media (hover: none) to disable sticky hover on touch devices
 * - Uses @media (hover: hover) for desktop-only hover effects
 * - CRITICAL FIX: Section header sticky opacity (lines 1094-1101)
 *   - Added missing :active state (opacity: 0.8) - provides tap feedback
 *   - Added missing :focus state (opacity: 1.0) - RESETS after tap
 *   - Complete interaction cycle now defined: normal → hover → active → focus
 *   - Previous issue: only :hover was defined, no reset instruction for :focus
 *   - User insight: "missing click and active action definitions" was correct!
 * - Fixes :focus/:active conflict for proper click backgrounds on mobile
 * - Disables tap highlight for iOS Safari with -webkit-tap-highlight-color
 * - Targets: menu items, section headers, toggle button, off-canvas trigger
 * - Result: Clean touch interactions with no sticky hover or visual bugs
 *
 * Session (2025-10-23 | 07:04): Toggle Button Position - Responsive Fix
 * - Removed hardcoded media query override (top: 5px; right: 5px at 768px)
 * - Toggle button position control now respects setting on all screen sizes
 * - Off-canvas mode positioning unaffected (has its own rules)
 * - Responsive offset controls allow per-device fine-tuning
 *
 * Session (2025-10-18 | 19:41): Hide WooCommerce Default Navigation
 * - Added CSS to hide WooCommerce default navigation bar
 * - Content area expanded to full width (removes left margin/padding)
 * - Targets both custom container and Elementor widget structure
 * - Used !important to override WooCommerce default styles
 *
 * Session (2025-10-18 | 10:10): SPA Navigation - AJAX Loading States
 * - Added .mae-loading class for content area during AJAX transitions
 * - Loading spinner animation with rotating border
 * - Smooth opacity transition (dims to 0.6 during load)
 * - Spinner positioned center of content area
 *
 * Session (2025-10-17 | 11:46): Configurable Toggle Position
 * - Added 4 corner position classes (top-left, top-right, bottom-left, bottom-right)
 * - Added CSS custom properties for horizontal/vertical offsets
 * - RTL support for all 4 positions
 *
 * Phase 9 Enhancements:
 * - Loading states with animated skeleton UI
 * - Enhanced smooth transitions for all state changes
 * - Submenu expand/collapse animations with max-height
 * - Section and header transition effects
 * - RTL (Right-to-Left) language support
 * - Comprehensive responsive behavior styling
 */

/* ==========================================================================
   Core Sidebar Structure
   ========================================================================== */

/* CRITICAL FIX (Session 2025-10-22 | 16:01): Don't set position on off-canvas sidebars! */
.wc-addons-sidebar:not(.wc-addons-sidebar--mobile-offcanvas) {
	position: relative;
}

.wc-addons-sidebar {
	display: flex;
	flex-direction: column;
	box-sizing: border-box;
}

/* ==========================================================================
   Positioning & Layout (Phase 7)
   ========================================================================== */

/* CSS Custom Properties - set dynamically by JavaScript */
.wc-addons-sidebar {
	--header-height: 0px;
	--footer-height: 0px;
	--top-offset: 0px;
	--bottom-offset: 0px;
}

/* Sticky positioning class (applied via JavaScript when enabled) */
.wc-addons-sidebar[data-sticky="true"] {
	/* JavaScript applies inline styles for:
	 * - position: sticky
	 * - top: calculated value
	 * - height: calc(100vh - header - footer - offsets)
	 * - left/right: 0 (based on position_side)
	 * - overflow-y: auto
	 */
}

/* Ensure sidebar scrolls independently */
.wc-addons-sidebar[data-sticky="true"] {
	overflow-y: auto;
	overflow-x: hidden;
}

/* ==========================================================================
   Header & Title
   ========================================================================== */

/* Session (2025-10-23 | 16:46): Title separator now controlled by Elementor
 * Removed hardcoded: border-bottom, padding-bottom, margin-bottom
 * Controls: Style Tab → Title Style → Title Separator Line
 */
.wc-addons-sidebar__header {
	/* All styling now controlled by Elementor controls */
}

.wc-addons-sidebar__title {
	margin: 0;
	font-size: 18px;
	font-weight: 600;
	color: #333333;
	/* Ensure title wraps within sidebar bounds - Session (2025-10-19 | 07:51) */
	max-width: 100%;
	word-wrap: break-word;
	overflow-wrap: break-word;
	white-space: normal;
	box-sizing: border-box;
}

/* ==========================================================================
   Toggle Button
   ========================================================================== */

.wc-addons-sidebar__toggle {
	position: absolute;
	padding: 8px;
	background: transparent;
	border: 1px solid #e0e0e0;
	border-radius: 4px;
	cursor: pointer;
	transition: all 0.3s ease;

	/* CSS Custom Properties for offsets (set by Elementor controls) */
	--toggle-h-offset: 0px;
	--toggle-v-offset: 0px;
}

/* Position Classes (set via data attribute) */
.wc-addons-sidebar__toggle--top-right {
	top: calc(10px + var(--toggle-v-offset));
	right: calc(10px + var(--toggle-h-offset));
	bottom: auto;
	left: auto;
}

.wc-addons-sidebar__toggle--top-left {
	top: calc(10px + var(--toggle-v-offset));
	left: calc(10px + var(--toggle-h-offset));
	bottom: auto;
	right: auto;
}

.wc-addons-sidebar__toggle--bottom-right {
	bottom: calc(10px - var(--toggle-v-offset));
	right: calc(10px + var(--toggle-h-offset));
	top: auto;
	left: auto;
}

.wc-addons-sidebar__toggle--bottom-left {
	bottom: calc(10px - var(--toggle-v-offset));
	left: calc(10px + var(--toggle-h-offset));
	top: auto;
	right: auto;
}

.wc-addons-sidebar__toggle:hover {
	background-color: #f5f5f5;
	border-color: #0073aa;
}

.wc-addons-sidebar__toggle-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 16px;
	/* Color inherits from parent (.wc-addons-sidebar__toggle) - controlled by Elementor - Session (2025-10-19 | 07:51) */
	color: inherit;
}

/* ==========================================================================
   Menu Container
   ========================================================================== */

/* Session (2025-10-23 | 16:46): Menu sections gap now controlled by Elementor
 * Removed: hardcoded gap: 4px
 * Controls: Style Tab → Sidebar Style → Menu Sections Gap (Expanded/Minimized)
 */
.wc-addons-sidebar__menu {
	display: flex;
	flex-direction: column;
}

/* ==========================================================================
   Menu Items
   ========================================================================== */

.wc-addons-sidebar__item {
	position: relative;
}

.wc-addons-sidebar__link {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%; /* Full width for alignment controls to work (Session 2025-10-21 | 06:58) */
	box-sizing: border-box; /* Ensure padding doesn't break width (Session 2025-10-21 | 06:58) */
	text-decoration: none;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
	border-radius: 4px;
}

.wc-addons-sidebar__link:focus {
	outline: 2px solid #0073aa;
	outline-offset: 2px;
}

/* ==========================================================================
   Icons & Labels
   ========================================================================== */

.wc-addons-sidebar__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 20px;
	font-size: 14px;
	transition: color 0.2s ease, transform 0.2s ease;
}

.wc-addons-sidebar__label {
	/* flex: 1 removed - was preventing alignment controls from working (Session 2025-10-21 | 06:58) */
	/* Label is now auto-width, allowing justify-content to work on parent link */
	font-size: 14px;
	transition: color 0.2s ease, opacity 0.2s ease;
}

/* ==========================================================================
   Active State
   ========================================================================== */

.wc-addons-sidebar__item--active .wc-addons-sidebar__link {
	font-weight: 600;
}

/* ==========================================================================
   No Items Message
   ========================================================================== */

.wc-addons-sidebar__no-items {
	padding: 15px;
	text-align: center;
	color: #999999;
	font-size: 14px;
	font-style: italic;
}

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

@media (max-width: 768px) {
	.wc-addons-sidebar {
		/* Use CSS var set by Elementor, fallback to 100% - Session (2025-10-19 | 07:51) */
		width: var(--sidebar-width-mobile, 100%);
	}

	/* Removed hardcoded toggle position override - Session (2025-10-23 | 07:04) */
	/* Toggle button now respects position control setting on all screen sizes */
	/* Off-canvas mode has its own positioning (lines 374-379) */
}

/* ==========================================================================
   Responsive Behaviors (Phase 8)
   ========================================================================== */

/* Mobile behaviors - Applied via JavaScript based on data-mobile-behavior */

/* Hidden mode - Hide sidebar completely */
.wc-addons-sidebar--mobile-hidden {
	display: none !important;
}

/* Off-canvas mode - Sidebar slides in from side */
/* Session (2025-10-22 | 14:09): Fixed stacking context issue */
/* Replaced transform with left/right positioning to prevent transform from creating new stacking context */
/* This ensures z-index works correctly and overlay doesn't block sidebar clicks */
/* Session (2025-10-22 | 17:49): Increased specificity to beat Elementor inline CSS */
/* Round 1: (0,2,0) - NOT ENOUGH - Elementor also has (0,2,0) and wins by cascade order */
/* Round 2: Increased to (0,3,0) by adding :not(:empty) pseudo-class */
.wc-addons-sidebar.wc-addons-sidebar--mobile-offcanvas:not(:empty) {
	position: fixed;
	top: 0;
	bottom: 0;
	/* Use CSS var set by Elementor, fallback to 280px - Session (2025-10-19 | 07:51) */
	/* Session (2025-10-24 | 10:27): Add !important to override Elementor desktop width rule */
	/* Justified: Overriding third-party (Elementor) styles with unpredictable specificity */
	/* User still controls value via Elementor (sets CSS variable in off-canvas width control) */
	width: var(--sidebar-width-offcanvas, 280px) !important;
	/* Session (2025-10-24 | 08:27): Use 100dvh for mobile browser UI compatibility */
	/* dvh = dynamic viewport height, adjusts for mobile address bar/toolbar */
	/* Fallback: top: 0 + bottom: 0 stretches to fill available space */
	height: 100dvh !important; /* Modern browsers with dynamic viewport support */
	height: 100vh !important; /* Fallback for older browsers */
	/* Session (2025-10-22 | 16:58): CRITICAL FIX - Add !important to override Elementor inline styles */
	/* Elementor generates .wc-addons-sidebar[data-widget-id="..."] { left: 0px; } with higher specificity */
	left: calc(-1 * var(--sidebar-width-offcanvas, 280px)) !important; /* Hidden off-screen */
	transition: left 0.3s ease;
	z-index: 9998;
	box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
}

/* Off-canvas when open */
.wc-addons-sidebar.wc-addons-sidebar--mobile-offcanvas.wc-addons-sidebar--offcanvas-open:not(:empty) {
	left: 0 !important; /* Slide into view - !important to override Elementor */
}

/* Off-canvas from right side */
.wc-addons-sidebar.wc-addons-sidebar--mobile-offcanvas[data-position-side="right"]:not(:empty) {
	left: auto !important;
	/* Session (2025-10-22 | 14:09): Use right position instead of transform */
	right: calc(-1 * var(--sidebar-width-offcanvas, 280px)) !important; /* Hidden off-screen */
	transition: right 0.3s ease;
}

.wc-addons-sidebar.wc-addons-sidebar--mobile-offcanvas[data-position-side="right"].wc-addons-sidebar--offcanvas-open:not(:empty) {
	right: 0 !important; /* Slide into view - !important to override Elementor */
}

/* Off-canvas overlay */
.wc-addons-sidebar-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background-color: rgba(0, 0, 0, 0.5);
	z-index: 9997;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease;
}

.wc-addons-sidebar-overlay--visible {
	opacity: 1;
	visibility: visible;
}

/* Off-canvas trigger button (hamburger menu) */
.wc-addons-sidebar-trigger {
	position: fixed;
	z-index: 9996;
	width: 50px;
	height: 50px;
	display: flex;
	align-items: center;
	justify-content: center;
	background-color: #0073aa;
	color: #ffffff;
	border: none;
	border-radius: 50%;
	cursor: pointer;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
	transition: all 0.3s ease;
}

.wc-addons-sidebar-trigger:hover {
	background-color: #005a87;
	transform: scale(1.05);
}

.wc-addons-sidebar-trigger i {
	font-size: 20px;
}

/* Trigger positions - Use CSS vars set by Elementor - Session (2025-10-19 | 07:51) */
.wc-addons-sidebar-trigger--top-left {
	top: var(--trigger-offset-v, 20px);
	left: var(--trigger-offset-h, 20px);
}

.wc-addons-sidebar-trigger--top-right {
	top: var(--trigger-offset-v, 20px);
	right: var(--trigger-offset-h, 20px);
}

.wc-addons-sidebar-trigger--bottom-left {
	bottom: var(--trigger-offset-v, 20px);
	left: var(--trigger-offset-h, 20px);
}

.wc-addons-sidebar-trigger--bottom-right {
	bottom: var(--trigger-offset-v, 20px);
	right: var(--trigger-offset-h, 20px);
}

/* Close button in off-canvas mode */
/* Session (2025-10-25 | 13:30): Position now controlled by JavaScript via Elementor controls */
.wc-addons-sidebar--mobile-offcanvas .wc-addons-sidebar__toggle {
	/* Position, top, right, bottom, left are set via JavaScript inline styles */
	/* This allows Elementor controls to position the close button dynamically */
	z-index: 10;
}

/* Touch-friendly mode (Phase 8) - Larger tap targets */
.wc-addons-sidebar--touch-friendly .wc-addons-sidebar__link {
	/* padding removed - controlled by Elementor (Session 2025-10-21 | 06:58) */
	min-height: 48px; /* Keep for accessibility */
}

.wc-addons-sidebar--touch-friendly .wc-addons-sidebar__icon {
	width: 24px;
	font-size: 18px;
}

.wc-addons-sidebar--touch-friendly .wc-addons-sidebar__toggle {
	min-width: 44px;
	min-height: 44px;
	padding: 12px;
}

.wc-addons-sidebar--touch-friendly .wc-addons-sidebar__submenu {
	padding-left: 30px;
}

/* ==========================================================================
   Sections & Groups (Phase 9 - Enhanced transitions)
   ========================================================================== */

/* Session (2025-10-23 | 16:46): Menu section container now fully controlled by Elementor
 * Removed: hardcoded margin-bottom
 * Controls: Style Tab → Menu Section Container (Expanded/Minimized)
 */
.wc-addons-sidebar__section {
	transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Session (2025-10-23 | 16:46): Section header styling now controlled by Elementor
 * Removed: hardcoded padding (8px 15px 6px 15px), hardcoded margin-bottom (4px)
 * Controls: Style Tab → Section Header Style
 */
.wc-addons-sidebar__section-header {
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: #999999;
	transition: color 0.2s ease, opacity 0.2s ease, height 0.2s ease, padding 0.2s ease, margin 0.2s ease;
}

.wc-addons-sidebar__section-header--visible {
	display: block;
}

/* Session (2025-10-23 | 16:46): Section dividers now fully controlled by Elementor
 * Removed: display:none (was hiding dividers), hardcoded height, background-color, margin
 * All styling: Style Tab → Section Divider Style
 */
.wc-addons-sidebar__section-divider {
	/* All styling controlled by Elementor - uses border-top for the line */
	transition: opacity 0.3s ease;
}

/* ==========================================================================
   Minimized State (Phase 4 - Icon Only Mode)
   ========================================================================== */

.wc-addons-sidebar {
	transition: width 0.3s ease;
}

.wc-addons-sidebar--minimized {
	/* Use CSS var set by Elementor, fallback to 60px - Session (2025-10-19 | 07:51) */
	/* !important needed to override Elementor inline styles */
	width: var(--sidebar-width-minimized, 60px) !important;
}

/* Hide labels in minimized mode */
.wc-addons-sidebar--minimized .wc-addons-sidebar__label {
	display: none; /* Changed from opacity:0 + width:0 to remove from flex layout (Session 2025-10-21 | 06:58) */
}

/* Hide sidebar title TEXT in minimized mode, but keep header container for separator/icon (Session 2025-10-24 | 11:28) */
.wc-addons-sidebar--minimized .wc-addons-sidebar__header {
	/* Keep header visible for separator line and icon */
	opacity: 1;
	/* Keep separator styling - controlled by Elementor */
	transition: all 0.2s ease;
}

/* Title text visibility control (Session 2025-10-24 | 11:28) */
/* Expanded mode - hide text when data attribute says no */
.wc-addons-sidebar--expanded .wc-addons-sidebar__title[data-text-visible-expanded="no"] .wc-addons-sidebar__title-text {
	display: none;
}

/* Minimized mode - show text when data attribute says yes (default is hidden) */
.wc-addons-sidebar--minimized .wc-addons-sidebar__title-text {
	display: none; /* Hidden by default in minimized mode */
}

.wc-addons-sidebar--minimized .wc-addons-sidebar__title[data-text-visible-minimized="yes"] .wc-addons-sidebar__title-text {
	display: inline; /* Show when explicitly enabled */
}

/* ==========================================================================
   Title Icon (Session 2025-10-24 | 11:28)
   ========================================================================== */

/* Title icon base styles */
.wc-addons-sidebar__title-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: all 0.2s ease;
	font-size: 20px; /* Default size, overridden by Elementor */
}

/* State-based icon visibility - Expanded mode */
.wc-addons-sidebar--expanded .wc-addons-sidebar__title-icon[data-icon-visible-expanded="no"] {
	display: none !important;
}

/* State-based icon visibility - Minimized mode */
.wc-addons-sidebar--minimized .wc-addons-sidebar__title-icon[data-icon-visible-minimized="no"] {
	display: none !important;
}

/* Ensure icon is visible when enabled in minimized mode */
.wc-addons-sidebar--minimized .wc-addons-sidebar__title-icon[data-icon-visible-minimized="yes"] {
	display: inline-flex !important;
}

/* Ensure icon is visible when enabled in expanded mode */
.wc-addons-sidebar--expanded .wc-addons-sidebar__title-icon[data-icon-visible-expanded="yes"] {
	display: inline-flex !important;
}

/* =====================================================
   Two-Line Title Layout (Expanded Mode Only)
   Session: 2025-10-24
   ===================================================== */

/* Two-line title container - Flexbox layout with icon on left */
.wc-addons-sidebar--expanded .wc-addons-sidebar__title--two-line {
	display: flex;
	align-items: flex-start;
	gap: 8px; /* Space between icon and text (can be overridden by Icon Spacing control) */
}

/* Icon in two-line layout - Position independently */
.wc-addons-sidebar--expanded .wc-addons-sidebar__title--two-line .wc-addons-sidebar__title-icon {
	flex-shrink: 0; /* Don't shrink icon */
	position: relative; /* Allow vertical offset with transform */
}

/* Text lines container - Vertical layout */
.wc-addons-sidebar--expanded .wc-addons-sidebar__title--two-line .wc-addons-sidebar__title-lines {
	display: flex;
	flex-direction: column;
	gap: 0; /* Default: no extra spacing (controlled by Two-Line Spacing control in Elementor) */
}

/* Individual lines */
.wc-addons-sidebar--expanded .wc-addons-sidebar__title--two-line .wc-addons-sidebar__title-line1,
.wc-addons-sidebar--expanded .wc-addons-sidebar__title--two-line .wc-addons-sidebar__title-line2 {
	display: block;
	margin: 0; /* Remove any default margin */
	padding: 0; /* Remove any default padding */
	line-height: 1.2; /* Tight line-height (can be overridden by Typography control) */
}

/* Minimized mode - Two-line layout disabled (falls back to single line) */
.wc-addons-sidebar--minimized .wc-addons-sidebar__title--two-line {
	display: block; /* Override flex for minimized mode */
}

.wc-addons-sidebar--minimized .wc-addons-sidebar__title--two-line .wc-addons-sidebar__title-lines {
	display: none; /* Hide two-line structure in minimized mode */
}

/* Session 2025-10-23 | 20:26: Keep section header visible in minimized mode, hide only text */
.wc-addons-sidebar--minimized .wc-addons-sidebar__section-header {
	/* Keep header visible for icon display */
	opacity: 1;
	/* Remove padding/margin to make it compact */
	padding: 0;
	margin: 0;
	transition: all 0.2s ease;
}

/* Hide only the section label text in minimized mode */
.wc-addons-sidebar--minimized .wc-addons-sidebar__section-label {
	display: none;
}

/* Hide the expand/collapse chevron (right side) in minimized mode */
.wc-addons-sidebar--minimized .wc-addons-sidebar__section-icon {
	display: none;
}

/* Hide section dividers in minimized mode */
.wc-addons-sidebar--minimized .wc-addons-sidebar__section-divider {
	display: none;
}

/* Menu item styling in minimized mode */
.wc-addons-sidebar--minimized .wc-addons-sidebar__link {
	/* justify-content removed - controlled by Elementor (Session 2025-10-21 | 06:58) */
	gap: 0; /* Remove gap when label is hidden (Session 2025-10-21 | 06:58) */
	/* padding removed - controlled by Elementor (Session 2025-10-21 | 06:58) */
}

/* Icon positioning in minimized mode - controlled by Elementor alignment (Session 2025-10-21 | 06:58) */
.wc-addons-sidebar--minimized .wc-addons-sidebar__icon {
	/* margin: 0 auto removed - was preventing alignment controls from working */
}

/* Hide submenu indicators in minimized mode */
.wc-addons-sidebar--minimized .wc-addons-sidebar__indicator {
	display: none;
}

/* Adjust toggle button position in minimized mode - center horizontally for all positions */
.wc-addons-sidebar--minimized .wc-addons-sidebar__toggle--top-right,
.wc-addons-sidebar--minimized .wc-addons-sidebar__toggle--top-left {
	left: 50%;
	right: auto;
	transform: translateX(-50%);
	top: calc(10px + var(--toggle-v-offset));
}

.wc-addons-sidebar--minimized .wc-addons-sidebar__toggle--bottom-right,
.wc-addons-sidebar--minimized .wc-addons-sidebar__toggle--bottom-left {
	left: 50%;
	right: auto;
	transform: translateX(-50%);
	bottom: calc(10px - var(--toggle-v-offset));
}

/* ==========================================================================
   Tooltips (Phase 4 - Hover Labels in Minimized Mode)
   ========================================================================== */

.wc-addons-sidebar__tooltip {
	position: fixed;
	z-index: 9999;
	padding: 6px 12px;
	background-color: #333333;
	color: #ffffff;
	font-size: 13px;
	font-weight: 400;
	line-height: 1.4;
	border-radius: 4px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
	pointer-events: none;
	white-space: nowrap;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s ease, visibility 0.2s ease;
}

.wc-addons-sidebar__tooltip--visible {
	opacity: 1;
	visibility: visible;
}

/* Tooltip arrow (optional enhancement) */
.wc-addons-sidebar__tooltip::before {
	content: '';
	position: absolute;
	top: 50%;
	left: -4px;
	transform: translateY(-50%);
	width: 0;
	height: 0;
	border-top: 4px solid transparent;
	border-bottom: 4px solid transparent;
	border-right: 4px solid #333333;
}

/* Tooltip positioning variants */
.wc-addons-sidebar__tooltip--right::before {
	left: -4px;
	border-right: 4px solid #333333;
	border-left: none;
}

.wc-addons-sidebar__tooltip--left::before {
	left: auto;
	right: -4px;
	border-left: 4px solid #333333;
	border-right: none;
}

/* Only show tooltips in minimized mode */
.wc-addons-sidebar:not(.wc-addons-sidebar--minimized) .wc-addons-sidebar__tooltip {
	display: none !important;
}

/* ==========================================================================
   Submenu Indicators (Chevron Icons)
   ========================================================================== */

.wc-addons-sidebar__indicator {
	display: flex;
	align-items: center;
	justify-content: center;
	margin-left: auto;
	font-size: 12px;
	transition: transform 0.2s ease;
}

.wc-addons-sidebar__indicator--expanded {
	transform: rotate(180deg);
}

.wc-addons-sidebar__indicator--collapsed {
	transform: rotate(0deg);
}

/* ==========================================================================
   Submenus (Phase 5 / Phase 9 - Enhanced with smooth transitions)
   ========================================================================== */

.wc-addons-sidebar__submenu {
	display: none;
	padding-left: 20px;
	margin-top: 4px;
	opacity: 0;
	max-height: 0;
	overflow: hidden;
	transition: opacity 0.3s ease, max-height 0.3s ease, margin-top 0.3s ease;
}

.wc-addons-sidebar__submenu--open {
	display: block;
	opacity: 1;
	max-height: 2000px; /* Large enough for most submenus */
	transition: opacity 0.3s ease, max-height 0.5s ease, margin-top 0.3s ease;
}

.wc-addons-sidebar__submenu--level-1 {
	padding-left: 20px;
}

.wc-addons-sidebar__submenu--level-2 {
	padding-left: 40px;
}

.wc-addons-sidebar__submenu--level-3 {
	padding-left: 60px;
}

/* ==========================================================================
   Loading State & Skeleton UI (Phase 9)
   ========================================================================== */

/* Loading state container */
.wc-addons-sidebar--loading {
	opacity: 0.6;
	pointer-events: none;
}

/* Skeleton loader overlay */
.wc-addons-sidebar__skeleton {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: #ffffff;
	z-index: 999;
	padding: 20px;
	box-sizing: border-box;
}

/* Individual skeleton items */
.wc-addons-sidebar__skeleton-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 15px;
	margin-bottom: 4px;
}

.wc-addons-sidebar__skeleton-icon {
	width: 20px;
	height: 20px;
	border-radius: 4px;
	background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
	background-size: 200% 100%;
	animation: skeleton-loading 1.5s infinite;
}

.wc-addons-sidebar__skeleton-label {
	flex: 1;
	height: 14px;
	border-radius: 4px;
	background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
	background-size: 200% 100%;
	animation: skeleton-loading 1.5s infinite;
}

/* Skeleton header */
.wc-addons-sidebar__skeleton-header {
	height: 24px;
	width: 60%;
	margin-bottom: 20px;
	border-radius: 4px;
	background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
	background-size: 200% 100%;
	animation: skeleton-loading 1.5s infinite;
}

/* Skeleton animation */
@keyframes skeleton-loading {
	0% {
		background-position: 200% 0;
	}
	100% {
		background-position: -200% 0;
	}
}

/* Hide skeleton when loaded */
.wc-addons-sidebar--loaded .wc-addons-sidebar__skeleton {
	display: none;
}

/* Smooth fade-in when loaded */
.wc-addons-sidebar--loaded {
	animation: sidebar-fade-in 0.3s ease-in-out;
}

@keyframes sidebar-fade-in {
	from {
		opacity: 0;
		transform: translateY(-10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* ==========================================================================
   RTL (Right-to-Left) Language Support (Phase 9)
   ========================================================================== */

/* Core sidebar RTL adjustments */
[dir="rtl"] .wc-addons-sidebar {
	direction: rtl;
}

/* Toggle button positions - flip horizontally for RTL */
[dir="rtl"] .wc-addons-sidebar__toggle--top-right {
	left: calc(10px + var(--toggle-h-offset));
	right: auto;
}

[dir="rtl"] .wc-addons-sidebar__toggle--top-left {
	right: calc(10px + var(--toggle-h-offset));
	left: auto;
}

[dir="rtl"] .wc-addons-sidebar__toggle--bottom-right {
	left: calc(10px + var(--toggle-h-offset));
	right: auto;
}

[dir="rtl"] .wc-addons-sidebar__toggle--bottom-left {
	right: calc(10px + var(--toggle-h-offset));
	left: auto;
}

/* RTL minimized mode - center horizontally */
[dir="rtl"] .wc-addons-sidebar--minimized .wc-addons-sidebar__toggle--top-right,
[dir="rtl"] .wc-addons-sidebar--minimized .wc-addons-sidebar__toggle--top-left,
[dir="rtl"] .wc-addons-sidebar--minimized .wc-addons-sidebar__toggle--bottom-right,
[dir="rtl"] .wc-addons-sidebar--minimized .wc-addons-sidebar__toggle--bottom-left {
	left: 50%;
	right: auto;
	transform: translateX(-50%);
}

/* Menu link - reverse flex direction for icon/label */
[dir="rtl"] .wc-addons-sidebar__link {
	flex-direction: row-reverse;
}

/* Submenu indicators - flip rotation */
[dir="rtl"] .wc-addons-sidebar__indicator {
	margin-right: auto;
	margin-left: 0;
}

[dir="rtl"] .wc-addons-sidebar__indicator--expanded {
	transform: rotate(-180deg);
}

/* Submenu padding - right instead of left */
[dir="rtl"] .wc-addons-sidebar__submenu {
	padding-left: 0;
	padding-right: 20px;
}

[dir="rtl"] .wc-addons-sidebar__submenu--level-1 {
	padding-left: 0;
	padding-right: 20px;
}

[dir="rtl"] .wc-addons-sidebar__submenu--level-2 {
	padding-left: 0;
	padding-right: 40px;
}

[dir="rtl"] .wc-addons-sidebar__submenu--level-3 {
	padding-left: 0;
	padding-right: 60px;
}

/* Touch-friendly mode RTL */
[dir="rtl"] .wc-addons-sidebar--touch-friendly .wc-addons-sidebar__submenu {
	padding-left: 0;
	padding-right: 30px;
}

/* Tooltip arrows - flip direction */
[dir="rtl"] .wc-addons-sidebar__tooltip::before {
	left: auto;
	right: -4px;
	border-left: 4px solid #333333;
	border-right: none;
}

[dir="rtl"] .wc-addons-sidebar__tooltip--right::before {
	right: -4px;
	left: auto;
	border-left: 4px solid #333333;
	border-right: none;
}

[dir="rtl"] .wc-addons-sidebar__tooltip--left::before {
	right: auto;
	left: -4px;
	border-right: 4px solid #333333;
	border-left: none;
}

/* Off-canvas mode - reverse slide direction */
[dir="rtl"] .wc-addons-sidebar--mobile-offcanvas {
	left: auto;
	right: 0;
	transform: translateX(100%);
}

[dir="rtl"] .wc-addons-sidebar--mobile-offcanvas.wc-addons-sidebar--offcanvas-open {
	transform: translateX(0);
}

[dir="rtl"] .wc-addons-sidebar--mobile-offcanvas[data-position-side="right"] {
	right: auto;
	left: 0;
	transform: translateX(-100%);
}

[dir="rtl"] .wc-addons-sidebar--mobile-offcanvas[data-position-side="right"].wc-addons-sidebar--offcanvas-open {
	transform: translateX(0);
}

/* Off-canvas trigger positions - mirror for RTL */
[dir="rtl"] .wc-addons-sidebar-trigger--top-left {
	left: auto;
	right: 20px;
}

[dir="rtl"] .wc-addons-sidebar-trigger--top-right {
	right: auto;
	left: 20px;
}

[dir="rtl"] .wc-addons-sidebar-trigger--bottom-left {
	left: auto;
	right: 20px;
}

[dir="rtl"] .wc-addons-sidebar-trigger--bottom-right {
	right: auto;
	left: 20px;
}

/* Close button in off-canvas RTL */
/* Session (2025-10-25 | 13:30): Position now controlled by JavaScript via Elementor controls */
[dir="rtl"] .wc-addons-sidebar--mobile-offcanvas .wc-addons-sidebar__toggle {
	/* Position handled by JavaScript - respects RTL via data-close-position setting */
}

/* ==========================================================================
   AJAX Navigation Loading State (Session 2025-10-18 | 13:04)
   ========================================================================== */

/* Content area loading state */
.woocommerce-MyAccount-content.mae-loading {
	position: relative;
	opacity: 0.5;
	pointer-events: none;
	transition: opacity 0.2s ease;
}

/* Loading indicator overlay */
.woocommerce-MyAccount-content.mae-loading::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 40px;
	height: 40px;
	border: 3px solid #f3f3f3;
	border-top: 3px solid #0073aa;
	border-radius: 50%;
	animation: mae-spin 1s linear infinite;
}

@keyframes mae-spin {
	0% { transform: translate(-50%, -50%) rotate(0deg); }
	100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ==========================================================================
   Hide WooCommerce Default Navigation (Session 2025-10-18 | 19:41)
   ========================================================================== */

/**
 * Hide WooCommerce default navigation bar when custom sidebar is in use
 *
 * Target: Container with class 'woo-my-account-content' that hosts WooCommerce shortcode
 * Effect: Hides the default WooCommerce navigation and makes content area full width
 *
 * WooCommerce structure:
 * - .woocommerce-MyAccount-navigation (default nav - we hide this)
 * - .woocommerce-MyAccount-content (content area - we expand this)
 */

/* Hide WooCommerce navigation inside our custom container */
.woo-my-account-content .woocommerce-MyAccount-navigation,
.elementor-widget-woocommerce-my-account .woocommerce-MyAccount-navigation {
	display: none !important;
}

/* Make WooCommerce content area take full width and remove padding */
.woo-my-account-content .woocommerce-MyAccount-content,
.elementor-widget-woocommerce-my-account .woocommerce-MyAccount-content {
	width: 100% !important;
	max-width: 100% !important;
	float: none !important;
	margin: 0 !important;
	padding: 0 !important;
}

/* ============================================================================
   WIDGET v2.0.0 ADDITIONS
   Added: 2025-10-19
   Features: Collapsible groups, state-based icons, divider visibility
   ============================================================================ */

/* --------------------------------------------------------------------------
   Collapsible Groups
   -------------------------------------------------------------------------- */

/* Collapsible header styling */
.wc-addons-sidebar__section-header[role="button"] {
	cursor: pointer;
	user-select: none;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.wc-addons-sidebar__section-header[role="button"]:hover {
	opacity: 0.8;
}

/* Section content transition */
.wc-addons-sidebar__section-content {
	max-height: none;
	opacity: 1;
	overflow: visible;
	transition: all var(--group-transition-duration, 300ms) ease;
}

.wc-addons-sidebar__section--collapsed .wc-addons-sidebar__section-content {
	max-height: 0;
	opacity: 0;
	overflow: hidden;
}

/* Session 2025-10-23 | 20:26: Section header title icon (before text) */
.wc-addons-sidebar__section-header-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-right: 8px; /* Spacing between icon and text */
	transition: all 0.2s ease; /* Smooth icon switching */
}

/* Section icon rotation (chevron on right side) */
.wc-addons-sidebar__section-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 16px; /* Default size - can be overridden by Elementor control */
	color: #666666; /* Default color - can be overridden by Elementor control */
	transform: rotate(0deg);
	transition: transform var(--group-transition-duration, 300ms) ease;
}

.wc-addons-sidebar__section--collapsed .wc-addons-sidebar__section-icon {
	transform: rotate(-90deg);
}

/* --------------------------------------------------------------------------
   State-Based Divider Visibility
   -------------------------------------------------------------------------- */

/* Divider visibility based on sidebar state (expanded/minimized) */
.wc-addons-sidebar--expanded .wc-addons-sidebar__section-divider[data-visible-expanded="no"] {
	display: none;
}

.wc-addons-sidebar--minimized .wc-addons-sidebar__section-divider[data-visible-minimized="no"] {
	display: none;
}

/* --------------------------------------------------------------------------
   State-Based Icon Sizing
   -------------------------------------------------------------------------- */

/* Icon sizing based on sidebar state (CSS variables set by Elementor controls) */
.wc-addons-sidebar--expanded .wc-addons-sidebar__item-icon {
	font-size: var(--icon-size-expanded, 20px);
	margin-right: var(--icon-spacing-expanded, 10px);
}

.wc-addons-sidebar--minimized .wc-addons-sidebar__item-icon {
	font-size: var(--icon-size-minimized, 24px);
	margin-right: var(--icon-spacing-minimized, 0);
}

/* --------------------------------------------------------------------------
   Submenu Indicator Rotation
   -------------------------------------------------------------------------- */

/* Submenu indicator rotation (controlled by Elementor controls) */
.wc-addons-sidebar__item--has-submenu > a .submenu-indicator {
	display: inline-flex;
	transition: transform 200ms ease;
	/* Default rotation controlled by Elementor control */
}

.wc-addons-sidebar__item--has-submenu.wc-addons-sidebar__item--expanded > a .submenu-indicator {
	/* Expanded rotation controlled by Elementor control */
}

/* ============================================================================
   Touch Device Handling (Session 2025-10-25 | 04:37)
   ============================================================================ */

/**
 * CRITICAL FIX: Mobile/Touch Device Click & Hover Optimization
 *
 * Problem: Hover states "stick" on touch devices after tapping, causing:
 *   - Visual feedback that doesn't go away (sticky hover)
 *   - Incorrect styling on menu items after clicking
 *   - Tooltips triggering on touch events
 *   - Focus states conflicting with active states
 *
 * Solution: Apply proven pattern from User Account Menu (Session 40 & 43):
 *   - Use @media (hover: none) to detect touch-only devices
 *   - Disable all :hover states on touch devices
 *   - Fix :focus/:active conflict for proper click backgrounds
 *   - Disable tap highlight for iOS Safari
 *   - Enable hover only on desktop with @media (hover: hover)
 *
 * Reference: user-account-menu.css lines 376-447
 */

/* Disable :hover on touch devices to prevent sticky hover bug */
@media (hover: none) {
	/* Force disable ALL hover states on touch devices */
	/* Use highest specificity to override Elementor and other theme styles */

	/* Menu items */
	.wc-addons-sidebar__link:hover,
	.wc-addons-sidebar__item:hover,
	.wc-addons-sidebar__item:hover .wc-addons-sidebar__link,
	.wc-addons-sidebar .wc-addons-sidebar__link:hover,
	.elementor-widget .wc-addons-sidebar__link:hover {
		background-color: transparent !important;
		background: transparent !important;
		color: inherit !important;
	}

	/* Section headers */
	.wc-addons-sidebar__section-header[role="button"]:hover {
		opacity: 1 !important;
		background-color: transparent !important;
		background: transparent !important;
	}

	/* Toggle button */
	.wc-addons-sidebar__toggle:hover {
		background-color: transparent !important;
		border-color: inherit !important;
	}

	/* Off-canvas trigger */
	.wc-addons-sidebar-trigger:hover {
		background-color: inherit !important;
		transform: none !important;
	}

	/* Prevent hover from applying to active items - use widget settings instead */
	.wc-addons-sidebar__item--active:hover,
	.wc-addons-sidebar__item--active:hover .wc-addons-sidebar__link {
		background-color: inherit !important;
		background: inherit !important;
		color: inherit !important;
	}

	/* Disable focus outline on touch devices (but preserve :active background) */
	.wc-addons-sidebar__link:focus,
	.wc-addons-sidebar__link:focus-visible,
	.wc-addons-sidebar__link:focus-within,
	.wc-addons-sidebar__toggle:focus,
	.wc-addons-sidebar__section-header:focus {
		outline: none !important;
	}

	/**
	 * CRITICAL FIX: Only remove background on focus when NOT actively clicking
	 *
	 * Problem: On mobile/touch devices, :focus was overriding :active background color
	 * Solution: Use :not(:active) pseudo-class to preserve click background
	 * Result: Click background color now works on both desktop AND mobile
	 */
	.wc-addons-sidebar__link:focus:not(:active),
	.wc-addons-sidebar__link:focus-visible:not(:active),
	.wc-addons-sidebar__link:focus-within:not(:active) {
		background-color: transparent !important;
	}

	/* Disable tap highlight */
	.wc-addons-sidebar__link,
	.wc-addons-sidebar__toggle,
	.wc-addons-sidebar__section-header,
	.wc-addons-sidebar-trigger {
		-webkit-tap-highlight-color: transparent !important;
		-webkit-touch-callout: none !important;
	}
}

/* Desktop hover devices only - enable hover effects */
@media (hover: hover) {
	/* Note: Hover colors are controlled via Elementor widget settings */
	/* This media query only ensures hover works on desktop but not on touch devices */

	/* Toggle button hover is controlled by Elementor settings */
	/* Section header hover opacity is defined above (line 1074) */
	/* Off-canvas trigger hover is defined above (line 360) */
	/* Menu item hover is controlled by Elementor settings */
}

/* SAFARI iOS FIX: Disable tap highlight on touch devices */
@supports (-webkit-touch-callout: none) {
	.wc-addons-sidebar__link,
	.wc-addons-sidebar__toggle,
	.wc-addons-sidebar__section-header,
	.wc-addons-sidebar-trigger {
		-webkit-tap-highlight-color: rgba(0,0,0,0) !important;
		-webkit-touch-callout: none !important;
	}
}

/* ============================================================================
   END v2.0.0 ADDITIONS
   ============================================================================ */
