.courses-page {
    width: min(1440px, 100%);
    margin: 0 auto;
    padding: clamp(24px, 4vw, 56px);
    color: #3f342e;
}

.courses-hero {
    max-width: 720px;
    margin-bottom: 28px;
}

.courses-hero > span {
    color: #a27642;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.courses-hero h1 {
    margin: 7px 0 8px;
    color: #352b27;
    font-size: clamp(30px, 4vw, 48px);
}

.courses-hero p {
    margin: 0;
    color: #746963;
    font-size: 16px;
}

.courses-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 24px;
    padding: 6px;
    border: 1px solid #e8ddd3;
    border-radius: 16px;
    background: #f7f1eb;
}

.courses-tabs button,
.courses-tabs a {
    flex: 0 1 190px;
    min-height: 44px;
    padding: 11px 18px;
    border: 0;
    border-radius: 11px;
    color: #75665e;
    background: transparent;
    font: inherit;
    font-weight: 800;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: color .2s ease, background .2s ease;
}

.courses-tabs button.active,
.courses-tabs button:hover,
.courses-tabs a:hover {
    color: #fff;
    background: #c49a63;
}

.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 340px);
    align-items: start;
    justify-content: start;
    gap: clamp(16px, 2.2vw, 26px);
}

[data-course-panel][hidden] {
    display: none !important;
}

.course-card {
    display: grid;
    grid-template-rows: 212px auto;
    width: 340px;
    max-width: 100%;
    overflow: hidden;
    border: 1px solid #eadfd5;
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 14px 40px rgba(65, 47, 38, .09);
    transition: transform .2s ease, box-shadow .2s ease;
}

.course-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 46px rgba(65, 47, 38, .14);
}

.course-card__media {
    display: flex;
    height: 212px;
    gap: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scrollbar-color: #c8a97f transparent;
    scrollbar-width: thin;
    background: linear-gradient(145deg, #f4e7dc, #ede4d8);
}

.course-card__media::-webkit-scrollbar {
    height: 5px;
}

.course-card__media::-webkit-scrollbar-thumb {
    border-radius: 10px;
    background: #c8a97f;
}

.course-card__media img,
.course-card__media video,
.course-card__placeholder {
    flex: 0 0 100%;
    width: 100%;
    height: 212px;
    object-fit: cover;
    scroll-snap-align: start;
}

.course-card__placeholder {
    display: grid;
    place-items: center;
    color: #a47a49;
    font-size: 62px;
}

.course-card__body {
    display: flex;
    flex-direction: column;
    gap: 13px;
    min-width: 0;
    padding: 21px;
}

.course-card__eyebrow {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
    color: #7c706a;
    font-size: 13px;
}

.course-card__price {
    display: grid;
    justify-items: end;
    gap: 5px;
    color: #463a34;
    text-align: right;
}

.course-card__type {
    padding: 4px 9px;
    border-radius: 999px;
    color: #8c6335;
    background: #f6ead9;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
}

.course-card h2 {
    margin: 0;
    overflow-wrap: anywhere;
    color: #3a302c;
    font-size: 22px;
}

.course-card__venue {
    display: grid;
    gap: 4px;
    padding: 11px 13px;
    border: 1px solid #eadfd5;
    border-radius: 13px;
    color: #5d5049;
    background: #fbf7f1;
    overflow-wrap: anywhere;
}

.course-card__venue small {
    color: #897970;
    line-height: 1.4;
}

.course-card__description {
    display: -webkit-box;
    overflow: hidden;
    color: #776b65;
    line-height: 1.5;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
}

.course-card__description p {
    margin: 0;
}

.course-card__curator {
    display: flex;
    align-items: center;
    gap: 11px;
    padding-top: 13px;
    border-top: 1px solid #eee5de;
}

.course-card__curator img {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border: 2px solid #f1e5db;
    border-radius: 50%;
    object-fit: cover;
}

.course-card__curator > span {
    display: grid;
    flex: 1 1 auto;
    min-width: 0;
    gap: 3px;
}

.course-card__duration {
    color: #796b63;
    font-size: 13px;
}

.course-card__prepayment {
    color: #796b63;
    font-size: 11px;
    line-height: 1.25;
}

.course-card__prepayment strong {
    color: #9b6c34;
}

.course-card__payment-summary {
    display: grid;
    gap: 7px;
    padding: 12px 13px;
    border-radius: 13px;
    color: #74665e;
    background: #faf5ef;
    font-size: 12px;
}

.course-card__payment-summary span {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.course-card__payment-summary strong {
    color: #5a4435;
}

.course-card__chat {
    flex: 0 0 auto;
    align-self: center;
    margin-left: auto;
}

.course-countdown--progress {
    background: #f4edf7;
}

.course-countdown--progress strong {
    color: #775284;
}

.course-card__curator small {
    color: #92837b;
    font-size: 11px;
}

.course-card__curator strong {
    overflow-wrap: anywhere;
    color: #463a34;
}

.course-countdown {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 13px;
    margin-top: auto;
    padding: 12px 13px;
    border-radius: 13px;
    color: #796b63;
    background: #faf5ef;
}

.course-countdown span {
    font-size: 12px;
}

.course-countdown strong {
    color: #9b6c34;
    text-align: right;
}

.course-primary-button,
.course-card__joined,
.course-card__closed {
    display: flex;
    width: 100%;
    min-height: 46px;
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
    margin-top: auto;
    padding: 11px 18px;
    border: 0;
    border-radius: 13px;
    font: inherit;
    font-weight: 800;
    text-align: center;
    text-decoration: none;
}

.course-primary-button {
    color: #fff;
    background: #c49a63;
    cursor: pointer;
    transition: transform .2s ease, background .2s ease;
}

.course-primary-button:hover {
    background: #ad7f47;
    transform: translateY(-1px);
}

.course-card__joined {
    color: #39714b;
    background: #e3f2e7;
}

.course-card__closed {
    color: #7a6d66;
    background: #eee9e6;
}

.course-refund-form {
    display: grid;
    gap: 8px;
    margin-top: auto;
}

.course-refund-form small {
    color: #897970;
    font-size: 11px;
}

.course-refund-button {
    min-height: 44px;
    padding: 10px 16px;
    border: 0;
    border-radius: 13px;
    color: #7e4a42;
    background: #f4e5df;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.courses-empty,
.courses-messages > div {
    padding: clamp(26px, 5vw, 50px);
    border: 1px dashed #d9c7b4;
    border-radius: 24px;
    color: #796d66;
    background: #fffaf5;
    text-align: center;
}

.courses-empty {
    grid-column: 1 / -1;
}

.courses-messages {
    margin-bottom: 18px;
}

.courses-messages > div {
    padding: 13px 16px;
    border-style: solid;
    border-radius: 13px;
    color: #6c593f;
}

.course-payment-result {
    width: min(620px, calc(100% - 32px));
    margin: clamp(30px, 7vw, 80px) auto;
    padding: clamp(24px, 5vw, 44px);
    border: 1px solid #eadfd5;
    border-radius: 26px;
    background: #fff;
    box-shadow: 0 18px 55px rgba(65, 47, 38, .11);
    text-align: center;
}

.course-payment-result__icon {
    display: grid;
    width: 64px;
    height: 64px;
    margin: 0 auto 18px;
    place-items: center;
    border-radius: 20px;
    color: #8a673d;
    background: #f3e6d5;
    font-size: 30px;
}

@media (max-width: 620px) {
    .courses-page {
        padding-inline: 14px;
    }

    .courses-tabs {
        display: grid;
        grid-template-columns: 1fr;
    }

    .courses-tabs button,
    .courses-tabs a {
        width: 100%;
    }

    .courses-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .course-card {
        width: 100%;
        border-radius: 19px;
    }

    .course-card__body {
        padding: 17px;
    }
}
