/**
 * Accordion Ultra — Frontend Styles
 *
 * All CSS is scoped under .au-accordion-wrapper to avoid leakage.
 * Styling hooks (colors, padding, typography) come from inline
 * Elementor selectors; this file only handles structure, state,
 * animation scaffolding, and a11y defaults.
 *
 * @package AccordionUltra
 */

/* ============================================================
   ROOT WRAPPER
   ============================================================ */

.au-accordion-wrapper {
	box-sizing: border-box;
	width: 100%;
	position: relative;
}

.au-accordion-wrapper *,
.au-accordion-wrapper *::before,
.au-accordion-wrapper *::after {
	box-sizing: border-box;
}

.au-accordion {
	display: flex;
	flex-direction: column;
	gap: 10px;
	list-style: none;
	margin: 0;
	padding: 0;
}

/* ============================================================
   ACCORDION ITEM
   ============================================================ */

.au-accordion-item {
	position: relative;
	transition: box-shadow 0.2s ease;
}

.au-accordion-item.au-slider-hidden {
	display: none !important;
}

/* Title wrapper — holds the title button, gets bg/border/shadow by default. */
.au-accordion-item__title-wrap {
	margin: 0;
	padding: 0;
	background: #fff;
	border: 1px solid #e5e5e5;
	border-radius: 4px;
	transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

/* Content panel — gets matching defaults. */
.au-accordion-item__content {
	overflow: hidden;
	opacity: 1;
	background: #fff;
	border: 1px solid #e5e5e5;
	border-radius: 4px;
	transition: border-color 0.2s ease, background-color 0.2s ease;
}

.au-accordion-item__content[hidden] {
	display: none;
}

/* ============================================================
   TITLE / HEADER BUTTON
   ============================================================ */

.au-accordion-item__title {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	padding: 15px 20px;
	background: transparent;
	border: 0;
	cursor: pointer;
	text-align: inherit;
	font: inherit;
	color: inherit;
	transition: background-color 0.2s ease, color 0.2s ease;
	line-height: 1.4;
}

.au-accordion-item__title:focus {
	outline: 0;
}

.au-focus-visible .au-accordion-item__title:focus-visible {
	outline: 2px solid #6C5CE7;
	outline-offset: 2px;
	z-index: 1;
}

.au-no-focus-ring .au-accordion-item__title:focus-visible {
	outline: 0;
}

.au-accordion-item__title-inner {
	display: flex;
	flex-direction: column;
	flex: 1;
	min-width: 0;
	align-items: flex-start;
}

.au-accordion-item__title-text {
	display: block;
	color: #222;
	font-weight: 600;
}

.au-accordion-item__subtitle {
	display: block;
	font-size: 0.85em;
	color: #888;
	margin-top: 2px;
	font-weight: 400;
}

.au-accordion-item__badge {
	display: inline-flex;
	align-items: center;
	padding: 2px 8px;
	font-size: 0.75em;
	line-height: 1.4;
	font-weight: 600;
	background: #6C5CE7;
	color: #fff;
	border-radius: 3px;
	flex-shrink: 0;
	text-transform: uppercase;
	letter-spacing: 0.02em;
}

/* ============================================================
   TITLE ICON (decorative, per-item)
   ============================================================ */

.au-accordion-item__title-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 35px;
	margin-right: 8px;
	flex-shrink: 0;
	transition: color 0.2s ease, background-color 0.2s ease;
}

.au-accordion-item__title-icon:empty {
	display: none;
}

.au-accordion-item__title-icon svg {
	width: 16px;
	height: 16px;
}

/* ============================================================
   TOGGLE ICON
   ============================================================ */

.au-accordion-item__toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	margin-left: auto;
	transition: transform 0.25s ease, color 0.2s ease;
}

.au-accordion-item__toggle--expand,
.au-accordion-item__toggle--collapse {
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.au-accordion-item:not(.is-open) .au-accordion-item__toggle--collapse { display: none; }
.au-accordion-item.is-open .au-accordion-item__toggle--expand       { display: none; }

.au-accordion-item__toggle svg {
	width: 16px;
	height: 16px;
}

/* ============================================================
   CONTENT PANEL
   ============================================================ */

.au-accordion-item__content-inner {
	padding: 20px;
}

.au-accordion-item__content-inner > *:first-child { margin-top: 0; }
.au-accordion-item__content-inner > *:last-child  { margin-bottom: 0; }

/* ============================================================
   COPY LINK BUTTON
   ============================================================ */

.au-accordion-item__copy-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-top: 15px;
	padding: 6px 12px;
	font-size: 0.8em;
	background: transparent;
	color: #6C5CE7;
	border: 1px solid currentColor;
	border-radius: 4px;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.au-accordion-item__copy-link:hover {
	background: #6C5CE7;
	color: #fff;
}

.au-accordion-item__copy-link i {
	font-size: 0.9em;
}

/* ============================================================
   HORIZONTAL LAYOUT
   ============================================================ */

.au-is-horizontal .au-accordion {
	flex-direction: row;
	flex-wrap: nowrap;
	align-items: stretch;
}

.au-is-horizontal .au-accordion-item {
	flex: 1 1 0;
	min-width: 0;
	display: flex;
	flex-direction: column;
}

.au-is-horizontal .au-accordion-item__title {
	justify-content: space-between;
}

.au-is-horizontal .au-accordion-item__content {
	flex: 1;
}

/* Stack horizontal accordions below the chosen breakpoint. */
@media (max-width: 1024px) {
	.au-is-horizontal.au-hstack-tablet .au-accordion {
		flex-direction: column;
	}
}

@media (max-width: 767px) {
	.au-is-horizontal.au-hstack-mobile .au-accordion,
	.au-is-horizontal.au-hstack-tablet .au-accordion {
		flex-direction: column;
	}
}

/* ============================================================
   SEARCH BAR
   ============================================================ */

.au-search {
	position: relative;
	margin-bottom: 15px;
}

.au-search__input {
	width: 100%;
	padding: 10px 15px 10px 40px;
	border: 1px solid #ddd;
	border-radius: 6px;
	background: #fff;
	font: inherit;
	color: #333;
	transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.au-search__input:focus {
	outline: 0;
	border-color: #6C5CE7;
	box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.15);
}

.au-search__input::placeholder {
	color: #aaa;
}

.au-search__icon {
	position: absolute;
	left: 12px;
	top: 50%;
	transform: translateY(-50%);
	color: #888;
	pointer-events: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: color 0.2s ease;
}

.au-search__icon svg {
	width: 14px;
	height: 14px;
}

.au-search-highlight {
	background-color: #fff3a0;
	color: inherit;
	padding: 0 1px;
	border-radius: 2px;
}

/* ============================================================
   EXPAND/COLLAPSE ALL BUTTON
   ============================================================ */

.au-ec-wrap {
	display: flex;
	justify-content: flex-end;
	margin-bottom: 12px;
	margin-top: 12px;
}

.au-ec-btn {
	display: inline-flex;
	align-items: center;
	padding: 8px 16px;
	background: #6C5CE7;
	color: #fff;
	border: 0;
	border-radius: 4px;
	cursor: pointer;
	font: inherit;
	font-weight: 500;
	transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.au-ec-btn:hover {
	background: #5849c4;
}

/* ============================================================
   SLIDER / PAGINATION
   ============================================================ */

.au-slider-controls {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	margin-top: 15px;
	flex-wrap: wrap;
}

.au-slider-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 10px 14px;
	background: #6C5CE7;
	color: #fff;
	border: 0;
	border-radius: 4px;
	cursor: pointer;
	font: inherit;
	transition: background-color 0.2s ease, opacity 0.2s ease;
}

.au-slider-btn:hover {
	opacity: 0.88;
}

.au-slider-btn svg {
	width: 16px;
	height: 16px;
}

.au-slider-dots {
	display: flex;
	align-items: center;
	gap: 8px;
}

.au-slider-dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: #ccc;
	border: 0;
	cursor: pointer;
	padding: 0;
	transition: background-color 0.2s ease, transform 0.2s ease;
}

.au-slider-dot:hover {
	transform: scale(1.15);
}

.au-slider-dot.is-active {
	background: #6C5CE7;
	transform: scale(1.2);
}

/* ============================================================
   AUTOPLAY
   ============================================================ */

.au-autoplay-controls {
	display: flex;
	justify-content: flex-end;
	margin-bottom: 10px;
}

.au-autoplay-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: #f5f5f5;
	color: #333;
	border: 0;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.au-autoplay-toggle:hover {
	background: #e8e8e8;
}

.au-autoplay-progress {
	position: relative;
	height: 3px;
	background: rgba(0, 0, 0, 0.06);
	overflow: hidden;
	opacity: 0;
	transition: opacity 0.2s ease;
}

.au-accordion-item.is-open .au-autoplay-progress {
	opacity: 1;
}

.au-autoplay-progress__bar {
	position: absolute;
	top: 0;
	left: 0;
	height: 100%;
	width: 0%;
	background: #6C5CE7;
}

/* ============================================================
   STAGGER ENTRANCE ANIMATION
   ============================================================ */

.au-stagger-pending {
	opacity: 0;
	transform: translateY(20px);
}

.au-stagger-visible {
	opacity: 1;
	transform: translateY(0);
	transition: opacity 0.5s ease, transform 0.5s ease;
}

/* ============================================================
   NONE CONTENT SOURCE — title-only items (no panel, no toggle)
   ============================================================ */

/* Static (non-interactive) title — remove button-like cursor. */
.au-accordion-item__title--static {
	cursor: default;
}

/* Linked title — inherit link behavior, keep styled as a title. */
.au-accordion-item__title--link {
	text-decoration: none;
	color: inherit;
	cursor: pointer;
}

.au-accordion-item__title--link:hover {
	text-decoration: none;
}

/* Both use <a>/<div> instead of <button> — reset default styling. */
.au-accordion-item__title--link,
.au-accordion-item__title--static {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	padding: 15px 20px;
	background: transparent;
	border: 0;
	text-align: inherit;
	font: inherit;
	line-height: 1.4;
	transition: background-color 0.2s ease, color 0.2s ease;
}

/* No-content items can't be "open" — ensure they don't get styled as active. */
.au-accordion-item--no-content {
	/* visual parity with regular items; nothing special to hide */
}

/* When an item is in image title mode, the title button fills the wrap
   and the image stack sits behind it. */
.au-title-image-mode .au-accordion-item__title {
	padding: 0;
	display: block;
	position: relative;
	width: 100%;
}

.au-title-image {
	display: block;
	position: relative;
	width: 100%;
	overflow: hidden;
}

/* Auto mode — each image contributes its natural height. */
.au-title-image--auto .au-title-image__img--normal {
	display: block;
	width: 100%;
	height: auto;
}

/* Lock mode — Normal's natural height defines the row; Hover/Active scale to it. */
.au-title-image--lock .au-title-image__img--normal {
	display: block;
	width: 100%;
	height: auto;
}
.au-title-image--lock .au-title-image__img--hover,
.au-title-image--lock .au-title-image__img--active {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Fixed mode — all three images fill the specified height. */
.au-title-image--fixed .au-title-image__img--normal {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.au-title-image--fixed .au-title-image__img--hover,
.au-title-image--fixed .au-title-image__img--active {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Auto-mode hover/active overlays use absolute positioning so they stack
   on top of the normal image for crossfade. */
.au-title-image--auto .au-title-image__img--hover,
.au-title-image--auto .au-title-image__img--active {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Safety: prevent oversized images from breaking layouts (max-height set via inline selector). */
.au-title-image__img--normal {
	max-height: inherit;
}

/* State transitions — crossfade between images */
.au-title-image__img {
	transition: opacity 0.3s ease;
}

.au-title-image__img--hover,
.au-title-image__img--active {
	opacity: 0;
	pointer-events: none;
}

/* Show hover image when hovering a closed item. */
.au-accordion-item:not(.is-open) .au-accordion-item__title:hover .au-title-image__img--hover {
	opacity: 1;
}

/* Show active image when item is open. */
.au-accordion-item.is-open .au-title-image__img--active {
	opacity: 1;
}

/* Hide badge, subtitle, title-icon in image mode (they're conditioned away in panel,
   but this guards against any bleed-through styling). */
.au-title-image-mode .au-accordion-item__title-icon,
.au-title-image-mode .au-accordion-item__subtitle,
.au-title-image-mode .au-accordion-item__badge,
.au-title-image-mode .au-accordion-item__title-inner {
	display: none !important;
}

/* ============================================================
   TOGGLE ICON OVERLAY (image-mode only)
   ============================================================ */

.au-toggle-overlay {
	position: absolute;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	z-index: 2;
	--au-overlay-inset: 12px;
	background-color: rgba(0, 0, 0, 0.5);
	color: #fff;
	padding: 8px 10px;
	border-radius: 50%;
	transition: background-color 0.2s ease, transform 0.2s ease;
	pointer-events: none;
}

.au-toggle-overlay .au-accordion-item__toggle {
	margin: 0;
}

/* Preset positions — use inset from --au-overlay-inset variable. */
.au-toggle-overlay--top-left      { top: var(--au-overlay-inset); left: var(--au-overlay-inset); }
.au-toggle-overlay--top-center    { top: var(--au-overlay-inset); left: 50%; transform: translateX(-50%); }
.au-toggle-overlay--top-right     { top: var(--au-overlay-inset); right: var(--au-overlay-inset); }
.au-toggle-overlay--middle-left   { top: 50%; left: var(--au-overlay-inset); transform: translateY(-50%); }
.au-toggle-overlay--center        { top: 50%; left: 50%; transform: translate(-50%, -50%); }
.au-toggle-overlay--middle-right  { top: 50%; right: var(--au-overlay-inset); transform: translateY(-50%); }
.au-toggle-overlay--bottom-left   { bottom: var(--au-overlay-inset); left: var(--au-overlay-inset); }
.au-toggle-overlay--bottom-center { bottom: var(--au-overlay-inset); left: 50%; transform: translateX(-50%); }
.au-toggle-overlay--bottom-right  { bottom: var(--au-overlay-inset); right: var(--au-overlay-inset); }

/* Custom position — left/top set via inline selectors from X/Y controls. */
.au-toggle-overlay--custom {
	/* left/top come from inline styles */
}

/* ============================================================
   CONTENT IMAGE
   ============================================================ */

.au-content-image {
	display: block;
	max-width: 100%;
	height: auto;
	object-fit: cover;
	border-radius: inherit;
}

.au-content-image-link {
	display: block;
	line-height: 0;
}

.au-content-image-lightbox {
	cursor: zoom-in;
}

/* ============================================================
   LIGHTBOX (simple built-in for content image lightbox mode)
   ============================================================ */

.au-lightbox-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.9);
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	cursor: zoom-out;
	opacity: 0;
	animation: au-lightbox-fade 0.2s ease forwards;
}

@keyframes au-lightbox-fade {
	to { opacity: 1; }
}

.au-lightbox-backdrop img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.au-lightbox-close {
	position: absolute;
	top: 20px;
	right: 20px;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.1);
	color: #fff;
	border: 0;
	cursor: pointer;
	font-size: 20px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: background-color 0.2s ease;
}

.au-lightbox-close:hover {
	background: rgba(255, 255, 255, 0.25);
}

/* ============================================================
   PRESETS (light defaults; users fully override via Style tab)
   ============================================================ */

/* FAQ: minimalist, no borders between, subtle separators. */
.au-preset-faq .au-accordion {
	gap: 0;
}

.au-preset-faq .au-accordion-item__title-wrap,
.au-preset-faq .au-accordion-item__content {
	border: 0;
	border-radius: 0;
}

.au-preset-faq .au-accordion-item {
	border-bottom: 1px solid #eee;
}

.au-preset-faq .au-accordion-item:last-child {
	border-bottom: 0;
}

/* Product Tabs: subtle border on both halves. */
.au-preset-product .au-accordion-item__title-wrap,
.au-preset-product .au-accordion-item__content {
	border-color: #dddddd;
}

/* Timeline: left border accent across both halves. */
.au-preset-timeline .au-accordion-item__title-wrap,
.au-preset-timeline .au-accordion-item__content {
	border-left: 4px solid #6C5CE7;
	border-radius: 0;
}

/* Sidebar: compact. */
.au-preset-sidebar .au-accordion-item__title {
	padding: 10px 14px;
}

.au-preset-sidebar .au-accordion-item__content-inner {
	padding: 10px 14px;
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
	.au-accordion-item,
	.au-accordion-item__title,
	.au-accordion-item__toggle,
	.au-accordion-item__content,
	.au-stagger-visible,
	.au-stagger-pending,
	.au-autoplay-progress__bar {
		transition: none !important;
		animation: none !important;
	}
}

/* ============================================================
   PRINT — all items expanded, no interactive chrome.
   ============================================================ */

@media print {
	.au-accordion-item__content,
	.au-accordion-item__content[hidden] {
		display: block !important;
	}
	.au-search,
	.au-autoplay-controls,
	.au-slider-controls,
	.au-ec-wrap,
	.au-accordion-item__toggle,
	.au-accordion-item__copy-link {
		display: none !important;
	}
}
