/* courses_shop.css
 * Styling for the new courses-shop overview (catalog/index2.php) and
 * the course detail page (viewpro.php for course products). Inspired
 * by the campus dashboard look (campus_root/index.php) -- 16:9 hero
 * media, left-aligned text blocks, a pinned bottom action footer.
 *
 * Drop-in additive: no shop.css selector is overridden here.
 */

/* =====================================================================
 * Page frame / spacing
 * ===================================================================== */

/* Bonvista already gives every <section> following .navbar a top
   padding of 5em (desktop) or 4.5em (<=990px) via
   `body:not(.home) .navbar+section`. We need more room because the
   courses-shop renders the promo-banner ({ALERT}), breadcrumb and
   tab strip INSIDE the section above the listing -- the sticky
   header must not eat them. Use !important to win against every
   bonvista breakpoint without having to match each selector. */
.courses-view-section {
	padding-top: 9em !important;
	padding-bottom: 3rem;
	min-height: 60vh;
}
@media (max-width: 991.98px) {
	.courses-view-section {
		padding-top: 9em !important;
	}
}
@media (max-width: 575.98px) {
	.courses-view-section {
		padding-top: 9em !important;
	}
}

.courses-view-container .course-view {
	background: transparent;
}

/* =====================================================================
 * Tabs
 * ===================================================================== */

/* Bold, centered tab bar. Active tab fills with the brand teal so
   the user immediately knows where they are; inactive tabs are
   white with a soft grey outline. The underline-row of the
   .nav-tabs is also tinted teal to tie the bar together. */
.courses-shop-tabs {
	justify-content: center;
	gap: 0.4rem;
	border-bottom: 2px solid #35c6ac;
	margin-bottom: 1.25rem;
}
.courses-shop-tabs .nav-item {
	margin-bottom: -2px;
}
.courses-shop-tabs .nav-link {
	cursor: pointer;
	font-weight: 600;
	color: #444;
	background: #fff;
	border: 1px solid #ccc;
	border-bottom-color: #35c6ac;
	border-radius: 0.5rem 0.5rem 0 0;
	padding: 0.65rem 1.4rem;
	transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.courses-shop-tabs .nav-link:hover {
	border-color: #35c6ac;
	color: #1f8a78;
}
.courses-shop-tabs .nav-link.active {
	background: #35c6ac;
	border-color: #35c6ac;
	color: #fff;
}
.courses-shop-tabs .nav-link.active:hover {
	color: #fff;
}
/* Mobile (<md = <768px): keep the two tabs side-by-side instead of
   wrapping onto separate rows. Each tab gets an equal share of the
   available width, the label is allowed to break onto a second line
   via <br class="d-md-none"> inside the tab text. */
@media (max-width: 767.98px) {
	.courses-shop-tabs {
		flex-wrap: nowrap;
		gap: 0.3rem;
	}
	.courses-shop-tabs .nav-item {
		flex: 1 1 0;
		min-width: 0;
	}
	.courses-shop-tabs .nav-link {
		width: 100%;
		padding: 0.5rem 0.5rem;
		font-size: 0.95rem;
		text-align: center;
		line-height: 1.2;
		white-space: normal;
	}
}
.courses-shop-panel[hidden] {
	display: none !important;
}
.courses-shop-preview-note {
	font-size: 0.9rem;
}

/* Inline pill filter bar inside the magazine tab.
   Layout: "Filter | nach Marke: [pill] [pill] | nach Art: [pill] [pill] [pill]"
   Pills reuse the .filter-tag styling shared with /tools.html so
   theme/dark-mode coloring already works. */
.courses-shop .magazines-filter-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 0.35em 0.55em;
	margin-bottom: 1.25rem;
	font-size: 0.875rem;
	line-height: 1.4;
	color: #444;
}
.courses-shop .filter-bar-label {
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #222;
}
.courses-shop .filter-bar-divider {
	color: #bbb;
	user-select: none;
	margin: 0 0.1em;
}
.courses-shop .filter-group {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.35em;
}
.courses-shop .filter-group-label {
	color: #666;
}
.courses-shop .filter-tag {
	display: inline-flex;
	align-items: center;
	cursor: pointer;
	padding: 0.4em 0.85em;
	border-radius: 999px;
	border: 1px solid transparent;
	font-weight: 400 !important;
	font-size: 0.85rem;
	line-height: 1.2;
	transition: background-color 0.15s, color 0.15s, border-color 0.15s;
	user-select: none;
	margin-bottom: 0;
}
.courses-shop .filter-tag:hover {
	border-color: #999;
	color: #222;
}
/* Bootstrap's `.bg-light` carries `!important`, so the theme's teal
   `.filter-tag.filter-active` background gets clobbered. Re-apply the
   brand colour with !important so the active pill is clearly visible. */
.courses-shop .filter-tag.filter-active,
.courses-shop .filter-tag.active {
	background-color: #35c6ac !important;
	color: #fff !important;
	border-color: #35c6ac;
}
.courses-shop .filter-bar-reset {
	margin-left: 0.5rem;
	font-size: 0.8rem;
	color: #888;
	text-decoration: none;
	white-space: nowrap;
}
.courses-shop .filter-bar-reset:hover {
	color: #c00;
	text-decoration: underline;
}
.courses-shop .filter-bar-reset.is-hidden {
	visibility: hidden;
}

@media (max-width: 575.98px) {
	.courses-shop .magazines-filter-bar {
		font-size: 0.8rem;
		gap: 0.3em 0.4em;
	}
	.courses-shop .filter-bar-divider {
		display: none;
	}
	.courses-shop .filter-group {
		width: 100%;
		padding-left: 0.25rem;
	}
	.courses-shop .filter-bar-reset {
		margin-left: 0;
		margin-top: 0.25rem;
		width: 100%;
		text-align: center;
	}
}

/* Dark-mode overrides for the inline pill filter bar. */
body.dark-theme .courses-shop .magazines-filter-bar {
	color: #ccc;
}
body.dark-theme .courses-shop .filter-bar-label {
	color: #fff;
}
body.dark-theme .courses-shop .filter-group-label {
	color: #aaa;
}
body.dark-theme .courses-shop .filter-bar-divider {
	color: #555;
}
body.dark-theme .courses-shop .filter-tag:hover {
	border-color: #888;
	color: #fff;
}
body.dark-theme .courses-shop .filter-bar-reset {
	color: #aaa;
}
body.dark-theme .courses-shop .filter-bar-reset:hover {
	color: #f66;
}

/* The old filter-opener button is gone but a few callers in
   bonvista.js still poke #set_filters_items_count on change. Keep
   the selector neutralized so a stray element with that id would
   not break the layout. */
.courses-shop #filter-opener,
.courses-shop #set_filters_items_count {
	display: none !important;
}

/* =====================================================================
 * Course list grid (campus-dashboard style)
 * ===================================================================== */

.courses-list-wrap {
	margin-bottom: 2rem;
}
.courses-list-title {
	font-size: 1.25rem;
	font-weight: 600;
	margin: 0.5rem 0 1rem;
	text-align: left;
}

.courses-shop-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1.5rem;
	margin-bottom: 2rem;
}
@media (min-width: 768px) {
	.courses-shop-grid {
		grid-template-columns: 1fr 1fr;
	}
}
@media (min-width: 1200px) {
	.courses-shop-grid {
		grid-template-columns: 1fr 1fr 1fr;
	}
}

.course-shop-card {
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: 0.75rem;
	overflow: hidden;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
	transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.course-shop-card:hover {
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
	transform: translateY(-2px);
}

.course-shop-card-media {
	display: block;
	position: relative;
	aspect-ratio: 16 / 9;
	background: #000;
	overflow: hidden;
}
.course-shop-card-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	border: 0;
}

.course-shop-card-body {
	flex: 1 1 auto;
	padding: 1rem 1.25rem 0.5rem;
	display: flex;
	flex-direction: column;
	text-align: left;
}

.course-shop-card-header {
	margin-bottom: 0.5rem;
}
.course-shop-card-title {
	margin: 0 0 0.25rem;
	font-size: 1.15rem;
	line-height: 1.3;
}
.course-shop-card-title a {
	color: inherit;
	text-decoration: none;
}
.course-shop-card-title a:hover {
	text-decoration: underline;
}
.course-shop-card-subtitle {
	margin: 0;
	color: #6c757d;
	font-size: 0.92rem;
}
.course-shop-card-subtitle:empty {
	display: none;
}

.course-shop-card-summary {
	margin: 0.5rem 0 0.75rem;
	font-size: 0.92rem;
	color: #495057;
}
.course-shop-card-summary:empty {
	display: none;
}

.course-shop-card-bottom {
	margin-top: auto;
	padding-top: 0.5rem;
}

.course-shop-card-price {
	margin-bottom: 0;
}
.course-shop-card-price p {
	margin-bottom: 0.15rem;
}
.course-shop-card-price .current_price {
	font-weight: 700;
	font-size: 1.15rem;
	color: #C00;
}
.course-shop-card-price .normal_price {
	text-decoration: line-through;
	color: #888;
	margin-right: 0.5rem;
}

.course-shop-card-footer {
	display: flex;
	gap: 0.5rem;
	padding: 0.75rem 1.25rem 1rem;
	border-top: 1px solid rgba(0, 0, 0, 0.05);
	align-items: center;
	flex-wrap: wrap;
}
.course-shop-card-footer .btn {
	flex-shrink: 0;
}
.course-shop-card-order {
	flex: 0 1 auto;
}
.course-shop-card-order .input-group {
	width: auto;
}

/* =====================================================================
 * Author / tutor line (used both in list + detail)
 * ===================================================================== */

.course-authors {
	font-size: 0.92rem;
	margin: 0 0 0.5rem;
	color: #444;
	text-align: left;
}
.course-authors.lead {
	font-size: 1.05rem;
	margin-bottom: 1rem;
}
.course-authors-prefix {
	color: #6c757d;
}
.course-author-btn {
	color: #C00;
	font-weight: 500;
	text-decoration: none;
	vertical-align: baseline;
	border: none;
	background: none;
}
.course-author-btn:hover,
.course-author-btn:focus {
	color: #900;
	text-decoration: underline;
}

/* =====================================================================
 * Course detail page (viewpro.php with product_detail_course template)
 * ===================================================================== */

.product-detail-course {
	max-width: 1140px;
	margin-left: auto;
	margin-right: auto;
}
.product-detail-course .course-breadcrumb .breadcrumb {
	margin-bottom: 1rem;
	background: transparent;
	padding: 0;
}
.product-detail-course .course-detail-main {
	margin-bottom: 2rem;
}
.product-detail-course .course-hero {
	background: #f3f3f3;
}
.product-detail-course .course-title {
	color: #000;
}
.product-detail-course .course-summary {
	color: #495057;
}
.product-detail-course .course-order-block {
	background: #fff;
}
.product-detail-course .course-description-body {
	font-size: 1rem;
	line-height: 1.6;
	color: #333;
}
.product-detail-course .course-toc-inline .btn,
.product-detail-course .course-toc-section .btn {
	font-weight: 500;
}

/* =====================================================================
 * Course author profile modal (course_author_ajax.php content)
 * ===================================================================== */

.course-author-profile .course-author-avatar {
	object-fit: cover;
	flex: 0 0 96px;
}
.course-author-profile .course-author-name {
	margin: 0;
}
.course-author-profile .course-author-body {
	font-size: 0.95rem;
	line-height: 1.6;
	color: #333;
}
.course-author-profile .course-author-body p {
	margin-bottom: 0.75rem;
}

/* =====================================================================
 * Course Table-of-Contents modal (course_toc_ajax.php content)
 * ===================================================================== */

.course-toc-title {
	margin-top: 0;
	margin-bottom: 0.25rem;
}
.course-toc-desc {
	color: #555;
}
.course-toc-meta {
	margin-bottom: 1rem;
}
.course-toc-chapter {
	margin-bottom: 1.25rem;
}
.course-toc-chapter-title {
	border-bottom: 1px solid #e0e0e0;
	padding-bottom: 0.25rem;
	margin-bottom: 0.5rem;
}
.course-toc-lessons {
	padding-left: 0;
}
.course-toc-lesson {
	padding: 0.4rem 0;
	border-bottom: 1px dotted #eee;
	text-align: left;
}
.course-toc-lesson.is-public {
	background: rgba(40, 167, 69, 0.04);
}
.course-toc-lesson:last-child {
	border-bottom: none;
}

/* =====================================================================
 * Course modals (ToC + Tutor profile)
 *
 * Site theme paints .modal-header / .modal-footer black
 * (kibuzzer/theme.css: ".modal-header, .modal-footer { background:#000 }"),
 * but does not override foreground colours -- so the default dark text and
 * Bootstrap's default close icon become illegible.
 * Scope a high-contrast override to OUR modals only; do not touch the
 * site-wide #myBasketModal etc.
 * ===================================================================== */

.course-toc-modal .modal-header,
.course-author-modal .modal-header {
	background-color: #1a1a1a;
	color: #fff;
	border-bottom: 1px solid rgba(255, 255, 255, 0.12);
	padding: 0.9rem 1.25rem;
}
.course-toc-modal .modal-title,
.course-author-modal .modal-title {
	color: #fff;
	font-weight: 600;
	letter-spacing: 0.02em;
}
.course-toc-modal .modal-header .btn-close,
.course-author-modal .modal-header .btn-close {
	filter: invert(1) grayscale(100%) brightness(200%);
	opacity: 0.85;
}
.course-toc-modal .modal-header .btn-close:hover,
.course-author-modal .modal-header .btn-close:hover {
	opacity: 1;
}

.course-toc-modal .modal-footer,
.course-author-modal .modal-footer {
	background-color: #1a1a1a;
	border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.course-toc-modal .modal-footer .btn-secondary,
.course-author-modal .modal-footer .btn-secondary {
	background-color: transparent;
	border-color: rgba(255, 255, 255, 0.65);
	color: #fff;
}
.course-toc-modal .modal-footer .btn-secondary:hover,
.course-toc-modal .modal-footer .btn-secondary:focus,
.course-author-modal .modal-footer .btn-secondary:hover,
.course-author-modal .modal-footer .btn-secondary:focus {
	background-color: #fff;
	border-color: #fff;
	color: #1a1a1a;
}

/* =====================================================================
 * Site-wide cart indicator -- add a clarifying "Zum Warenkorb" caption
 * below the "X Artikel" counter so the red button reads as a CTA, not
 * just a status badge. Scoped to courses_shop.css load (course pages
 * for now); roll out site-wide once the courses area goes public.
 * ===================================================================== */

.cart-indicator {
	padding: 0.45em 1em 0.55em 0.85em !important;
	text-align: center;
	line-height: 1.15;
}
.cart-indicator .artikel-btn {
	display: block;
	text-align: center;
	font-size: 1em;
}
.cart-indicator .artikel-btn::after {
	content: 'Zum Warenkorb';
	display: block;
	font-size: 0.78em;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	margin-top: 0.2em;
	opacity: 0.92;
}
.cart-indicator .artikel-btn .bon-icons.cart-icon {
	vertical-align: -3px;
	margin-right: 0.25em;
}
@media (max-width: 990px) {
	/* Mobile collapses the cart button to a small bubble; suppress
	   the caption so we don't break the bubble layout. */
	.cart-indicator .artikel-btn::after {
		display: none;
	}
}

/* =====================================================================
 * Dark-mode overrides
 *
 * Site theme activates <body class="dark-theme"> and swaps the dynamic
 * <link id="change-mode"> from theme.css to dark-theme.css (see
 * public_html/js/.../bonvista*.js). In dark-theme.css:
 *   body            { color:#fff; background:#3e4c4f }
 *   .modal-content  { background:#414e52 }
 *   .modal-header/footer { background:#000 }
 *
 * Our hardcoded LIGHT colours above leave white text on white cards
 * (or dark text on the dark body). Flip them here so the courses
 * area stays readable in both modes.
 * ===================================================================== */

body.dark-theme .courses-shop-tabs {
	border-bottom-color: #35c6ac;
}
body.dark-theme .courses-shop-tabs .nav-link {
	background: #2a2a2a;
	border-color: #4a4a4a;
	border-bottom-color: #35c6ac;
	color: #d0d0d0;
}
body.dark-theme .courses-shop-tabs .nav-link:hover {
	border-color: #35c6ac;
	color: #6be0c8;
}
body.dark-theme .courses-shop-tabs .nav-link.active {
	background: #35c6ac;
	border-color: #35c6ac;
	color: #fff;
}
body.dark-theme .courses-list-title {
	color: #f0f3f5;
}

body.dark-theme .course-shop-card {
	background: #2a2a2a;
	border-color: rgba(255, 255, 255, 0.08);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}
body.dark-theme .course-shop-card:hover {
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.55);
}
body.dark-theme .course-shop-card-title a {
	color: #f5f7f9;
}
body.dark-theme .course-shop-card-subtitle {
	color: #aab3bc;
}
body.dark-theme .course-shop-card-summary {
	color: #c8d0d6;
}
body.dark-theme .course-shop-card-footer {
	border-top-color: rgba(255, 255, 255, 0.07);
}
body.dark-theme .course-shop-card-price .normal_price {
	color: #8a949c;
}
body.dark-theme .course-shop-card-footer .btn-outline-secondary {
	color: #d0d7dd;
	border-color: rgba(255, 255, 255, 0.4);
}
body.dark-theme .course-shop-card-footer .btn-outline-secondary:hover,
body.dark-theme .course-shop-card-footer .btn-outline-secondary:focus {
	background: rgba(255, 255, 255, 0.12);
	border-color: #fff;
	color: #fff;
}

/* Author / tutor line */
body.dark-theme .course-authors {
	color: #c8d0d6;
}
body.dark-theme .course-authors-prefix {
	color: #aab3bc;
}
body.dark-theme .course-author-btn {
	color: #ff8884;
}
body.dark-theme .course-author-btn:hover,
body.dark-theme .course-author-btn:focus {
	color: #ffb5b2;
}

/* Course detail page */
body.dark-theme .product-detail-course .course-hero {
	background: #1a1a1a;
}
body.dark-theme .product-detail-course .course-title {
	color: #fff;
}
body.dark-theme .product-detail-course .course-subtitle {
	color: #b0b8c0;
}
body.dark-theme .product-detail-course .course-summary {
	color: #c8d0d6;
}
body.dark-theme .product-detail-course .course-order-block {
	background: #2a2a2a;
}
body.dark-theme .product-detail-course .course-description-body {
	color: #dde2e6;
}
body.dark-theme .product-detail-course .course-provider {
	color: #aab3bc;
}

/* Tutor / Author profile modal (modal-content is #414e52 in dark) */
body.dark-theme .course-author-profile .course-author-name {
	color: #fff;
}
body.dark-theme .course-author-profile .course-author-role {
	color: #b5beca !important;
}
body.dark-theme .course-author-profile .course-author-summary,
body.dark-theme .course-author-profile .course-author-body {
	color: #e2e7eb;
}

/* ToC modal body */
body.dark-theme .course-toc-title {
	color: #fff;
}
body.dark-theme .course-toc-desc {
	color: #dde2e6;
}
body.dark-theme .course-toc-meta {
	color: #aab3bc;
}
body.dark-theme .course-toc-chapter-title {
	color: #f5f7f9;
	border-bottom-color: rgba(255, 255, 255, 0.18);
}
body.dark-theme .course-toc-lesson {
	color: #dde2e6;
	border-bottom-color: rgba(255, 255, 255, 0.08);
}
body.dark-theme .course-toc-lesson.is-public {
	background: rgba(40, 167, 69, 0.16);
}
