/* =====================================================
   AAI Frontend – filter bar + product detail styles
   ===================================================== */

/* --- Filter bar ------------------------------------ */
.aai-filter-bar {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-bottom: 24px;
	padding: 16px 20px;
	background: #f8f9fa;
	border-radius: 8px;
	border: 1px solid #e9ecef;
}

.aai-filter-group {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
}

.aai-filter-label {
	font-weight: 600;
	font-size: 13px;
	color: #495057;
	min-width: 60px;
	margin-right: 4px;
}

.aai-filter-pill {
	display: inline-block;
	padding: 5px 14px;
	border-radius: 20px;
	text-decoration: none;
	font-size: 13px;
	color: #495057;
	background: #fff;
	border: 1px solid #dee2e6;
	transition: all .15s ease;
	line-height: 1.4;
}

.aai-filter-pill:hover {
	background: #e9ecef;
	color: #212529;
	text-decoration: none;
}

.aai-filter-pill.active {
	background: #2271b1;
	color: #fff;
	border-color: #2271b1;
}

.aai-filter-pill.active:hover {
	background: #1a5c8e;
}

/* --- Product meta on single page ------------------- */
.aai-product-meta-albatros {
	margin: 12px 0 16px;
	font-size: 14px;
	line-height: 1.8;
	color: #333;
}

.aai-product-subtitle {
	font-size: 16px;
	color: #666;
	margin: -4px 0 10px;
	font-style: italic;
}

.aai-product-summary {
	font-size: 14px;
	color: #555;
	margin: 0 0 12px;
}

/* --- Detail tab ------------------------------------ */
.aai-product-detail-tab {
	font-size: 14px;
	line-height: 1.7;
}

.aai-specs {
	list-style: disc inside;
	margin: 6px 0 16px 8px;
	padding: 0;
}

.aai-specs li {
	padding: 2px 0;
}

.aai-asset-samples {
	list-style: none;
	margin: 6px 0 16px 0;
	padding: 0;
}

.aai-asset-samples li {
	padding: 3px 0;
}

.aai-asset-samples a {
	text-decoration: underline;
}

/* --- Smart sidebar: genre groups ------------------- */
.aai-smart-sidebar-widget {
	margin-bottom: 24px;
}
.aai-smart-sidebar-widget .widget-title {
	font-size: 16px;
	font-weight: 700;
	margin-bottom: 12px;
	padding-bottom: 8px;
	border-bottom: 2px solid #2271b1;
}

.aai-genre-group {
	margin-bottom: 4px;
	border: 1px solid #eee;
	border-radius: 6px;
	overflow: hidden;
}
.aai-genre-group-title {
	padding: 8px 12px;
	font-weight: 600;
	font-size: 13px;
	cursor: pointer;
	background: #f8f9fa;
	display: flex;
	justify-content: space-between;
	align-items: center;
	user-select: none;
}
.aai-genre-group-title:hover {
	background: #e9ecef;
}
.aai-toggle {
	font-size: 14px;
	color: #888;
	transition: transform .2s;
}
.aai-genre-group.open .aai-toggle {
	transform: rotate(45deg);
}
.aai-genre-list {
	display: none;
	list-style: none;
	margin: 0;
	padding: 4px 0;
}
.aai-genre-group.open .aai-genre-list {
	display: block;
}
.aai-genre-list li a,
.aai-author-top-list li a {
	display: flex;
	justify-content: space-between;
	padding: 4px 12px;
	font-size: 13px;
	color: #333;
	text-decoration: none;
	transition: background .1s;
}
.aai-genre-list li a:hover,
.aai-author-top-list li a:hover {
	background: #f0f7ff;
	text-decoration: none;
}
.aai-genre-list li.active a,
.aai-author-top-list li.active a {
	background: #2271b1;
	color: #fff;
	border-radius: 3px;
}
.aai-genre-list li a span,
.aai-author-top-list li a span {
	color: #999;
	font-size: 12px;
}
.aai-genre-list li.active a span,
.aai-author-top-list li.active a span {
	color: rgba(255,255,255,0.7);
}

.aai-author-top-list {
	list-style: none;
	margin: 0 0 8px;
	padding: 0;
}

/* --- Autocomplete ---------------------------------- */
.aai-autocomplete-wrap {
	position: relative;
	margin-top: 10px;
}
.aai-autocomplete-wrap input {
	width: 100%;
	padding: 7px 10px;
	font-size: 13px;
	border: 1px solid #ddd;
	border-radius: 6px;
	box-sizing: border-box;
}
.aai-autocomplete-wrap input:focus {
	border-color: #2271b1;
	outline: none;
	box-shadow: 0 0 0 2px rgba(34,113,177,0.15);
}
.aai-suggestions {
	display: none;
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	background: #fff;
	border: 1px solid #ddd;
	border-top: none;
	border-radius: 0 0 6px 6px;
	max-height: 240px;
	overflow-y: auto;
	z-index: 100;
	list-style: none;
	margin: 0;
	padding: 0;
	box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.aai-suggestions li a {
	display: block;
	padding: 6px 10px;
	font-size: 13px;
	color: #333;
	text-decoration: none;
}
.aai-suggestions li a:hover {
	background: #f0f7ff;
}

/* --- Sample preview below product image ------------ */
.aai-samples-below-image {
	margin-top: 16px;
	padding: 14px 16px;
	background: #f0f7ff;
	border: 1px solid #d0e3f5;
	border-radius: 8px;
}

.aai-samples-title {
	display: block;
	font-size: 14px;
	font-weight: 600;
	color: #1a5c8e;
	margin-bottom: 8px;
}

.aai-samples-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.aai-samples-list li {
	padding: 4px 0;
}

.aai-samples-list a {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: #2271b1;
	text-decoration: none;
	font-size: 13px;
	padding: 4px 10px;
	border-radius: 4px;
	transition: background .15s ease;
}

.aai-samples-list a:hover {
	background: #dceaf7;
	text-decoration: none;
}

/* --- Authors Directory ------------------------------ */
.aai-authors-directory {
	max-width: 1200px;
	margin: 0 auto;
}
.aai-authors-search-wrap {
	margin-bottom: 20px;
}
#aai-authors-dir-search,
.aai-authors-dir-search {
	width: 100%;
	max-width: 400px;
	padding: 10px 14px;
	border: 1px solid #ddd;
	border-radius: 6px;
	font-size: 15px;
	outline: none;
}
#aai-authors-dir-search:focus,
.aai-authors-dir-search:focus {
	border-color: #4a90d9;
	box-shadow: 0 0 0 2px rgba(74,144,217,.15);
}
.aai-authors-alphabet {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin-bottom: 24px;
	padding-bottom: 12px;
	border-bottom: 1px solid #eee;
}
.aai-letter-link {
	display: inline-block;
	min-width: 28px;
	text-align: center;
	padding: 4px 6px;
	font-weight: 600;
	font-size: 14px;
	color: #4a90d9;
	background: #f0f4f8;
	border-radius: 4px;
	text-decoration: none;
}
.aai-letter-link:hover {
	background: #4a90d9;
	color: #fff;
}
.aai-letter-heading {
	font-size: 22px;
	font-weight: 700;
	margin: 24px 0 10px;
	padding-bottom: 6px;
	border-bottom: 2px solid #4a90d9;
	color: #333;
}
.aai-authors-grid {
	display: grid;
	gap: 6px 16px;
}
.aai-author-item a {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 5px 8px;
	border-radius: 4px;
	color: #333;
	text-decoration: none;
	font-size: 14px;
	line-height: 1.4;
	transition: background .12s;
}
.aai-author-item a:hover {
	background: #f0f4f8;
	color: #4a90d9;
}
.aai-author-thumb {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	object-fit: cover;
	flex-shrink: 0;
}
.aai-author-name {
	flex: 1;
}
.aai-author-count {
	color: #999;
	font-size: 12px;
	flex-shrink: 0;
}

/* --- Audio sample player ----------------------------- */
.aai-audio-sample .aai-audio-label {
	display: block;
	font-weight: 600;
	font-size: 13px;
	color: #555;
}

/* --- Responsive ------------------------------------ */
@media (max-width: 768px) {
	.aai-filter-bar {
		padding: 12px;
	}
	.aai-filter-group {
		gap: 4px;
	}
	.aai-filter-pill {
		padding: 4px 10px;
		font-size: 12px;
	}
	.aai-filter-label {
		min-width: auto;
		width: 100%;
		margin-bottom: 2px;
	}
}

/* --- Account downloads: personal library cards --- */
.aai-download-library {
	display: grid;
	gap: 16px;
}

.aai-download-card {
	display: grid;
	grid-template-columns: 104px minmax(0, 1fr);
	gap: 20px;
	align-items: stretch;
	padding: 18px;
	border: 1px solid #ececec;
	border-radius: 14px;
	background: #fff;
	box-shadow: 0 4px 18px rgba(25, 25, 25, 0.05);
	transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.aai-download-card:hover {
	border-color: rgba(246, 93, 78, 0.28);
	box-shadow: 0 8px 24px rgba(25, 25, 25, 0.08);
	transform: translateY(-1px);
}

.aai-download-card__cover {
	width: 104px;
	aspect-ratio: 2 / 3;
	align-self: start;
	overflow: hidden;
	border-radius: 8px;
	background: #f4f4f4;
	box-shadow: 0 3px 10px rgba(25, 25, 25, 0.12);
}

.aai-download-card--audiobook .aai-download-card__cover {
	aspect-ratio: 1 / 1;
}

.aai-download-card__cover a {
	display: block;
	width: 100%;
	height: 100%;
}

.aai-download-card__cover-image {
	display: block;
	width: 100% !important;
	height: 100% !important;
	margin: 0 !important;
	object-fit: cover;
}

.aai-download-card__content {
	display: flex;
	flex-direction: column;
	min-width: 0;
	min-height: 100%;
}

.aai-download-card__details {
	min-width: 0;
}

.aai-download-card__title {
	margin: 0 0 7px;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.35;
}

.aai-download-card__title a {
	color: #1f1f1f;
	text-decoration: none;
}

.aai-download-card__title a:hover,
.aai-download-card__title a:focus {
	color: var(--primary, #F65D4E);
}

.aai-download-card__author {
	margin: 0;
	color: #757575;
	font-size: 14px;
	line-height: 1.5;
}

.aai-download-card__actions {
	display: flex;
	flex-direction: column;
	gap: 8px;
	align-items: flex-start;
	min-width: 0;
	margin-top: auto;
	padding-top: 18px;
}

.aai-download-card__formats-label {
	color: #777;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.08em;
	line-height: 1;
	text-transform: uppercase;
}

.woocommerce-MyAccount-downloads td.download-file,
.woocommerce table.shop_table td.download-file {
	white-space: nowrap;
}

.woocommerce-MyAccount-downloads td.download-file > a.woocommerce-MyAccount-downloads-file,
.woocommerce-table--order-downloads td.download-file > a.woocommerce-MyAccount-downloads-file {
	display: none !important;
}

.aai-dl-btns {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: flex-start;
	align-items: center;
}

.aai-dl-btn {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: auto !important;
	min-width: 5.75rem;
	padding: 10px 16px !important;
	border: 0;
	border-radius: 999px !important;
	background: var(--primary, #F65D4E) !important;
	color: #fff !important;
	font-weight: 700;
	font-size: 13px;
	letter-spacing: 0.06em;
	text-decoration: none !important;
	line-height: 1;
	transition: background-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.aai-dl-btn:hover,
.aai-dl-btn:focus {
	background: var(--primary_hover, #f4402f) !important;
	color: #fff !important;
	transform: translateY(-1px);
	box-shadow: 0 4px 10px rgba(246, 93, 78, 0.24);
}

.aai-dl-btn__icon {
	display: inline-flex;
	width: 1rem;
	height: 1rem;
	flex: 0 0 auto;
	transition: transform 0.18s ease;
}

.aai-dl-btn__icon svg {
	display: block;
	width: 100%;
	height: 100%;
}

.aai-dl-btn:hover .aai-dl-btn__icon,
.aai-dl-btn:focus .aai-dl-btn__icon {
	transform: translateY(1px);
}

@media (max-width: 768px) {
	.aai-download-card {
		grid-template-columns: 76px minmax(0, 1fr);
		gap: 16px;
		padding: 16px;
	}

	.aai-download-card__cover {
		width: 76px;
	}

	.aai-download-card__actions {
		align-items: flex-start;
		min-width: 0;
		padding-top: 14px;
	}

	.aai-download-card__actions .aai-dl-btns {
		justify-content: flex-start;
	}
}

@media (max-width: 480px) {
	.aai-download-card {
		grid-template-columns: 64px minmax(0, 1fr);
		gap: 14px;
		padding: 14px;
	}

	.aai-download-card__cover {
		width: 64px;
	}

	.aai-download-card__title {
		font-size: 16px;
	}

	.aai-dl-btn {
		min-width: 5.25rem;
		padding: 9px 13px !important;
	}
}

@media (prefers-reduced-motion: reduce) {
	.aai-download-card,
	.aai-dl-btn,
	.aai-dl-btn__icon {
		transition: none;
	}
}

.aai-google-login {
	margin: 0 0 16px;
}
.aai-google-btn {
	display: flex;
	justify-content: center;
	min-height: 40px;
}
.aai-google-or {
	margin: 14px 0 4px;
	text-align: center;
	font-size: 13px;
	color: #6c757d;
}

/* Authors Directory: lazy loading, original visual style preserved */
.aai-authors-directory-status:empty { display: none; }
.aai-authors-directory-status { margin: 0 0 10px; font-size: 13px; color: #777; }
.aai-authors-loading, .aai-authors-error, .aai-authors-empty { padding: 16px 8px; margin: 0; }
