/* Frontend page header + mega menu styles with responsive breakpoints */

/* Local tokens (non-color values) */
:root {
    --radius: 28px;
    --radius-sm: 14px;
    --header-h: 64px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    height: 100%;
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

/* Layout container */
.container {
    width: 100%;
    max-width: 1340px;
    margin: 0 auto;
    padding: 0 24px;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font: inherit;
}

/* Header */
.header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--header-bg);
    box-shadow: var(--header-shadow);
    padding: 16px 10px;
}

.bar {
    width: 100%;
    margin: 0;
    height: var(--header-h);
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 14px;
    align-items: center;
    padding: 0 16px;
}

.left,
.right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    color: var(--text-primary);
}

.brand svg {
    width: 24px;
    height: 24px;
}

/* Explore pill */
.explore-btn {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    border: none;
    border-radius: 999px;
    padding: 8px 14px;
    background: var(--bg-primary);
    cursor: pointer;
}

.explore-btn:hover {
    background: var(--surface-hover);
}

.explore-btn[aria-expanded="true"] {
    background: var(--surface-hover);
}

/* Search input affixes (field visuals are in course-search.css for panel; field itself here) */
.search {
    position: relative;
}

.search input {
    width: 100%;
    height: 52px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 0 60px 0 52px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 16px;
}

.search input::placeholder {
    font-size: 16px;
    color: var(--text-muted);
}

.search input:focus {
    outline: none;
    box-shadow: var(--ring);
}

.search .icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    opacity: .6;
    width: 22px;
    height: 22px;
}

.search .kbd {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 5px 10px;
    line-height: 1;
}

/* Right links */
.navlink {
    padding: 8px 16px;
    border-radius: 8px;
    color: var(--text-primary);
    font-weight: 500;
    cursor: pointer;
    background: transparent;
    border: none;
}

/* Card overlays used in degree track/course cards */
.track-overlay {
    background: var(--hero-overlay);
}

/* Utility shapes */
.btn-circle-lg {
    width: 50px;
    height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.dt-avatar-more {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--surface);
    border: 2px solid var(--bg-primary);
    margin-left: -10px;
    font-size: .8rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
}

.navlink:hover {
    background: var(--surface-hover);
}

.navlink.auth-signup-btn {
    background: var(--brand-gradient);
    color: var(--text-inverse);
    font-weight: 600;
}

/* --- Course Player: minimal integration layer (scoped) --- */
.player-body a {
    color: inherit;
    text-decoration: none;
}

.player-body .divider {
    width: 1px;
    height: 22px;
    background: currentColor;
    opacity: .2;
}

.player-body button:focus-visible,
.player-body a:focus-visible {
    outline: 2px solid #a78bfa;
    outline-offset: 2px;
}

.player-body .muted {
    color: var(--text-muted, #8b91a5);
}

.player-body .container {
    max-width: 1600px;
}

.navlink.auth-signup-btn:hover {
    opacity: 0.9;
    background: var(--brand-gradient);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(var(--brand-rgb), 0.3);
}

.icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    display: grid;
    place-items: center;
    background: var(--bg-primary);
}

.icon-btn:hover {
    background: var(--surface-hover);
}

/* Header specifics */
.brand-logo {
    height: 24px;
    width: auto;
    max-width: 300px;
    object-fit: contain;
}

.wishlist-icon-wrapper {
    position: relative;
}

/* Mobile drawer header */
.sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.sheet-title {
    font-size: 18px;
}

.avatar {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: var(--brand-gradient);
    color: var(--text-inverse);
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.avatar:hover {
    border-color: var(--brand);
    box-shadow: 0 4px 12px rgba(var(--brand-rgb), 0.3);
}

/* User Dropdown */
.user-dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 280px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.95);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    z-index: 100;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.dropdown-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.dropdown-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: var(--brand-gradient);
    color: var(--text-inverse);
    display: grid;
    place-items: center;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

.dropdown-user-info {
    flex: 1;
    min-width: 0;
}

.dropdown-user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-user-email {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
}

.dropdown-item:first-of-type {
    margin-top: 4px;
}

.dropdown-item:last-of-type {
    margin-bottom: 4px;
}

.dropdown-item svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.dropdown-item:hover {
    background: var(--surface-hover);
    color: var(--brand);
}

.dropdown-item:hover svg {
    opacity: 1;
}

.dropdown-item-danger {
    color: var(--error);
}

.dropdown-item-danger:hover {
    background: var(--surface-hover);
    color: var(--error);
}

#logoutForm {
    margin: 0;
    padding: 0;
}

/* Mega menu with smooth transitions */
.mega {
    position: absolute;
    inset: calc(100% + 8px) auto auto 0;
    transform: translateY(-6px) scale(0.98);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    will-change: transform, opacity;
    transition: transform .22s cubic-bezier(.2, 0, .2, 1), opacity .22s ease, visibility 0s linear .22s;
}

.mega.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    visibility: visible;
    pointer-events: auto;
    transition: transform .24s cubic-bezier(.2, 0, .2, 1), opacity .24s ease;
}

.mega-container {
    display: flex;
    gap: 0;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    max-height: calc(100vh - var(--header-h) - 40px);
}

.category-panel {
    background: var(--bg-tertiary);
    width: 280px;
    flex: 0 0 280px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    transition: width .28s cubic-bezier(.2, 0, .2, 1),
        opacity .22s ease,
        transform .28s cubic-bezier(.2, 0, .2, 1);
    will-change: width, opacity, transform;
    overflow: hidden;
    opacity: 1;
    transform: translateX(0);
}

.category-panel:last-child {
    border-right: none;
}

.category-panel.hidden {
    width: 0 !important;
    flex-basis: 0 !important;
    opacity: 0;
    transform: translateX(-12px);
    pointer-events: none;
    border-right: none;
}

.category-panel.hidden .panel-header,
.category-panel.hidden .panel-content {
    opacity: 0;
    transition-delay: 0s;
}

.panel-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
    opacity: 1;
    transition: opacity .2s ease .08s;
}

.panel-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-muted);
    flex: 1;
}

.panel-content {
    padding: 12px;
    overflow-y: auto;
    flex: 1;
    opacity: 1;
    transition: opacity .2s ease .08s;
}

.panel-content::-webkit-scrollbar {
    width: 6px;
}

.panel-content::-webkit-scrollbar-track {
    background: transparent;
}

.panel-content::-webkit-scrollbar-thumb {
    background: var(--border-color-hover);
    border-radius: 3px;
}

.panel-content::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: all .15s ease;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--bg-primary);
    border: 1px solid transparent;
}


.nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    opacity: .7;
}

.nav-item:hover .nav-icon,
.nav-item.active .nav-icon {
    opacity: 1;
}

.nav-label {
    flex: 1;
}

.nav-arrow {
    margin-left: auto;
    opacity: .4;
    transition: all .15s;
    flex-shrink: 0;
}

.nav-item:hover .nav-arrow,
.nav-item.active .nav-arrow {
    opacity: 1;
    transform: translateX(2px);
}

.nav-item.no-children {
    cursor: default;
}

.nav-item.no-children:hover {
    transform: none;
    border-color: transparent;
}

.nav-item.no-children .nav-arrow {
    display: none;
}

/* Mobile navigation */
.hamburger {
    display: none;
}

.drawer {
    position: fixed;
    inset: 0 0 0 0;
    background: var(--overlay-bg);
    display: none;
}

.drawer.open {
    display: block;
}

.sheet {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: min(90vw, 400px);
    background: var(--bg-primary);
    box-shadow: var(--shadow-lg);
    padding: 16px;
    overflow: auto;
}

/* Generic section utilities */
.section-padding {
    padding: 32px 0;
}

.section-padding-top {
    padding-top: 32px;
}

.section-heading {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 16px 0;
    color: var(--text-primary);
}

/* Curriculum section generic tweaks */
.course-content-section {
    padding: 24px;
    margin-top: 24px;
}

.section-title {
    margin: 0 0 8px 0;
}


/* ===========================
   Hero Slider (Udemy-style)
   =========================== */
.hero-slider {
    position: relative;
    width: 100%;
    margin: 0;
}

.hero-slider .splide {
    border-radius: 0;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    background: var(--bg-primary);
}

.hero-slide {
    position: relative;
    height: clamp(400px, 50vw, 700px);
    color: var(--slider-text);
}

.hero-slide .hero-media {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 1;
}

.hero-slide .hero-overlay {
    position: absolute;
    inset: 0;
    background: var(--hero-overlay);
}

.hero-slide .hero-content {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 12px;
    padding: clamp(16px, 4vw, 32px) clamp(16px, 6vw, 80px) clamp(64px, 10vw, 120px) clamp(85px, 12vw, 165px);
    max-width: min(1100px, 92%);
    text-align: left;
}

.hero-title {
    font-size: clamp(26px, 4.32vw, 50px);
    line-height: 1.1;
    letter-spacing: -.02em;
    font-weight: 800;
    margin: 0;
    min-height: 55px;
}

.hero-desc {
    font-size: clamp(14px, 1.4vw, 18px);
    line-height: 1.45;
    opacity: .95;
    margin: 6px 0 0 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    margin-top: 14px;
    background: transparent;
    color: var(--text-inverse);
    border: 2px solid var(--brand);
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .2);
    transition: all .2s ease;
}

.hero-cta:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-inverse);
    border-color: var(--border-color-focus);
}

/* Splide nav styling to match theme */
.splide__arrows .splide__arrow {
    background: var(--slider-arrow-bg);
    color: var(--slider-arrow-color);
    border: 1px solid transparent;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    box-shadow: var(--shadow-md);
    opacity: 0.95;
}

.splide__arrows .splide__arrow:hover {
    background: var(--slider-arrow-hover-bg);
    opacity: 1;
}

.hero-slider .splide__arrow {
    opacity: 0;
    transform: scale(0.96);
    transition: opacity .2s ease, transform .2s ease, background-color .2s ease;
}

.hero-slider:hover .splide__arrow {
    opacity: 1;
    transform: scale(1);
}

@media (hover: none) {
    .hero-slider .splide__arrow {
        opacity: 1;
    }
}

.splide__arrow--prev {
    left: 14px;
}

.splide__arrow--next {
    right: 14px;
}

.splide__pagination {
    bottom: 12px;
}

.splide__pagination__page {
    background: var(--slider-pagination);
}

.splide__pagination__page.is-active {
    background: var(--slider-pagination-active);
    transform: scale(1.08);
}

.hero-slider .splide__pagination {
    gap: 8px;
}

.hero-slider .splide__pagination__page {
    width: 18px;
    height: 6px;
    border-radius: 999px;
    background: var(--slider-pagination);
    transform: none;
    opacity: 1;
}

.hero-slider .splide__pagination__page.is-active {
    width: 28px;
    background: var(--slider-pagination-active);
    box-shadow: 0 2px 6px rgba(0, 0, 0, .12);
    transform: none;
}

/* Progress bar + Pause/Play */
.hero-controls {
    position: absolute;
    inset: auto 0 0 0;
    z-index: 3;
    pointer-events: none;
}

.hero-progress {
    height: 3px;
    width: 100%;
    background: var(--slider-pagination);
    opacity: 0.4;
}

.hero-progress>span {
    display: block;
    height: 100%;
    width: 0%;
    background: var(--slider-pagination-active);
    transition: width .2s linear;
}

.hero-pause {
    position: absolute;
    right: 10px;
    bottom: 10px;
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--slider-control-border);
    background: var(--slider-control-bg);
    color: var(--slider-text);
    font-size: 12px;
}

/* Improve text legibility on media */
.hero-slide .hero-title,
.hero-slide .hero-desc {
    text-shadow: var(--slider-text-shadow);
    color: var(--slider-text);
}

/* Fast, smooth fade transitions */
.hero-slider .splide.splide--fade .splide__slide {
    transition: opacity 400ms ease-in-out !important;
}

/* Remove lazy opacity dependency: always visible */

@media (max-width: 768px) {
    .hero-slide {
        height: clamp(300px, 60vw, 480px);
    }

    .hero-slide .hero-content {
        padding: 16px 18px;
        max-width: 94%;
        align-items: center;
        text-align: center;
    }

    .hero-cta {
        align-self: center;
    }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .hero-progress>span {
        transition: none !important;
    }
}


/* Responsive breakpoints */
@media (max-width: 1280px) {
    .bar {
        padding: 0 12px;
    }
}

@media (max-width: 1024px) {
    .bar {
        gap: 10px;
    }

    .search input {
        height: 40px;
    }
}

@media (max-width: 768px) {
    :root {
        --header-h: 56px;
    }

    .explore-btn {
        display: none;
    }

    .hamburger {
        display: inline-grid;
    }

    .navlink {
        display: none;
    }

    /* hide text link like My learning on small */
    .avatar {
        width: 30px;
        height: 30px;
        font-size: 11px;
    }

    .mega {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .bar {
        padding: 0 10px;
    }

    .brand span {
        display: none;
    }

    /* save space */
    .search input {
        padding-left: 40px;
        padding-right: 40px;
    }
}

@media (prefers-reduced-motion: reduce) {

    .mega,
    .mega.open,
    .nav-item {
        transition: none !important;
    }
}

/* Client Logo Strip - Classic Simple View */
.client-logo-strip {
    width: 100%;
    flex: 0 0 auto;
    padding: 40px 0;
    overflow: hidden;
    background: var(--bg-tertiary);
}

.logo-strip-container {
    position: relative;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 clamp(16px, 3vw, 32px);
}

.logo-strip-scroll {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(32px, 5vw, 64px);
    flex-wrap: wrap;
}

.logo-item {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 60px;
}

.logo-item img {
    max-width: 140px;
    max-height: 60px;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: opacity .2s ease;
}

.logo-item:hover img {
    opacity: 1;
}

@media (max-width: 768px) {
    .client-logo-strip {
        padding: 30px 0;
    }

    .logo-strip-scroll {
        gap: clamp(20px, 4vw, 40px);
    }

    .logo-item {
        height: 50px;
    }

    .logo-item img {
        max-width: 100px;
        max-height: 50px;
    }
}

/* ===========================
   Featured Degree Tracks Section
   =========================== */
.degree-tracks-section {
    width: 100%;
    padding: 96px 0 104px;
    background: var(--bg-secondary);
    position: relative;
}

.degree-tracks-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color) 50%, transparent);
}

.degree-tracks-container {
    width: 100%;
    max-width: 1340px;
    margin: 0 auto;
    padding: 0 32px;
}

.degree-tracks-section .section-header {
    text-align: center;
    margin-bottom: 56px;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

.degree-tracks-section .section-title {
    font-size: clamp(32px, 4vw, 42px);
    font-weight: 700;
    letter-spacing: -0.04em;
    color: var(--text-primary);
    margin: 0 0 14px;
    line-height: 1.15;
}

.degree-tracks-section .section-subtitle {
    font-size: 17px;
    line-height: 1.6;
    letter-spacing: -0.01em;
    color: var(--text-muted);
    margin: 0;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}

.degree-tracks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 32px;
}

.degree-tracks-slider .splide__arrow {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    color: var(--text-primary);
    opacity: 0;
    transition: opacity 0.3s ease, background 0.2s ease;
    box-shadow: var(--shadow-md);
}

.degree-tracks-slider:hover .splide__arrow {
    opacity: 1;
}

.degree-tracks-slider .splide__arrow:hover {
    background: var(--surface-hover);
    border-color: var(--border-color-hover);
}

.degree-tracks-slider .splide__arrow--prev {
    left: -60px;
}

.degree-tracks-slider .splide__arrow--next {
    right: -60px;
}

.degree-track-card {
    position: relative;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    overflow: hidden;
    height: 480px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.3s ease;
}

.degree-track-card:hover {
    box-shadow: var(--shadow-lg);
}

.track-hero-media {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.track-media {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.degree-track-card:hover .track-media {
    transform: scale(1.03);
}

.track-placeholder {
    background: var(--brand-gradient-135);
    display: flex;
    align-items: center;
    justify-content: center;
}

.track-placeholder-content {
    color: var(--text-inverse);
    opacity: 0.75;
}

.track-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom,
            rgba(0, 0, 0, 0) 0%,
            rgba(0, 0, 0, 0.35) 45%,
            rgba(0, 0, 0, 0.88) 100%);
    transition: background 0.4s ease;
}

.degree-track-card:hover .track-overlay {
    background: linear-gradient(to bottom,
            rgba(0, 0, 0, 0) 0%,
            rgba(0, 0, 0, 0.4) 45%,
            rgba(0, 0, 0, 0.92) 100%);
}

.track-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    background: linear-gradient(to top,
            rgba(0, 0, 0, 0.88) 0%,
            rgba(0, 0, 0, 0.72) 60%,
            rgba(0, 0, 0, 0.4) 100%);
}

.track-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 4px;
}

.track-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 24px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: #1f2328;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.08);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .track-badge {
        background: rgba(255, 255, 255, 0.92);
        color: #1f2328;
        box-shadow: 0 2px 14px rgba(0, 0, 0, 0.25), 0 1px 4px rgba(0, 0, 0, 0.15);
    }
}

[data-theme="dark"] .track-badge {
    background: rgba(255, 255, 255, 0.92);
    color: #1f2328;
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.25), 0 1px 4px rgba(0, 0, 0, 0.15);
}

.track-badge svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.track-title {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: #ffffff;
    margin: 0;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.track-description {
    font-size: 14px;
    line-height: 1.65;
    letter-spacing: -0.006em;
    color: rgba(255, 255, 255, 0.92);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.track-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    gap: 16px;
}

.instructor-avatars {
    display: flex;
    align-items: center;
}

.instructor-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2.5px solid rgba(255, 255, 255, 0.95);
    overflow: hidden;
    background: var(--brand-gradient);
    color: var(--text-inverse);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
    position: relative;
    margin-left: -10px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s ease;
}

.instructor-avatar:first-child {
    margin-left: 0;
}

.instructor-avatar:hover {
    transform: translateY(-2px);
    z-index: 10;
}

.instructor-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.instructor-avatar.instructor-more {
    background: rgba(255, 255, 255, 0.94);
    color: #1f2328;
    font-size: 11px;
    font-weight: 700;
    border: 2.5px solid rgba(255, 255, 255, 0.95);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .instructor-avatar.instructor-more {
        background: rgba(255, 255, 255, 0.92);
        color: #1f2328;
    }
}

[data-theme="dark"] .instructor-avatar.instructor-more {
    background: rgba(255, 255, 255, 0.92);
    color: #1f2328;
}

.track-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    background: #ffffff;
    color: #1f2328;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.01em;
    text-decoration: none;
    white-space: nowrap;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    box-shadow: 0 4px 16px rgba(255, 255, 255, 0.18), 0 2px 4px rgba(0, 0, 0, 0.12);
}

.track-cta-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.24), 0 3px 6px rgba(0, 0, 0, 0.14);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .track-cta-btn {
        background: #ffffff;
        color: #0d1117;
        box-shadow: 0 4px 18px rgba(255, 255, 255, 0.25), 0 2px 6px rgba(0, 0, 0, 0.4);
    }

    :root:not([data-theme="light"]) .track-cta-btn:hover {
        background: #ffffff;
        box-shadow: 0 6px 22px rgba(255, 255, 255, 0.35), 0 3px 8px rgba(0, 0, 0, 0.45);
    }
}

[data-theme="dark"] .track-cta-btn {
    background: #ffffff;
    color: #0d1117;
    box-shadow: 0 4px 18px rgba(255, 255, 255, 0.25), 0 2px 6px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .track-cta-btn:hover {
    background: #ffffff;
    box-shadow: 0 6px 22px rgba(255, 255, 255, 0.35), 0 3px 8px rgba(0, 0, 0, 0.45);
}

.track-cta-btn svg {
    flex-shrink: 0;
    margin-left: 2px;
}

@media (max-width: 1280px) {
    .degree-tracks-slider .splide__arrow--prev {
        left: -44px;
    }

    .degree-tracks-slider .splide__arrow--next {
        right: -44px;
    }
}

@media (max-width: 1024px) {
    .degree-tracks-slider .splide__arrow--prev {
        left: 0;
    }

    .degree-tracks-slider .splide__arrow--next {
        right: 0;
    }

    .degree-track-card {
        height: 440px;
    }
}

@media (max-width: 768px) {
    .degree-tracks-section {
        padding: 72px 0 80px;
    }

    .degree-tracks-container {
        padding: 0 20px;
    }

    .degree-tracks-section .section-header {
        margin-bottom: 40px;
    }

    .degree-tracks-section .section-title {
        font-size: 32px;
        margin-bottom: 12px;
    }

    .degree-tracks-section .section-subtitle {
        font-size: 16px;
    }

    .degree-tracks-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .degree-track-card {
        height: 420px;
    }

    .track-content {
        gap: 14px;
    }

    .track-title {
        font-size: 22px;
    }

    .track-description {
        font-size: 13px;
    }

    .track-badge {
        font-size: 11px;
        padding: 6px 12px;
    }

    .instructor-avatar {
        width: 34px;
        height: 34px;
        font-size: 12px;
    }

    .track-cta-btn {
        padding: 10px 18px;
        font-size: 13px;
    }
}

/* ===========================
   Explore Courses Section
   =========================== */
.explore-courses-section {
    width: 100%;
    padding: 80px 0;
    background: var(--bg-primary);
}

.explore-courses-container {
    width: 100%;
    max-width: 1340px;
    margin: 0 auto;
    padding: 0 24px;
}

.explore-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.explore-title {
    font-size: clamp(28px, 3.2vw, 36px);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.2;
}

.explore-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 6px;
}

.explore-tab {
    padding: 8px 14px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.explore-tab:hover {
    background: var(--bg-primary);
}

.explore-tab.active {
    background: var(--bg-primary);
    color: var(--text-primary);
    border-color: var(--border-color-focus);
}

.explore-content {
    position: relative;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.no-courses {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    font-size: 16px;
}

.courses-slider .splide__arrow {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.courses-slider .splide__arrow:hover {
    background: var(--surface-hover);
    border-color: var(--border-color-focus);
}

.courses-slider .splide__arrow--prev {
    left: -50px;
}

.courses-slider .splide__arrow--next {
    right: -50px;
}

.course-instructor {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
}

.course-meta {
    margin-top: 4px;
}

.course-rating {
    display: flex;
    align-items: center;
    gap: 6px;
}

.rating-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.rating-stars {
    display: flex;
    gap: 2px;
    align-items: center;
}

.rating-stars .star {
    color: #d1d5db;
    flex-shrink: 0;
}

.rating-stars .star.filled,
.rating-stars .star.half {
    color: #fbbf24;
}

.rating-count {
    font-size: 12px;
    color: var(--text-muted);
}

.course-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.course-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.course-category {
    font-size: 11px;
    color: var(--text-muted);
    padding: 4px 8px;
    background: var(--surface);
    border-radius: 6px;
}

@media (max-width: 1280px) {
    .courses-slider .splide__arrow--prev {
        left: -40px;
    }

    .courses-slider .splide__arrow--next {
        right: -40px;
    }
}

@media (max-width: 1024px) {
    .courses-slider .splide__arrow--prev {
        left: 0;
    }

    .courses-slider .splide__arrow--next {
        right: 0;
    }
}

@media (max-width: 768px) {
    .explore-courses-section {
        padding: 60px 0;
    }

    .explore-courses-container {
        padding: 0 16px;
    }

    .explore-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .explore-title {
        font-size: 28px;
    }

    .explore-tabs {
        width: 100%;
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .explore-tabs::-webkit-scrollbar {
        display: none;
    }

    .explore-tab {
        padding: 8px 16px;
        font-size: 13px;
    }

    .course-title {
        font-size: 15px;
    }

    .course-instructor {
        font-size: 12px;
    }

    .course-price {
        font-size: 15px;
    }
}

/* ===========================
   Testimonials Section
   =========================== */
.testimonials-section {
    width: 100%;
    padding: 80px 0;
    background: var(--bg-tertiary);
}

.testimonials-container {
    width: 100%;
    max-width: 1340px;
    margin: 0 auto;
    padding: 0 24px;
}

.section-header {
    text-align: center;
    margin-bottom: 48px;
}

.section-title {
    font-size: clamp(28px, 3.5vw, 40px);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin: 0 0 12px 0;
    line-height: 1.2;
}

.section-subtitle {
    font-size: 16px;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.6;
}

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin: 0;
}

.testimonial-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--border-color-focus);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.testimonial-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.rating-stars {
    display: flex;
    gap: 4px;
    align-items: center;
}

.rating-stars .star {
    color: #d1d5db;
    flex-shrink: 0;
}

.rating-stars .star.filled {
    color: #fbbf24;
}

.testimonial-message {
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-primary);
    margin: 0;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.author-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.author-avatar-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--brand-gradient);
    color: var(--text-inverse);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    flex-shrink: 0;
}

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

.author-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 4px 0;
}

.author-title {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.4;
}

@media (max-width: 768px) {
    .testimonials-section {
        padding: 60px 0;
    }

    .testimonials-container {
        padding: 0 16px;
    }

    .section-header {
        margin-bottom: 32px;
    }

    .section-title {
        font-size: 28px;
    }

    .section-subtitle {
        font-size: 15px;
    }

    .testimonials-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .testimonial-card {
        padding: 20px;
    }

    .author-avatar,
    .author-avatar-placeholder {
        width: 44px;
        height: 44px;
        font-size: 16px;
    }

    .author-name {
        font-size: 14px;
    }

    .author-title {
        font-size: 12px;
    }
}

.cart-icon-wrapper {
    position: relative;
}

/* Wishlist Badge in Header */
.count-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
    z-index: 1;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.count-badge.pulse {
    animation: badgePulse 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes badgePulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }
}

/* Auth Modal Styles */
.auth-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    background-color: var(--modal-backdrop);
    display: grid;
    place-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.auth-modal.is-open {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    position: relative;
    display: flex;
    width: 100%;
    max-width: 800px;
    background-color: var(--bg-primary);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.auth-modal.is-open .modal-container {
    transform: scale(1);
}

.modal-image-side {
    flex: 1 1 50%;
    background-image: url('https://images.unsplash.com/photo-1519389950473-47ba0277781c?q=80&w=1200&auto=format&fit=crop');
    background-size: cover;
    background-position: center;
    display: block;
}

.modal-form-side {
    flex: 1 1 50%;
    padding: 40px;
    display: flex;
    flex-direction: column;
    position: relative;
}

.modal-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    border: none;
    background: transparent;
    padding: 8px;
    line-height: 0;
    border-radius: 99px;
    cursor: pointer;
    z-index: 10;
}

.modal-close-btn:hover {
    background-color: var(--surface);
}

.auth-form {
    width: 100%;
}

.auth-form h2 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--text-primary);
}

.auth-form p {
    margin: 0 0 24px;
    color: var(--text-muted);
    font-size: 15px;
}

.form-group {
    margin-bottom: 16px;
    position: relative;
}

.form-control {
    width: 100%;
    height: 48px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0 16px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 16px;
}

.form-control:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: var(--ring);
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 0;
}

.password-toggle:hover {
    color: var(--text-primary);
}

.password-toggle svg {
    width: 20px;
    height: 20px;
}

.form-control[type="password"]+.password-toggle .eye-open {
    display: block;
}

.form-control[type="password"]+.password-toggle .eye-closed {
    display: none;
}

.form-control[type="text"]+.password-toggle .eye-open {
    display: none;
}

.form-control[type="text"]+.password-toggle .eye-closed {
    display: block;
}

.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 48px;
    border-radius: 8px;
    border: 1px solid transparent;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-primary {
    background: var(--brand-gradient);
    color: var(--text-inverse);
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(var(--brand-rgb), 0.3);
}

.btn-google {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    border-color: var(--border-color);
    gap: 12px;
}

.btn-google:hover {
    background-color: var(--surface-hover);
}

/* Secondary, Outline, Danger buttons (site-wide defaults) */
.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background: var(--surface-hover);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-outline:hover {
    background: var(--surface);
}

.btn-danger {
    background: var(--error);
    color: #fff;
}

.btn-danger:hover {
    background: #dc2626;
}

.separator {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--text-muted);
    margin: 20px 0;
    font-size: 13px;
    font-weight: 500;
}

.separator::before,
.separator::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.separator:not(:empty)::before {
    margin-right: .5em;
}

.separator:not(:empty)::after {
    margin-left: .5em;
}

.form-footer-link {
    text-align: center;
    margin: 16px 0 !important;
    font-size: 15px;
    color: var(--text-muted);
}

.form-footer-link a {
    color: var(--brand);
    font-weight: 600;
    cursor: pointer;
}

.form-footer-link a:hover {
    text-decoration: underline;
}

.forgot-password-link {
    display: block;
    text-align: right;
    font-size: 14px;
    color: var(--brand);
    font-weight: 500;
    margin: -8px 0 16px;
}

.forgot-password-link:hover {
    text-decoration: underline;
}

.hidden {
    display: none;
}

@media (max-width: 768px) {
    .modal-image-side {
        display: none;
    }

    .modal-container {
        max-width: 400px;
        width: 90%;
    }

    .modal-form-side {
        padding: 32px;
    }
}

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

/* ================================================
                                               2. ORIGINAL CART-SPECIFIC STYLES (RE-APPLIED)
                                               ================================================ */
:root {
    /* Structural variables from original design */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --space-7: 48px;
    --space-8: 64px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 999px;
}

.cart-page {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
}

.cart-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: var(--space-8) var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

.cart-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(340px, 1fr);
    gap: var(--space-7);
    align-items: flex-start;
}

.cart-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

/* Breadcrumb */
.cart-breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 14px;
    color: var(--text-muted);
}

.cart-breadcrumb a {
    color: var(--text-muted);
    font-weight: 500;
    text-decoration: none;
}

.cart-breadcrumb a:hover {
    color: var(--brand);
}

.cart-breadcrumb-separator {
    color: var(--border-color-hover);
}

/* Header */
.cart-header {
    display: flex;
    gap: var(--space-5);
    align-items: center;
    padding: var(--space-6);
    border-radius: var(--radius-xl);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

.cart-header-icon {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    display: grid;
    place-items: center;
    background: rgba(var(--brand-rgb), 0.1);
    color: var(--brand);
}

.cart-header-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.cart-header-title {
    margin: 0;
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.cart-header-subheadline {
    margin: 0;
    font-size: 16px;
    color: var(--text-muted);
}

.cart-header-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    margin-top: var(--space-2);
}

.cart-chip {
    display: inline-flex;
    align-items: center;
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-full);
    background: rgba(var(--brand-rgb), 0.1);
    color: var(--brand);
    font-size: 13px;
    font-weight: 500;
}

/* Main Content Panel */
.cart-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

.cart-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: var(--space-4);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--border-color);
}

.cart-panel-title {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
}

.cart-panel-subtitle {
    margin: 0;
    font-size: 14px;
    color: var(--text-muted);
}

/* Alert Banner */
.cart-alert {
    display: none;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4);
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    border: 1px solid rgba(var(--brand-rgb), 0.2);
    font-size: 14px;
    color: var(--text-muted);
}

.cart-alert.show {
    display: flex;
}

.cart-alert a {
    color: var(--brand);
    font-weight: 600;
    text-decoration: none;
}

.cart-alert svg {
    flex-shrink: 0;
    color: var(--brand);
}

/* Cart Item List & Item */
.cart-collection {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.cart-item {
    display: grid;
    grid-template-columns: 140px 1fr auto;
    align-items: center;
    gap: var(--space-5);
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
    transition: opacity 0.25s ease, transform 0.25s ease, max-height 0.25s ease, padding 0.25s ease, margin 0.25s ease, border-color 0.25s ease;
}

.cart-item:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
}

.cart-item.is-removing {
    opacity: 0;
    transform: translateX(10px);
    max-height: 0;
    margin: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-color: transparent;
}

.cart-item img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border-radius: var(--radius-md);
}

[data-theme="dark"] .cart-item img {
    opacity: 0.92;
}

.cart-item-body {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.cart-item-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
}

.cart-item-title:hover {
    color: var(--brand);
}

.cart-item-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3);
    font-size: 13px;
    color: var(--text-muted);
}

.cart-item-meta .save-for-later {
    text-decoration: none;
    color: var(--brand);
    font-weight: 600;
    cursor: pointer;
}

.cart-item-meta .save-for-later:hover {
    text-decoration: underline;
}

.cart-rating {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    font-weight: 500;
    color: var(--brand);
}

.cart-rating span {
    color: var(--text-muted);
}

.cart-item-aside {
    display: flex;
    align-items: center;
    gap: var(--space-5);
    padding-right: var(--space-2);
}

.cart-price {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.cart-remove-btn {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    cursor: pointer;
    opacity: 0.5;
}

.cart-item:hover .cart-remove-btn {
    opacity: 1;
}

.cart-remove-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
    color: var(--error);
}

.cart-remove-btn:disabled {
    cursor: not-allowed;
}

/* Empty Cart State */
.cart-empty {
    text-align: center;
    padding: var(--space-8) var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    align-items: center;
    border-radius: var(--radius-lg);
    background-color: var(--bg-secondary);
}

.cart-empty-icon {
    color: var(--brand);
    opacity: 0.5;
}

.cart-empty h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.cart-empty p {
    margin: 0;
    color: var(--text-muted);
    max-width: 420px;
    font-size: 15px;
    line-height: 1.6;
}

.cart-empty a {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-full);
    background: var(--brand-gradient);
    color: var(--text-inverse);
    font-weight: 600;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
}

.cart-empty a:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Order Summary (Aside) */
.cart-summary {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    position: sticky;
    top: 96px;
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

.cart-summary h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
}

.cart-summary-subtext {
    margin: 0 0 var(--space-3);
    font-size: 14px;
    color: var(--text-muted);
}

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 15px;
    color: var(--text-muted);
}

.cart-summary-divider {
    height: 1px;
    width: 100%;
    background: var(--border-color);
    margin: var(--space-2) 0;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-weight: 500;
    color: var(--text-primary);
}

.cart-total span:last-child {
    font-size: 28px;
    font-weight: 700;
}

/* Action Buttons */
.cart-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.cart-checkout-btn,
.cart-secondary-btn {
    width: 100%;
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
}

.cart-checkout-btn {
    background: var(--brand-gradient);
    color: var(--text-inverse);
    box-shadow: var(--shadow-sm);
}

.cart-checkout-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.cart-secondary-btn {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.cart-secondary-btn:hover {
    border-color: var(--border-color-hover);
    background: var(--bg-tertiary);
}

.cart-checkout-btn:disabled,
.cart-secondary-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* Perks List */
.cart-perks {
    list-style: none;
    padding: var(--space-4) 0 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    font-size: 13px;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
}

.cart-perks li {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.cart-perks svg {
    width: 16px;
    height: 16px;
    color: var(--brand);
}

/* Wishlist section styles */
.wishlist-panel-hint {
    margin: -4px 0 0 0;
    color: var(--text-muted);
    font-size: 14px;
}

.promo-hint {
    color: var(--brand);
    font-size: 12px;
    font-weight: 600;
}

/* Tabs below cart: Save for Later + Related Degree Tracks */
.cart-tabs {
    margin-top: var(--space-5);
}

.cart-tabs-nav {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: var(--space-4);
}

.cart-tabs-nav button {
    appearance: none;
    background: transparent;
    border: 1px solid transparent;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-weight: 600;
    padding: 10px 14px;
    cursor: pointer;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.cart-tabs-nav button[aria-selected="true"],
.cart-tabs-nav button.active {
    color: var(--text-primary);
    border-color: var(--border-color);
    border-bottom-color: var(--bg-secondary);
    background: var(--bg-secondary);
}

.cart-tab-panel {
    display: none;
}

.cart-tab-panel.is-active {
    display: block;
}

.btn-move-to-cart {
    padding: 10px 14px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    background: var(--bg-elevated);
    cursor: pointer;
    font-weight: 600;
}

.btn-move-to-cart:hover {
    background: var(--bg-tertiary);
}

.btn-move-to-cart:disabled {
    opacity: .6;
    cursor: not-allowed;
}

.cart-item {
    border-color: var(--border-color);
    background: var(--bg-elevated);
}

.cart-item-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cart-item-meta {
    gap: 10px;
}

.cart-item-meta-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-item-meta-right {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.rating-slot {
    display: inline-flex;
    align-items: center;
    min-width: 120px;
    height: 18px;
}

.rating-slot.is-empty {
    visibility: hidden;
}

.cart-item-meta .save-for-later,
.cart-item-meta .view-degree-track {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    background: var(--bg-elevated);
    font-weight: 600;
    text-decoration: none;
    line-height: 1;
}

.save-for-later {
    position: relative;
    min-width: 130px;
    justify-content: center;
}

.save-for-later.loading {
    opacity: .9;
    pointer-events: none;
}

.save-for-later .label {
    display: inline;
}

.save-for-later.loading .label {
    display: none;
}

.save-for-later .save-spinner {
    display: none;
    width: 16px;
    height: 16px;
}

.save-for-later .save-spinner .spinner-svg {
    width: 16px;
    height: 16px;
    display: block;
    animation: cartspin 1s linear infinite;
}

.save-for-later .save-spinner .spinner-path {
    stroke: currentColor;
    stroke-width: 3;
    stroke-linecap: round;
    fill: none;
    stroke-dasharray: 90, 150;
    stroke-dashoffset: 0;
    animation: cartdash 1.3s ease-in-out infinite;
}

.save-for-later.loading .save-spinner {
    display: inline-block;
}

@keyframes cartdash {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }

    50% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -35;
    }

    100% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -124;
    }
}

.cart-item-meta .save-for-later {
    color: var(--brand);
    border-color: rgba(var(--brand-rgb), 0.35);
    background: rgba(var(--brand-rgb), 0.08);
}

.cart-item-meta .save-for-later:hover {
    background: rgba(var(--brand-rgb), 0.12);
}

.already-saved-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    font-weight: 600;
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1;
    cursor: default;
}

.already-saved-indicator svg {
    color: var(--brand);
    opacity: 0.7;
}

.already-in-cart-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    font-weight: 600;
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1;
    cursor: default;
}

.already-in-cart-indicator svg {
    color: var(--brand);
    opacity: 0.7;
}

.cart-item-meta .view-degree-track {
    color: var(--text-primary);
}

.cart-item-meta .view-degree-track:hover {
    background: var(--bg-tertiary);
}

.cart-remove-btn:focus-visible,
.save-for-later:focus-visible,
.view-degree-track:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(var(--brand-rgb), 0.25);
}

@media (max-width: 768px) {
    .cart-item-meta {
        gap: 8px;
    }

    .cart-item-meta .save-for-later,
    .cart-item-meta .view-degree-track {
        padding: 8px 12px;
    }
}

/* Apply coupon UI */
.cart-apply-coupon {
    color: var(--brand);
    font-weight: 600;
    text-align: center;
    display: inline-block;
}

.cart-apply-coupon:hover {
    text-decoration: underline;
}

.cart-coupon-form {
    display: none;
    gap: 8px;
}

.cart-coupon-form input {
    flex: 1;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.cart-coupon-form button {
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-elevated);
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .cart-layout {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }

    .cart-summary {
        position: relative;
        top: auto;
    }
}

@media (max-width: 768px) {
    .cart-container {
        padding: var(--space-7) var(--space-4);
    }

    .cart-header {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }

    .cart-item {
        grid-template-columns: 100px 1fr;
        grid-template-rows: auto auto;
        gap: var(--space-4);
        padding: var(--space-4);
    }

    .cart-item img {
        grid-row: 1 / 3;
    }

    .cart-item-body {
        grid-row: 1 / 2;
        grid-column: 2 / 3;
    }

    .cart-item-aside {
        grid-row: 2 / 3;
        grid-column: 2 / 3;
        width: 100%;
        justify-content: space-between;
        padding: 0;
    }

    .cart-remove-btn {
        opacity: 1;
    }
}

@media (max-width: 480px) {
    .cart-container {
        padding: var(--space-6) var(--space-4);
    }

    .cart-header,
    .cart-panel,
    .cart-summary {
        padding: var(--space-5);
        border-radius: var(--radius-lg);
    }

    .cart-item {
        grid-template-columns: 1fr;
    }

    .cart-item img {
        grid-row: 1 / 2;
        width: 100%;
        height: auto;
    }

    .cart-item-body {
        grid-row: 2 / 3;
        grid-column: 1 / 2;
    }

    .cart-item-aside {
        grid-row: 3 / 4;
        grid-column: 1 / 2;
    }
}

/* ================================================
                                               3. UX ENHANCEMENT STYLES (FROM NEW DESIGN)
                                               ================================================ */
/* Toasts for Undo functionality */
.cart-toast {
    position: fixed;
    right: 16px;
    bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 9999;
}

.cart-toast-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px 14px;
    box-shadow: var(--shadow-md);
    max-width: 92vw;
    font-size: 14px;
}

.cart-toast-action {
    margin-left: 4px;
    background: transparent;
    color: var(--brand);
    border: none;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 8px;
}

.cart-toast-action:hover {
    background: rgba(var(--brand-rgb), 0.1);
}

/* Spinners for loading states */
@keyframes cartspin {
    to {
        transform: rotate(360deg);
    }
}

.cart-btn-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-top-color: var(--text-inverse);
    animation: cartspin 0.8s linear infinite;
    vertical-align: text-bottom;
    margin-left: 8px;
}

.cart-remove-btn .cart-mini-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid currentColor;
    border-top-color: transparent;
    animation: cartspin 0.8s linear infinite;
    vertical-align: middle;
}
