/* Course cards of the storefront (template local_courseshop/course_cards). Sizes in px: the theme sets html to 15px, the prototype is drawn on 16px. */

.courseshop-cards {
    --ch-font-heading: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
    --ch-blue: #2f6cf8;
    --ch-blue-hover: #2456d8;
    --ch-slate-900: #0f172a;
    --ch-slate-700: #334155;
    --ch-slate-600: #475569;
    --ch-slate-500: #64748b;
    --ch-slate-400: #94a3b8;
    --ch-slate-300: #cbd5e1;
    --ch-slate-200: #e2e8f0;
    --ch-slate-100: #f1f5f9;
    --ch-dark-border: hsl(222 40% 28%);
    --ch-dark-accent: hsl(223 45% 18%);
    --ch-dark-accent-fg: hsl(213 40% 92%);
    --ch-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, .05);
    --ch-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, .1), 0 8px 10px -6px rgba(0, 0, 0, .1);

    position: relative;
    font-size: 16px;
    line-height: 1.5;
    color: var(--ch-slate-700);
}

.courseshop-cards h3,
.courseshop-cards p {
    margin: 0;
}

.courseshop-cards h3 {
    font-family: var(--ch-font-heading);
}

.courseshop-cards [hidden] {
    display: none !important;
}

/* Buttons. */

.courseshop-cards .ch-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 36px;
    padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .15s, color .15s, border-color .15s, opacity .15s;
}

.courseshop-cards .ch-btn i {
    font-size: 16px;
    line-height: 1;
}

.courseshop-cards .ch-btn:hover,
.courseshop-cards .ch-btn:focus {
    text-decoration: none;
}

.courseshop-cards .ch-btn:focus-visible {
    outline: 2px solid var(--ch-blue);
    outline-offset: 2px;
}

.courseshop-cards .ch-btn.is-disabled {
    opacity: .5;
    pointer-events: none;
}

/* Cards. */

.courseshop-cards .ch-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 32px;
}

.courseshop-cards .ch-chip {
    padding: 6px 16px;
    border: 1px solid var(--ch-slate-200);
    border-radius: 9999px;
    background-color: #fff;
    color: var(--ch-slate-600);
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    transition: color .15s, border-color .15s, background-color .15s;
}

.courseshop-cards .ch-chip:hover {
    border-color: var(--ch-blue);
    color: var(--ch-blue);
}

.courseshop-cards .ch-chip.is-active {
    border-color: transparent;
    background-color: var(--ch-blue);
    box-shadow: var(--ch-shadow-sm);
    color: #fff;
}

.courseshop-cards .ch-course-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
}

@media (min-width: 640px) {
    .courseshop-cards .ch-course-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .courseshop-cards .ch-course-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.courseshop-cards .ch-course-card {
    --ch-accent: var(--ch-blue);
    --ch-accent-hover: var(--ch-blue-hover);
    --ch-accent-text: #2563eb;
    --ch-accent-badge-bg: #dbeafe;
    --ch-accent-badge-fg: #1d4ed8;
    --ch-accent-shadow: rgba(37, 99, 235, .1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 12px;
    background-color: #fff;
    box-shadow: 0 10px 15px -3px var(--ch-accent-shadow), 0 4px 6px -4px var(--ch-accent-shadow);
    transition: box-shadow .15s;
}

.courseshop-cards .ch-course-card:hover {
    box-shadow: var(--ch-shadow-xl);
}

.courseshop-cards .ch-accent-teal {
    --ch-accent: #0e8578;
    --ch-accent-hover: #0b6b60;
    --ch-accent-text: #0f766e;
    --ch-accent-badge-bg: #ccfbf1;
    --ch-accent-badge-fg: #0f766e;
    --ch-accent-shadow: rgba(15, 118, 110, .1);
}

.courseshop-cards .ch-accent-violet {
    --ch-accent: #6c39b7;
    --ch-accent-hover: #57309a;
    --ch-accent-text: #6d28d9;
    --ch-accent-badge-bg: #ede9fe;
    --ch-accent-badge-fg: #6d28d9;
    --ch-accent-shadow: rgba(109, 40, 217, .1);
}

.courseshop-cards .ch-course-media {
    display: block;
    height: 176px;
    overflow: hidden;
    background-color: var(--ch-slate-100);
}

.courseshop-cards .ch-course-media img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
}

.courseshop-cards .ch-course-media-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ch-slate-300);
    font-size: 48px;
}

.courseshop-cards .ch-course-body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
}

.courseshop-cards .ch-course-badge {
    align-self: flex-start;
    padding: 4px 12px;
    border-radius: 9999px;
    background-color: var(--ch-accent-badge-bg);
    color: var(--ch-accent-badge-fg);
    font-size: 12px;
    font-weight: 600;
    line-height: 16px;
}

.courseshop-cards .ch-course-title {
    color: var(--ch-slate-900);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.375;
    letter-spacing: .025em;
    text-transform: uppercase;
}

.courseshop-cards .ch-course-title a {
    color: inherit;
    text-decoration: none;
}

.courseshop-cards .ch-course-title a:hover,
.courseshop-cards .ch-course-title a:focus {
    color: var(--ch-accent-text);
    text-decoration: none;
}

.courseshop-cards .ch-course-subtitle {
    color: var(--ch-slate-500);
    font-size: 14px;
    line-height: 20px;
}

.courseshop-cards .ch-course-deadline {
    color: var(--ch-slate-500);
    font-size: 12px;
    font-weight: 500;
    line-height: 16px;
}

.courseshop-cards .ch-course-footer {
    margin-top: auto;
    padding-top: 8px;
}

.courseshop-cards .ch-course-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--ch-slate-100);
    font-size: 14px;
    line-height: 20px;
}

.courseshop-cards .ch-course-meta-text {
    color: var(--ch-slate-500);
}

.courseshop-cards .ch-course-price {
    color: var(--ch-slate-900);
    font-weight: 600;
    white-space: nowrap;
}

.courseshop-cards .ch-course-price small {
    margin-left: 4px;
    color: var(--ch-slate-400);
    font-size: 12px;
    font-weight: 400;
}

.courseshop-cards .ch-course-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 16px;
}

.courseshop-cards .ch-course-actions .ch-btn {
    width: 100%;
    padding-left: 12px;
    padding-right: 12px;
}

.courseshop-cards .ch-btn-accent,
.courseshop-cards .ch-btn-accent:focus {
    background-color: var(--ch-accent);
    color: #fff;
}

.courseshop-cards .ch-btn-accent:hover {
    background-color: var(--ch-accent-hover);
    color: #fff;
}

.courseshop-cards .ch-btn-cart,
.courseshop-cards .ch-btn-cart:focus {
    border-color: var(--ch-dark-border);
    background-color: transparent;
    box-shadow: var(--ch-shadow-sm);
    color: var(--ch-slate-900);
}

.courseshop-cards .ch-btn-cart:hover {
    background-color: var(--ch-dark-accent);
    color: var(--ch-dark-accent-fg);
}

.courseshop-cards .ch-btn-cart.btn-remove-cart {
    color: #059669;
}

.courseshop-cards .ch-btn-cart.btn-remove-cart:hover {
    color: var(--ch-dark-accent-fg);
}

/* local_courseshop/catalog rewrites the button content with Font Awesome icons: the icon comes from here. */
.courseshop-cards .ch-btn-cart > i {
    display: none;
}

.courseshop-cards .ch-btn-cart::before {
    font-family: "remixicon";
    font-size: 16px;
    font-weight: 400;
    line-height: 1;
}

.courseshop-cards .ch-btn-cart.btn-add-cart::before {
    content: "\f11e";
}

.courseshop-cards .ch-btn-cart.btn-remove-cart::before {
    content: "\eb99";
}
