/*
 * Course Shop + Course landing page styles (single shared file).
 * Visual concept: a course catalogue laid out like admission tickets to a
 * lecture hall - a deep-ink hero band, paper-grey shelving for the cards,
 * and a warm brass "ticket stub" as the one recurring signature element.
 *
 * NOTE ON !important: this stylesheet is injected into a third-party
 * Moodle theme we don't control. Many themes apply global rules like
 * `a { color: ... }` with enough specificity to beat a plain class
 * selector. To keep this plugin looking correct regardless of theme,
 * every interactive element's color/background is marked !important.
 * This is an intentional, scoped exception - not used elsewhere.
 */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@400;500;600;700&display=swap');

:root {
    --cs-font: 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, Arial, sans-serif;
    --cs-ink: #171b26;
    --cs-navy: #142138;
    --cs-navy-deep: #0d1626;
    --cs-paper: #f1f1ec;
    --cs-card: #ffffff;
    --cs-line: #e2e1d8;
    --cs-muted: #6b7280;
    --cs-brass: #c8973e;
    --cs-brass-deep: #a97b2c;
    --cs-green: #2f6b4f;
    --cs-crimson: #b23a2e;
    --cs-crimson-deep: #8f2e24;
    --cs-radius: 14px;
    --cs-shadow: 0 1px 2px rgba(20, 33, 56, 0.06), 0 8px 24px rgba(20, 33, 56, 0.08);
    --cs-shadow-hover: 0 4px 10px rgba(20, 33, 56, 0.10), 0 16px 32px rgba(20, 33, 56, 0.14);
    --cs-shadow-lg: 0 8px 16px rgba(20, 33, 56, 0.10), 0 24px 48px rgba(20, 33, 56, 0.16);
}

.courseshop, .courseland {
    font-family: var(--cs-font);
}

/* =======================================================================
   SHOP GRID
   ======================================================================= */

.courseshop {
    color: var(--cs-ink);
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 1.25rem 3rem;
}

/* ---------- Hero ---------- */

.courseshop-hero {
    background: linear-gradient(155deg, var(--cs-navy) 0%, var(--cs-navy-deep) 100%);
    border-radius: var(--cs-radius);
    padding: 3.5rem 2rem;
    margin: 1.5rem 0 2rem;
    color: #f5f4ee;
    position: relative;
    overflow: hidden;
}

.courseshop-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(200, 151, 62, 0.16) 1.5px, transparent 1.5px);
    background-size: 22px 22px;
    opacity: 0.5;
    pointer-events: none;
}

.courseshop-hero-inner {
    position: relative;
    max-width: 640px;
}

.courseshop-eyebrow {
    display: inline-block;
    font-weight: 600;
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--cs-brass) !important;
    margin-bottom: 0.85rem;
}

.courseshop-title-main {
    font-weight: 700;
    font-size: clamp(1.9rem, 3.4vw, 2.85rem);
    line-height: 1.15;
    margin: 0 0 0.75rem;
    color: #ffffff !important;
    letter-spacing: -0.01em;
}

.courseshop-lead {
    font-size: 1.05rem;
    line-height: 1.6;
    color: #cbd2e0 !important;
    margin: 0 0 1.85rem;
    max-width: 34rem;
}

.courseshop-searchbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.08);
    padding: 0.45rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    position: relative;
    max-width: 480px;
}

.courseshop-search-icon {
    position: absolute;
    inset-inline-start: 1.1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--cs-muted);
    pointer-events: none;
}

.courseshop-search-input {
    flex: 1 1 220px;
    min-width: 0;
    border: none;
    border-radius: 999px;
    padding-block: 0.7rem;
    padding-inline: 2.5rem 0.85rem;
    font-family: inherit;
    font-size: 0.92rem;
    background: #ffffff !important;
    color: var(--cs-ink) !important;
}

.courseshop-search-btn {
    flex: 0 0 auto;
    border: none;
    border-radius: 999px;
    padding: 0.7rem 1.6rem;
    background: var(--cs-brass) !important;
    color: #221705 !important;
    font-weight: 700;
    font-size: 0.92rem;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.15s ease;
}

.courseshop-search-btn:hover {
    background: var(--cs-brass-deep) !important;
    transform: translateY(-1px);
}

/* ---------- Category pill filters ---------- */

.courseshop-pills {
    display: flex;
    gap: 0.55rem;
    overflow-x: auto;
    padding: 0.2rem 0.1rem 1.4rem;
    margin-bottom: 0.4rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.courseshop-pill {
    flex: 0 0 auto;
    display: inline-block;
    padding: 0.5rem 1.15rem;
    border-radius: 999px;
    border: 1px solid var(--cs-line);
    background: var(--cs-card) !important;
    color: var(--cs-ink) !important;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none !important;
    white-space: nowrap;
    transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.courseshop-pill:hover {
    border-color: var(--cs-brass);
    box-shadow: var(--cs-shadow);
    color: var(--cs-ink) !important;
}

.courseshop-pill.is-active {
    background: var(--cs-navy) !important;
    border-color: var(--cs-navy);
    color: #ffffff !important;
}

/* ---------- Toolbar ---------- */

.courseshop-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.9rem;
    border-bottom: 1px solid var(--cs-line);
}

.courseshop-count {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    font-size: 0.9rem;
    color: var(--cs-muted);
}

.courseshop-clear {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--cs-brass-deep) !important;
    text-decoration: none !important;
}

.courseshop-clear:hover {
    text-decoration: underline !important;
}

.courseshop-sort {
    display: flex;
    gap: 1.1rem;
}

.courseshop-sort-link {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--cs-muted) !important;
    text-decoration: none !important;
    padding-bottom: 2px;
    border-bottom: 2px solid transparent;
}

.courseshop-sort-link:hover {
    color: var(--cs-ink) !important;
}

.courseshop-sort-link.is-active {
    color: var(--cs-navy) !important;
    border-bottom-color: var(--cs-brass);
}

/* ---------- Grid & cards ---------- */

.courseshop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 1.5rem;
}

.courseshop-card {
    background: var(--cs-card);
    border: 1px solid var(--cs-line);
    border-radius: var(--cs-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--cs-shadow);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

@media (prefers-reduced-motion: no-preference) {
    .courseshop-card:hover {
        transform: translateY(-5px);
        box-shadow: var(--cs-shadow-lg);
    }
    .courseshop-card {
        animation: courseshop-fade-in 0.45s ease backwards;
    }
    .courseshop-card:nth-child(1) { animation-delay: 0.02s; }
    .courseshop-card:nth-child(2) { animation-delay: 0.06s; }
    .courseshop-card:nth-child(3) { animation-delay: 0.10s; }
    .courseshop-card:nth-child(4) { animation-delay: 0.14s; }
    .courseshop-card:nth-child(5) { animation-delay: 0.18s; }
    .courseshop-card:nth-child(6) { animation-delay: 0.22s; }
    .courseshop-card:nth-child(n+7) { animation-delay: 0.25s; }
}

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

.courseshop-card-media {
    display: block;
    position: relative;
    aspect-ratio: 16 / 10;
    background-color: #dde3ea;
    background-image: linear-gradient(135deg, #1f3357 0%, #12213b 100%);
    background-size: cover;
    background-position: center;
    transition: background-size 0.4s ease;
}

@media (prefers-reduced-motion: no-preference) {
    .courseshop-card:hover .courseshop-card-media {
        background-size: 112%;
    }
}

.courseshop-card-media[data-noimage="1"] {
    background-image: repeating-linear-gradient(135deg, #1c2c4a, #1c2c4a 14px, #22375c 14px, #22375c 28px);
}

/* Signature element: ticket-stub price badge with a perforated edge. */
.courseshop-ticket {
    position: absolute;
    top: 0.85rem;
    inset-inline-end: -0.1rem;
    background: var(--cs-brass) !important;
    color: #221705 !important;
    font-weight: 700;
    font-size: 0.82rem;
    padding: 0.4rem 0.9rem 0.4rem 0.75rem;
    border-radius: 6px 0 0 6px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
    background-image: radial-gradient(circle, rgba(255, 255, 255, 0.55) 1.6px, transparent 1.6px);
    background-size: 100% 9px;
    background-position-y: -3px;
    background-repeat: repeat-y;
    background-position-x: 3px;
}

.courseshop-ticket-free {
    background-color: var(--cs-green) !important;
    color: #eafff2 !important;
}

.courseshop-ticket-sale {
    background-color: var(--cs-crimson) !important;
    color: #fff3f1 !important;
}

.courseshop-card-body {
    padding: 1.15rem 1.2rem 0.4rem;
    flex: 1;
}

.courseshop-category {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--cs-brass-deep) !important;
    margin-bottom: 0.4rem;
}

.courseshop-card-title {
    font-size: 1.16rem;
    font-weight: 700;
    line-height: 1.32;
    margin: 0 0 0.45rem;
    letter-spacing: -0.005em;
}

.courseshop-card-title a {
    color: var(--cs-ink) !important;
    text-decoration: none !important;
}

.courseshop-card-title a:hover {
    color: var(--cs-navy) !important;
    text-decoration: underline !important;
}

.courseshop-summary {
    font-size: 0.88rem;
    line-height: 1.55;
    color: var(--cs-muted);
    margin: 0 0 0.6rem;
}

.courseshop-teacher {
    font-size: 0.8rem;
    color: var(--cs-muted);
    margin: 0 0 0.2rem;
}

.courseshop-teacher::before {
    content: "— ";
}

.courseshop-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.15rem 0.9rem;
    padding: 0 1.2rem 0.85rem;
    margin-top: -0.2rem;
}

.courseshop-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.32rem;
    font-size: 0.78rem;
    color: var(--cs-muted);
    white-space: nowrap;
}

.courseshop-meta-icon {
    flex: 0 0 auto;
    color: var(--cs-brass-deep);
}

.courseshop-card-footer {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding: 0.95rem 1.2rem 1.15rem;
    border-top: 1px dashed var(--cs-line);
    margin-top: 0.5rem;
}

.courseshop-card-actions {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
}

.courseshop-card-actions .courseshop-btn {
    flex: 1;
    text-align: center;
}

.courseshop-price-block {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.courseshop-price {
    font-weight: 800;
    font-size: 0.97rem;
    color: var(--cs-navy);
}

.courseshop-price.is-free {
    color: var(--cs-green);
}

.courseshop-price.is-sale {
    color: var(--cs-crimson);
    font-size: 1.05rem;
}

.courseshop-price-was {
    font-size: 0.82rem;
    color: var(--cs-muted);
    text-decoration: line-through;
    text-decoration-thickness: 1.5px;
}

.courseshop-discount-chip {
    background: rgba(178, 58, 46, 0.12);
    color: var(--cs-crimson-deep) !important;
    font-weight: 700;
    font-size: 0.72rem;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    white-space: nowrap;
}

.courseshop-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.courseshop-btn {
    display: inline-block;
    background: var(--cs-navy) !important;
    color: #ffffff !important;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 0.6rem 1.15rem;
    border-radius: 8px;
    text-decoration: none !important;
    transition: background-color 0.15s ease, transform 0.15s ease;
    white-space: nowrap;
}

.courseshop-btn:hover {
    background: var(--cs-navy-deep) !important;
    transform: translateY(-1px);
}

/* ---------- Empty state ---------- */

.courseshop-empty {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--cs-muted);
    font-size: 1rem;
}

/* ---------- Pagination ---------- */

.courseshop-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.4rem;
    margin-top: 2.25rem;
}

.courseshop-page-link,
.courseshop-page-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.1rem;
    height: 2.1rem;
    border-radius: 7px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--cs-ink) !important;
    text-decoration: none !important;
    border: 1px solid var(--cs-line);
}

.courseshop-page-link:hover {
    border-color: var(--cs-brass);
}

.courseshop-page-link.is-active {
    background: var(--cs-navy) !important;
    border-color: var(--cs-navy);
    color: #fff !important;
}

.courseshop-page-ellipsis {
    border: none;
    color: var(--cs-muted) !important;
}

/* =======================================================================
   COURSE LANDING PAGE
   ======================================================================= */

.courseland {
    color: var(--cs-ink);
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 1.25rem 3rem;
    scroll-behavior: smooth;
}

/* ---------- Breadcrumb ---------- */

.courseland-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 1rem 0 0;
    font-size: 0.82rem;
}

.courseland-breadcrumb a {
    color: var(--cs-muted) !important;
    text-decoration: none !important;
}

.courseland-breadcrumb a:hover {
    color: var(--cs-navy) !important;
    text-decoration: underline !important;
}

.courseland-breadcrumb-sep {
    color: var(--cs-line);
}

.courseland-breadcrumb-current {
    color: var(--cs-ink) !important;
    font-weight: 600;
    max-width: 40ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---------- Hero ---------- */

.courseland-hero {
    border-radius: var(--cs-radius);
    margin: 1.5rem 0 0;
    background-color: var(--cs-navy);
    background-image: linear-gradient(155deg, var(--cs-navy) 0%, var(--cs-navy-deep) 100%);
    background-size: cover;
    background-position: center;
    overflow: hidden;
    position: relative;
}

.courseland-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(200, 151, 62, 0.14) 1.5px, transparent 1.5px);
    background-size: 22px 22px;
    pointer-events: none;
}

/* Deliberately dark/opaque: course thumbnails are often busy marketing
   banners, so contrast can't depend on what the uploaded image looks like. */
.courseland-hero-overlay {
    position: relative;
    background: linear-gradient(165deg, rgba(11, 19, 33, 0.88) 0%, rgba(11, 19, 33, 0.96) 100%);
    padding: 3.5rem 2rem;
}

.courseland-hero-inner {
    max-width: 720px;
}

.courseland-eyebrow {
    display: inline-block;
    font-weight: 600;
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--cs-brass) !important;
    margin-bottom: 0.85rem;
}

.courseland-title {
    font-weight: 700;
    font-size: clamp(1.85rem, 3.2vw, 2.7rem);
    line-height: 1.22;
    margin: 0 0 1rem;
    color: #ffffff !important;
    letter-spacing: -0.01em;
}

.courseland-hero-byline {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.9rem;
    color: #dfe4ee !important;
    margin-bottom: 1.3rem;
}

.courseland-hero-avatars {
    display: flex;
}

.courseland-hero-avatars img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--cs-navy);
    margin-inline-end: -10px;
}

.courseland-hero-avatars img:last-child {
    margin-inline-end: 0;
}

.courseland-hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem 0.7rem;
}

.courseland-hero-stat {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.83rem;
    color: #eef1f7 !important;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
}

.courseland-hero-stat svg {
    color: var(--cs-brass);
    flex: 0 0 auto;
}

/* ---------- Quick-jump subnav ---------- */

.courseland-subnav {
    display: flex;
    gap: 1.5rem;
    padding: 0.9rem 0.25rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--cs-line);
}

.courseland-subnav a {
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--cs-muted) !important;
    text-decoration: none !important;
    padding-bottom: 0.2rem;
    border-bottom: 2px solid transparent;
}

.courseland-subnav a:hover {
    color: var(--cs-navy) !important;
    border-bottom-color: var(--cs-brass);
}

.courseland-subnav a.is-active {
    color: var(--cs-navy) !important;
    border-bottom-color: var(--cs-brass);
}

/* ---------- Layout ---------- */

.courseland-body {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2rem;
    align-items: start;
}

.courseland-block {
    margin-bottom: 2.5rem;
    scroll-margin-top: 1rem;
}

.courseland-block-title {
    display: inline-block;
    font-weight: 700;
    font-size: 1.28rem;
    margin: 0 0 1.2rem;
    color: var(--cs-navy);
    position: relative;
    padding-bottom: 0.6rem;
}

.courseland-block-title::after {
    content: "";
    position: absolute;
    bottom: 0;
    inset-inline-start: 0;
    width: 42px;
    height: 3px;
    border-radius: 2px;
    background: var(--cs-brass);
}

/* ---------- Teachers ---------- */

.courseland-teacher-card {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 1.15rem;
    background: var(--cs-card);
    border: 1px solid var(--cs-line);
    border-radius: var(--cs-radius);
    margin-bottom: 0.9rem;
    box-shadow: var(--cs-shadow);
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

@media (prefers-reduced-motion: no-preference) {
    .courseland-teacher-card:hover {
        box-shadow: var(--cs-shadow-hover);
        transform: translateY(-2px);
    }
}

.courseland-teacher-photo {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    object-fit: cover;
    flex: 0 0 auto;
    border: 3px solid var(--cs-paper);
    box-shadow: 0 0 0 2px var(--cs-brass);
}

.courseland-teacher-info {
    flex: 1;
    min-width: 0;
}

.courseland-teacher-name {
    font-size: 1.03rem;
    font-weight: 700;
    margin: 0 0 0.3rem;
    color: var(--cs-ink);
}

.courseland-teacher-bio {
    font-size: 0.86rem;
    line-height: 1.55;
    color: var(--cs-muted);
    margin: 0;
}

/* ---------- About / description ---------- */

.courseland-description {
    font-size: 0.97rem;
    line-height: 1.8;
    color: var(--cs-ink);
}

.courseland-description p {
    margin: 0 0 1rem;
}

.courseland-description img {
    max-width: 100%;
    border-radius: 8px;
}

/* ---------- Curriculum accordion ---------- */

.courseland-section {
    border: 1px solid var(--cs-line);
    border-radius: 10px;
    margin-bottom: 0.7rem;
    overflow: hidden;
    background: var(--cs-card);
    transition: box-shadow 0.15s ease;
}

.courseland-section:not(.courseland-section-locked):hover {
    box-shadow: var(--cs-shadow);
}

.courseland-section-summary {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.95rem 1.1rem;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.93rem;
    color: var(--cs-navy) !important;
    list-style: none;
}

.courseland-section-summary::-webkit-details-marker {
    display: none;
}

.courseland-section-summary::after {
    content: "";
    width: 8px;
    height: 8px;
    border-inline-end: 2px solid var(--cs-brass-deep);
    border-bottom: 2px solid var(--cs-brass-deep);
    transform: rotate(-45deg);
    transition: transform 0.15s ease;
    flex: 0 0 auto;
}

.courseland-section[open] .courseland-section-summary::after {
    transform: rotate(45deg);
}

.courseland-section-badge {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--cs-paper);
    color: var(--cs-brass-deep) !important;
    font-size: 0.74rem;
    font-weight: 800;
}

.courseland-section-badge.is-locked {
    background: rgba(178, 58, 46, 0.1);
    color: var(--cs-crimson-deep) !important;
}

.courseland-section-name {
    flex: 1;
}

.courseland-section-count {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--cs-muted) !important;
    white-space: nowrap;
}

.courseland-activity-list {
    list-style: none;
    margin: 0;
    padding-block: 0.3rem 0.9rem;
    padding-inline: 3.6rem 1.1rem;
    border-top: 1px dashed var(--cs-line);
}

.courseland-activity {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0;
    font-size: 0.87rem;
    color: var(--cs-ink);
}

.courseland-activity-icon {
    display: inline-flex;
    color: var(--cs-brass-deep);
    flex: 0 0 auto;
}

.courseland-activity-name {
    flex: 1;
}

/* ---------- Locked sections: blurred-preview paywall ---------- */

.courseland-section-locked {
    background: var(--cs-paper);
}

.courseland-section-locked .courseland-section-summary {
    cursor: default;
}

.courseland-locked-wrap {
    position: relative;
    border-top: 1px dashed var(--cs-line);
    /* Hard floor so the overlay always has room to sit fully over the
       blurred content, even if a section only has one or two items. */
    min-height: 92px;
}

.courseland-locked-wrap .courseland-activity-list-blurred {
    border-top: none;
    padding-top: 0.9rem;
    filter: blur(5px);
    -webkit-filter: blur(5px);
    opacity: 0.55 !important;
    user-select: none;
    pointer-events: none;
}

.courseland-locked-overlay {
    position: absolute;
    inset: 0;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.55rem;
    padding: 1rem;
    background: linear-gradient(180deg, rgba(241, 241, 236, 0.4) 0%, var(--cs-paper) 58%) !important;
}

.courseland-locked-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--cs-card);
    color: var(--cs-brass-deep) !important;
    box-shadow: var(--cs-shadow);
}

.courseland-locked-overlay p {
    margin: 0;
    font-size: 0.87rem;
    font-weight: 700;
    color: var(--cs-navy) !important;
}

.courseland-locked-cta {
    display: inline-block;
    background: var(--cs-brass) !important;
    color: #221705 !important;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 0.55rem 1.3rem;
    border-radius: 999px;
    text-decoration: none !important;
    box-shadow: 0 4px 14px rgba(200, 151, 62, 0.4);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.courseland-locked-cta:hover {
    background: var(--cs-brass-deep) !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(200, 151, 62, 0.5);
}

/* ---------- Sidebar / price card ---------- */

.courseland-sidebar {
    position: sticky;
    top: 1.25rem;
}

.courseland-price-card {
    background: var(--cs-card);
    border: 1px solid var(--cs-line);
    border-radius: var(--cs-radius);
    overflow: hidden;
    box-shadow: var(--cs-shadow-lg);
}

.courseland-price-media {
    aspect-ratio: 16 / 10;
    background-color: #dde3ea;
    background-image: linear-gradient(135deg, #1f3357 0%, #12213b 100%);
    background-size: cover;
    background-position: center;
    position: relative;
}

.courseland-price-media[data-noimage="1"] {
    background-image: repeating-linear-gradient(135deg, #1c2c4a, #1c2c4a 14px, #22375c 14px, #22375c 28px);
}

.courseland-price-ribbon {
    position: absolute;
    top: 0.85rem;
    inset-inline-end: -0.1rem;
    background: var(--cs-crimson) !important;
    color: #fff3f1 !important;
    font-weight: 700;
    font-size: 0.82rem;
    padding: 0.4rem 0.9rem;
    border-radius: 6px 0 0 6px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
}

.courseland-price-body {
    padding: 1.35rem;
}

.courseland-price-row {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-bottom: 0.4rem;
}

.courseland-price-now {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--cs-navy) !important;
}

.courseland-price-now.is-free {
    color: var(--cs-green) !important;
}

.courseland-price-now.is-sale {
    color: var(--cs-crimson) !important;
}

.courseland-price-was {
    font-size: 0.95rem;
    color: var(--cs-muted);
    text-decoration: line-through;
    text-decoration-thickness: 1.5px;
}

.courseland-sale-countdown {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0 0 1rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--cs-crimson-deep) !important;
}

.courseland-enrolled-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(47, 107, 79, 0.1);
    color: var(--cs-green) !important;
    font-weight: 700;
    font-size: 0.88rem;
    padding: 0.6rem 0.8rem;
    border-radius: 8px;
    margin: 0 0 1rem;
}

.courseland-cta {
    display: block;
    text-align: center;
    background: var(--cs-navy) !important;
    color: #ffffff !important;
    font-weight: 700;
    font-size: 1.02rem;
    padding: 0.92rem 1rem;
    border-radius: 8px;
    text-decoration: none !important;
    transition: background-color 0.15s ease, transform 0.15s ease;
    margin-top: 0.5rem;
}

.courseland-cta:hover {
    background: var(--cs-navy-deep) !important;
    transform: translateY(-1px);
}

.courseland-includes {
    list-style: none;
    margin: 1.2rem 0 0;
    padding: 1rem 0 0;
    border-top: 1px solid var(--cs-line);
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.courseland-accesscode {
    margin-top: 1rem;
    padding-top: 0.9rem;
    border-top: 1px dashed var(--cs-line);
}

.courseland-accesscode-summary {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    font-size: 0.83rem;
    font-weight: 600;
    color: var(--cs-muted);
    list-style: none;
}

.courseland-accesscode-summary::-webkit-details-marker {
    display: none;
}

.courseland-accesscode-summary svg {
    color: var(--cs-brass-deep);
    flex: 0 0 auto;
}

.courseland-accesscode-summary:hover {
    color: var(--cs-navy);
}

.courseland-accesscode-form {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.7rem;
}

.courseland-accesscode-form input[type="text"] {
    flex: 1;
    min-width: 0;
    border: 1px solid var(--cs-line);
    border-radius: 7px;
    padding: 0.55rem 0.7rem;
    font-family: var(--cs-font);
    font-size: 0.85rem;
}

.courseland-accesscode-form input[type="text"]:focus {
    outline: none;
    border-color: var(--cs-brass);
    box-shadow: 0 0 0 3px rgba(200, 151, 62, 0.2);
}

.courseland-accesscode-form button {
    flex: 0 0 auto;
    border: none;
    border-radius: 7px;
    padding: 0.55rem 1rem;
    background: var(--cs-navy);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
}

.courseland-accesscode-form button:hover {
    background: var(--cs-navy-deep);
}

.courseland-includes li {
    font-size: 0.84rem;
    color: var(--cs-muted);
    padding-inline-start: 1.1rem;
    position: relative;
}

.courseland-includes li::before {
    content: "";
    position: absolute;
    inset-inline-start: 0;
    top: 0.45rem;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--cs-brass);
}

.courseland-back {
    display: block;
    text-align: center;
    margin-top: 0.9rem;
    font-size: 0.85rem;
    color: var(--cs-muted) !important;
    text-decoration: none !important;
}

.courseland-back:hover {
    color: var(--cs-navy) !important;
    text-decoration: underline !important;
}

/* ---------- Mobile sticky buy bar ---------- */

.courseland-mobilebar {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 60;
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: var(--cs-card);
    border-top: 1px solid var(--cs-line);
    box-shadow: 0 -6px 20px rgba(20, 33, 56, 0.12);
    padding: 0.75rem 1rem;
    padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
    transform: translateY(100%);
    transition: transform 0.25s ease;
}

.courseland-mobilebar.is-visible {
    transform: translateY(0);
}

.courseland-mobilebar-price {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    font-weight: 700;
    min-width: 0;
}

.courseland-mobilebar-now {
    font-size: 1.05rem;
    color: var(--cs-navy) !important;
}

.courseland-mobilebar-now.is-free {
    color: var(--cs-green) !important;
}

.courseland-mobilebar-was {
    font-size: 0.8rem;
    color: var(--cs-muted);
    text-decoration: line-through;
}

.courseland-mobilebar-cta {
    flex: 0 0 auto;
    background: var(--cs-navy) !important;
    color: #ffffff !important;
    font-weight: 700;
    font-size: 0.88rem;
    padding: 0.6rem 1.2rem;
    border-radius: 999px;
    text-decoration: none !important;
    white-space: nowrap;
}

.courseland-mobilebar-cta:hover {
    background: var(--cs-navy-deep) !important;
}

@media (max-width: 900px) {
    .courseland-mobilebar {
        display: flex;
    }
    .courseland {
        padding-bottom: 5.5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .courseland-mobilebar {
        transition: none;
    }
}

/* =======================================================================
   SHARED: layout, focus, RTL, small screens
   ======================================================================= */

/* ---------- Focus visibility ---------- */

.courseshop a:focus-visible,
.courseshop button:focus-visible,
.courseshop input:focus-visible,
.courseland a:focus-visible,
.courseland button:focus-visible,
.courseland summary:focus-visible {
    outline: 3px solid var(--cs-brass);
    outline-offset: 2px;
}

/* ---------- RTL ---------- */

[dir="rtl"] .courseshop-ticket,
[dir="rtl"] .courseland-price-ribbon {
    border-radius: 0 6px 6px 0;
}

[dir="rtl"] .courseshop-teacher::before {
    content: "";
}

[dir="rtl"] .courseshop-teacher::after {
    content: " —";
}

/* ---------- Small screens ---------- */

@media (max-width: 900px) {
    .courseland-body {
        grid-template-columns: 1fr;
    }
    .courseland-sidebar {
        position: static;
        order: -1;
        margin-bottom: 1.5rem;
    }
    .courseland-hero-overlay {
        padding: 2.25rem 1.25rem;
    }
    .courseland-subnav {
        gap: 1.1rem;
        overflow-x: auto;
        white-space: nowrap;
    }
}

@media (max-width: 480px) {
    .courseshop-hero {
        padding: 2.25rem 1.25rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .courseland {
        scroll-behavior: auto;
    }
}

/* =======================================================================
   ACCOUNT BAR (wishlist / cart links on the shop grid)
   ======================================================================= */

.courseshop-accountbar {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.courseshop-accountlink {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    border: 1px solid var(--cs-line);
    background: var(--cs-card) !important;
    color: var(--cs-ink) !important;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none !important;
}

.courseshop-accountlink:hover {
    border-color: var(--cs-brass);
}

.courseshop-accountlink.is-active {
    background: var(--cs-navy) !important;
    border-color: var(--cs-navy);
    color: #ffffff !important;
}

.courseshop-accountbadge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.15rem;
    height: 1.15rem;
    padding: 0 0.3rem;
    border-radius: 999px;
    background: var(--cs-brass);
    color: #221705 !important;
    font-size: 0.68rem;
    font-weight: 800;
}

.courseshop-accountlink.is-active .courseshop-accountbadge {
    background: #ffffff;
    color: var(--cs-navy) !important;
}

/* =======================================================================
   WISHLIST / CART - SHOP CARD
   ======================================================================= */

.courseshop-card {
    position: relative;
}

.courseshop-wish-form {
    position: absolute;
    top: 0.85rem;
    inset-inline-start: 0.85rem;
    z-index: 2;
}

.courseshop-wish-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: rgba(13, 22, 38, 0.55) !important;
    color: #ffffff !important;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.15s ease;
}

.courseshop-wish-btn:hover {
    transform: scale(1.08);
}

.courseshop-wish-btn.is-active {
    background: var(--cs-crimson) !important;
    color: #fff3f1 !important;
}

.courseshop-cart-form {
    flex: 0 0 auto;
}

.courseshop-cart-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: var(--cs-card) !important;
    color: var(--cs-navy) !important;
    border: 1px solid var(--cs-line);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
}

.courseshop-cart-btn:hover {
    border-color: var(--cs-brass);
    transform: translateY(-1px);
}

.courseshop-cart-btn.is-active {
    background: var(--cs-navy) !important;
    border-color: var(--cs-navy);
    color: #ffffff !important;
}

/* =======================================================================
   WISHLIST / CART - LANDING PAGE PRICE CARD
   ======================================================================= */

.courseland-hero-rating {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--cs-brass) !important;
    font-weight: 600;
}

.courseland-secondary-actions {
    display: flex;
    gap: 0.55rem;
    margin-top: 0.65rem;
}

.courseland-secondary-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    background: var(--cs-card) !important;
    color: var(--cs-ink) !important;
    border: 1px solid var(--cs-line);
    font-weight: 600;
    font-size: 0.8rem;
    padding: 0.6rem 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none !important;
    transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.courseland-secondary-btn:hover {
    border-color: var(--cs-brass);
}

.courseland-secondary-btn.is-active {
    background: var(--cs-navy) !important;
    border-color: var(--cs-navy);
    color: #ffffff !important;
}

.courseland-wish-form,
.courseland-cart-form {
    flex: 1;
}

.courseland-wish-form .courseland-secondary-btn,
.courseland-cart-form .courseland-secondary-btn {
    width: 100%;
}

/* =======================================================================
   STUDENT REVIEWS
   ======================================================================= */

.courseland-review-summary {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--cs-line);
}

.courseland-review-avg {
    font-size: 2.4rem;
    font-weight: 800;
    color: var(--cs-navy);
    line-height: 1;
}

.courseland-review-stars {
    display: flex;
    gap: 0.15rem;
    color: var(--cs-brass);
    margin-bottom: 0.3rem;
}

.courseland-review-stars-sm {
    margin-bottom: 0.5rem;
}

.courseland-review-count {
    font-size: 0.82rem;
    color: var(--cs-muted);
}

.courseland-review-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.courseland-review-card {
    display: flex;
    gap: 0.9rem;
    padding: 1rem;
    background: var(--cs-card);
    border: 1px solid var(--cs-line);
    border-radius: var(--cs-radius);
}

.courseland-review-photo {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    flex: 0 0 auto;
}

.courseland-review-body {
    flex: 1;
    min-width: 0;
}

.courseland-review-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.courseland-review-name {
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--cs-ink);
}

.courseland-review-date {
    font-size: 0.76rem;
    color: var(--cs-muted);
}

.courseland-review-comment {
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--cs-ink);
    margin: 0.2rem 0 0.4rem;
    white-space: pre-line;
}

.courseland-review-delete {
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--cs-crimson-deep) !important;
    text-decoration: none !important;
}

.courseland-review-delete:hover {
    text-decoration: underline !important;
}

.courseland-review-empty {
    color: var(--cs-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.courseland-review-locked {
    font-size: 0.88rem;
    color: var(--cs-muted);
    background: var(--cs-paper);
    padding: 0.9rem 1rem;
    border-radius: 10px;
}

.courseland-review-locked a {
    color: var(--cs-navy) !important;
    font-weight: 600;
}

/* ---- Review form ---- */

.courseland-review-form {
    background: var(--cs-paper);
    border: 1px solid var(--cs-line);
    border-radius: var(--cs-radius);
    padding: 1.25rem;
}

.courseland-review-form-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 0.9rem;
    color: var(--cs-navy);
}

.courseland-star-input {
    display: flex;
    gap: 0.25rem;
    border: none;
    padding: 0;
    margin: 0 0 1rem;
}

.courseland-star-input input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.courseland-star {
    font-size: 1.7rem;
    line-height: 1;
    color: var(--cs-line);
    cursor: pointer;
    transition: color 0.1s ease;
}

.courseland-star-input input:checked + label.courseland-star {
    color: var(--cs-brass);
}

.courseland-star.is-filled {
    color: var(--cs-brass);
}

.courseland-review-form textarea {
    width: 100%;
    max-width: 100%;
    border: 1px solid var(--cs-line);
    border-radius: 8px;
    padding: 0.7rem 0.85rem;
    font-family: var(--cs-font);
    font-size: 0.9rem;
    color: var(--cs-ink);
    background: #ffffff;
    resize: vertical;
    margin-bottom: 0.9rem;
}

.courseland-review-form-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* =======================================================================
   CART PAGE
   ======================================================================= */

.courseshop-cart-page {
    padding-top: 1.5rem;
}

.courseshop-cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.courseshop-cart-title {
    font-weight: 700;
    font-size: 1.6rem;
    color: var(--cs-navy);
    margin: 0;
}

.courseshop-cart-back {
    font-size: 0.85rem;
    color: var(--cs-muted) !important;
    text-decoration: none !important;
}

.courseshop-cart-back:hover {
    color: var(--cs-navy) !important;
    text-decoration: underline !important;
}

.courseshop-alert {
    padding: 0.85rem 1.1rem;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.courseshop-alert-success {
    background: rgba(47, 107, 79, 0.1);
    color: var(--cs-green);
}

.courseshop-alert-error {
    background: rgba(178, 58, 46, 0.1);
    color: var(--cs-crimson-deep);
}

.courseshop-alert-info {
    background: rgba(20, 33, 56, 0.06);
    color: var(--cs-navy);
}

.courseshop-alert-error ul {
    margin: 0;
    padding-inline-start: 1.2rem;
}

.courseshop-cart-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    align-items: start;
}

.courseshop-cart-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.courseshop-cart-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--cs-card);
    border: 1px solid var(--cs-line);
    border-radius: var(--cs-radius);
    padding: 0.9rem;
}

.courseshop-cart-item-media {
    width: 110px;
    height: 70px;
    flex: 0 0 auto;
    border-radius: 8px;
    background-color: #dde3ea;
    background-image: linear-gradient(135deg, #1f3357 0%, #12213b 100%);
    background-size: cover;
    background-position: center;
}

.courseshop-cart-item-media[data-noimage="1"] {
    background-image: repeating-linear-gradient(135deg, #1c2c4a, #1c2c4a 14px, #22375c 14px, #22375c 28px);
}

.courseshop-cart-item-body {
    flex: 1;
    min-width: 0;
}

.courseshop-cart-item-name {
    display: block;
    font-weight: 700;
    font-size: 0.98rem;
    color: var(--cs-ink) !important;
    text-decoration: none !important;
    margin-bottom: 0.35rem;
}

.courseshop-cart-item-name:hover {
    color: var(--cs-navy) !important;
    text-decoration: underline !important;
}

.courseshop-cart-item-price {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.courseshop-cart-price-free {
    color: var(--cs-green);
    font-weight: 700;
    font-size: 0.9rem;
}

.courseshop-cart-price-was {
    font-size: 0.8rem;
    color: var(--cs-muted);
    text-decoration: line-through;
}

.courseshop-cart-price-now {
    font-weight: 700;
    font-size: 0.98rem;
    color: var(--cs-navy);
}

.courseshop-cart-item-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
    flex: 0 0 auto;
}

.courseshop-cart-remove {
    font-size: 0.76rem;
    color: var(--cs-muted) !important;
    text-decoration: none !important;
}

.courseshop-cart-remove:hover {
    color: var(--cs-crimson-deep) !important;
    text-decoration: underline !important;
}

.courseshop-cart-summary {
    background: var(--cs-card);
    border: 1px solid var(--cs-line);
    border-radius: var(--cs-radius);
    padding: 1.25rem;
    box-shadow: var(--cs-shadow);
    position: sticky;
    top: 1.25rem;
}

.courseshop-cart-promo-form {
    margin-bottom: 0.3rem;
}

.courseshop-cart-promo-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--cs-ink);
    margin-bottom: 0.5rem;
}

.courseshop-cart-promo-applied {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    background: rgba(47, 107, 79, 0.1);
    color: var(--cs-green);
    font-weight: 600;
    font-size: 0.84rem;
    padding: 0.65rem 0.85rem;
    border-radius: 8px;
    margin-bottom: 1.1rem;
}

.courseshop-cart-promo-applied a {
    color: var(--cs-crimson-deep) !important;
    font-weight: 700;
    font-size: 0.78rem;
    text-decoration: none !important;
    white-space: nowrap;
}

.courseshop-cart-promo-applied a:hover {
    text-decoration: underline !important;
}

.courseshop-cart-promo-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.1rem;
}

.courseshop-cart-promo-row input {
    flex: 1;
    min-width: 0;
    border: 1px solid var(--cs-line);
    border-radius: 7px;
    padding: 0.55rem 0.7rem;
    font-family: var(--cs-font);
    font-size: 0.88rem;
}

.courseshop-cart-promo-row button {
    flex: 0 0 auto;
    border: none;
    border-radius: 7px;
    padding: 0.55rem 1rem;
    background: var(--cs-brass) !important;
    color: #221705 !important;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
}

.courseshop-cart-promo-row button:hover {
    background: var(--cs-brass-deep) !important;
}

.courseshop-cart-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid var(--cs-line);
    margin-bottom: 0.9rem;
    font-size: 0.95rem;
}

.courseshop-cart-total strong {
    font-size: 1.2rem;
    color: var(--cs-navy);
}

.courseshop-cart-note {
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--cs-muted);
    margin: 0;
}

@media (max-width: 820px) {
    .courseshop-cart-layout {
        grid-template-columns: 1fr;
    }
    .courseshop-cart-summary {
        position: static;
    }
    .courseshop-cart-item {
        flex-wrap: wrap;
    }
}

/* =======================================================================
   ADMIN: PROMO CODES PAGE
   ======================================================================= */

.courseshop-admin {
    max-width: 900px;
    padding-top: 1.5rem;
}

.courseshop-admin-form {
    background: var(--cs-card);
    border: 1px solid var(--cs-line);
    border-radius: var(--cs-radius);
    padding: 1.25rem;
    margin-bottom: 2rem;
}

.courseshop-admin-row {
    margin-bottom: 0.9rem;
}

.courseshop-admin-row label {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--cs-ink);
    margin-bottom: 0.35rem;
}

.courseshop-admin-row input,
.courseshop-admin-row select {
    width: 100%;
    border: 1px solid var(--cs-line);
    border-radius: 7px;
    padding: 0.55rem 0.7rem;
    font-family: var(--cs-font);
    font-size: 0.9rem;
}

.courseshop-admin-row-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.courseshop-admin-table-wrap {
    overflow-x: auto;
}

.courseshop-admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.86rem;
}

.courseshop-admin-table th,
.courseshop-admin-table td {
    text-align: start;
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid var(--cs-line);
}

.courseshop-admin-table th {
    color: var(--cs-muted);
    font-weight: 700;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.courseshop-admin-delete {
    color: var(--cs-crimson-deep) !important;
    text-decoration: none !important;
    font-weight: 600;
}

.courseshop-admin-delete:hover {
    text-decoration: underline !important;
}

.courseshop-admin-empty {
    color: var(--cs-muted);
    font-size: 0.9rem;
}

@media (max-width: 600px) {
    .courseshop-admin-row-split {
        grid-template-columns: 1fr;
    }
}

/* =======================================================================
   ADMIN: COUPONS PAGE
   ======================================================================= */

.courseshop-coupon-intro {
    font-size: 0.88rem;
    color: var(--cs-muted);
    max-width: 60ch;
    margin: 0 0 1.5rem;
}

.courseshop-coupon-courselist {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    max-height: 180px;
    overflow-y: auto;
    border: 1px solid var(--cs-line);
    border-radius: 8px;
    padding: 0.75rem;
    background: var(--cs-paper);
}

.courseshop-coupon-courseitem {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 400;
    margin: 0;
}

.courseshop-coupon-courseitem input {
    width: auto;
}

.courseshop-admin-hint {
    font-size: 0.76rem;
    color: var(--cs-muted);
    margin: 0.4rem 0 0;
}

.courseshop-coupon-listtitle {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--cs-navy);
    margin: 0 0 1rem;
}

.courseshop-coupon-list {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.courseshop-coupon-card {
    border: 1px solid var(--cs-line);
    border-radius: 10px;
    background: var(--cs-card);
    overflow: hidden;
}

.courseshop-coupon-card.is-inactive {
    opacity: 0.65;
}

.courseshop-coupon-summary {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.9rem;
    padding: 0.85rem 1.1rem;
    cursor: pointer;
    list-style: none;
}

.courseshop-coupon-summary::-webkit-details-marker {
    display: none;
}

.courseshop-coupon-code {
    font-weight: 800;
    font-size: 0.92rem;
    color: var(--cs-navy);
    background: var(--cs-paper);
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
}

.courseshop-coupon-discount {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--cs-crimson-deep);
}

.courseshop-coupon-courses {
    font-size: 0.8rem;
    color: var(--cs-muted);
    flex: 1;
    min-width: 120px;
}

.courseshop-coupon-usage-count {
    font-size: 0.78rem;
    color: var(--cs-muted);
    white-space: nowrap;
}

.courseshop-coupon-status {
    font-size: 0.74rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: rgba(47, 107, 79, 0.12);
    color: var(--cs-green);
    white-space: nowrap;
}

.courseshop-coupon-status.is-off {
    background: rgba(107, 114, 128, 0.15);
    color: var(--cs-muted);
}

.courseshop-coupon-details {
    padding: 0 1.1rem 1.1rem;
    border-top: 1px dashed var(--cs-line);
}

.courseshop-coupon-meta {
    font-size: 0.8rem;
    color: var(--cs-muted);
    padding: 0.9rem 0 0.5rem;
}

.courseshop-coupon-usage-table {
    margin-bottom: 0.75rem;
}

.courseshop-coupon-actions {
    display: flex;
    gap: 1.2rem;
    margin-top: 0.5rem;
}

/* =======================================================================
   enrol_cart's OWN COUPON FORM (checkout.php)
   Not our markup - enrol_cart's own Moodle form, matched purely by its
   stable field name (coupon_code) via :has(), so this never depends on
   guessing enrol_cart's exact internal class names or template structure.
   Loaded only on /enrol/cart/ pages via the before_footer hook in lib.php.
   ======================================================================= */

/* =======================================================================
   enrol_cart's OWN CHECKOUT PAGE (checkout.php / view.php)
   Real class names confirmed from enrol_cart's own templates + styles.css
   (cart-checkout, cart-item*, cart-summary*, cart-gateway-item*). We don't
   touch enrol_cart's files - this only overrides its default look via CSS
   loaded through the before_footer hook in lib.php, scoped to its pages.

   enrol_cart's own default caps .cart-summary at 360px and auto-centers
   it, which sits oddly under the full-width item list above it. This
   redesign makes every section share one consistent width and card style
   instead.
   ======================================================================= */

.cart-checkout {
    font-family: var(--cs-font);
    max-width: 720px;
    margin: 0 auto;
}

/* ---- Course line items ---- */

.cart-items {
    margin-bottom: 1.25rem;
}

.cart-item {
    background: var(--cs-card);
    border: 1px solid var(--cs-line);
    border-radius: var(--cs-radius);
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.cart-item__grid {
    grid-template-columns: 96px 1fr !important;
    align-items: center;
}

.cart-item__image img {
    border-radius: 8px !important;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

.cart-item__title {
    font-family: var(--cs-font);
    font-size: 1rem !important;
    font-weight: 700 !important;
    line-height: 1.4 !important;
}

.cart-item__title a {
    color: var(--cs-ink) !important;
    text-decoration: none !important;
}

.cart-item__title a:hover {
    color: var(--cs-navy) !important;
    text-decoration: underline !important;
}

.cart-item__cost {
    margin-top: 0.6rem !important;
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
}

.cart-item__price {
    color: var(--cs-muted) !important;
    opacity: 1 !important;
    font-size: 0.82rem !important;
}

.cart-item__payable {
    color: var(--cs-navy) !important;
    font-size: 1rem !important;
}

.cart-item__discount-percent {
    background-color: var(--cs-crimson) !important;
    height: auto !important;
    border-radius: 999px !important;
    padding: 0.15rem 0.5rem !important;
    font-weight: 700;
}

.cart-item__actions .btn {
    background: transparent !important;
    border: 1px solid var(--cs-line) !important;
    color: var(--cs-muted) !important;
    border-radius: 7px !important;
}

.cart-item__actions .btn:hover {
    border-color: var(--cs-crimson) !important;
    color: var(--cs-crimson-deep) !important;
}

/* ---- Summary / coupon / gateways / payment - one consistent panel ---- */

.cart-summary,
.cart-summary-title {
    max-width: none !important;
    margin: 0 0 0.9rem !important;
}

.cart-summary {
    background: var(--cs-card) !important;
    border: 1px solid var(--cs-line);
    border-radius: var(--cs-radius);
    padding: 0.9rem 1.1rem;
    box-shadow: var(--cs-shadow);
}

.cart-summary-title {
    padding: 0 0.2rem !important;
}

.cart-summary-title h4 {
    font-family: var(--cs-font);
    font-size: 0.8rem !important;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--cs-navy) !important;
    text-transform: uppercase;
}

.cart-summary-title + .cart-summary {
    margin-top: 0.4rem !important;
}

.cart-summary__grid {
    padding: 0.15rem 0 !important;
}

.cart-summary__grid + .cart-summary__grid {
    border-top: 1px dashed var(--cs-line) !important;
    padding-top: 0.75rem !important;
    margin-top: 0.1rem;
}

.cart-summary__name {
    font-family: var(--cs-font);
    font-weight: 600 !important;
    color: var(--cs-ink);
}

.cart-summary__value {
    font-family: var(--cs-font);
    font-weight: 700 !important;
}

.cart-summary__discount {
    color: var(--cs-crimson-deep) !important;
}

.cart-summary__payable {
    color: var(--cs-green) !important;
}

/* Coupon form: no extra box of its own - .cart-summary above already
   provides the card, so this just styles the input/buttons inside it. */

.cart-summary--coupon-form form {
    width: 100% !important;
    display: grid !important;
}

.cart-summary--coupon-form input[name="coupon_code"] {
    width: 100% !important;
    box-sizing: border-box;
    border: 1px solid var(--cs-line) !important;
    border-radius: 8px !important;
    padding: 0.6rem 0.8rem !important;
    font-family: var(--cs-font);
    font-size: 0.88rem;
    background: #ffffff !important;
    color: var(--cs-ink);
}

.cart-summary--coupon-form input[name="coupon_code"]::placeholder {
    color: var(--cs-muted);
}

.cart-summary--coupon-form input[name="coupon_code"]:focus {
    outline: none;
    border-color: var(--cs-brass) !important;
    box-shadow: 0 0 0 3px rgba(200, 151, 62, 0.22);
}

.cart-summary--coupon-form input[type="submit"] {
    border: none !important;
    border-radius: 8px !important;
    font-family: var(--cs-font);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.cart-summary--coupon-form input[name="submitbutton"] {
    background: var(--cs-brass) !important;
    color: #221705 !important;
}

.cart-summary--coupon-form input[name="submitbutton"]:hover {
    background: var(--cs-brass-deep) !important;
}

.cart-summary--coupon-form .btn-cancel input,
.cart-summary--coupon-form input[name="cancel"] {
    background: transparent !important;
    color: var(--cs-muted) !important;
    text-decoration: underline;
    font-family: var(--cs-font);
    font-size: 0.82rem;
}

.cart-summary--coupon-form .btn-cancel input:hover,
.cart-summary--coupon-form input[name="cancel"]:hover {
    color: var(--cs-crimson-deep) !important;
}

.cart-summary--coupon-form__error.invalid-feedback {
    color: var(--cs-crimson-deep);
    font-size: 0.8rem;
    margin-top: 0.5rem;
}

/* ---- Payment gateway picker ---- */

.cart-summary--gateways {
    padding: 0.25rem !important;
}

.cart-gateway-item + .cart-gateway-item {
    border-top: 1px dashed var(--cs-line) !important;
}

.cart-gateway-item__label {
    border-radius: 8px;
    font-family: var(--cs-font);
    color: var(--cs-ink);
}

.cart-gateway-item__label:hover {
    background: var(--cs-paper) !important;
}

.cart-gateway-item__title {
    font-weight: 600;
}

/* ---- Pay button ---- */

.cart-summary--payment .btn.btn-primary {
    background: var(--cs-navy) !important;
    border-color: var(--cs-navy) !important;
    font-family: var(--cs-font);
    font-weight: 700;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    transition: background-color 0.15s ease;
}

.cart-summary--payment .btn.btn-primary:hover {
    background: var(--cs-navy-deep) !important;
    border-color: var(--cs-navy-deep) !important;
}
