/* =========================================================
   Сургалтын дэлгэрэнгүй (Figma "Leoson view" 154:80126)
   style.css-ийн дараа холбоно.
   ========================================================= */

.trd .icon { width: 14px; height: 14px; }

/* ---------- Толгой (Figma "article 2": 48/150, gap 48) ---------- */
.trd-hero { background: var(--bg); padding: 48px 0; }
.trd-hero__grid { display: grid; grid-template-columns: minmax(0, 780fr) minmax(0, 792fr); gap: 48px; align-items: center; }
.trd-hero__text { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.trd-hero__head { display: flex; flex-direction: column; gap: 12px; }

.trd-cat { display: inline-flex; align-items: center; gap: 4px; font-size: 16px; line-height: 1.6; color: #999; }
.trd-cat .icon { width: 18px; height: 18px; color: rgba(0, 0, 255, .3); fill: currentColor; stroke: none; }

.trd-title { margin: 0; font-size: 48px; font-weight: 700; line-height: 1.2; color: rgba(0, 0, 0, .9); overflow-wrap: anywhere; }

.trd-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; font-size: 12px; line-height: 1; color: #999; }
.trd-facts > span { display: inline-flex; align-items: center; gap: 4px; }
.trd-facts .icon { width: 14px; height: 14px; color: rgba(0, 0, 255, .3); }
.trd-stars { color: #f5b83d; }

.trd-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* Товчнууд — Figma button Large (48px) */
.trd-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 48px; padding: 12px 24px; border-radius: 999px; border: 1px solid transparent;
    font: inherit; font-size: 18px; font-weight: 500; line-height: 1.32; white-space: nowrap;
    cursor: pointer; text-decoration: none; transition: opacity .2s, background-color .2s, border-color .2s;
}
.trd-btn .icon { width: 24px; height: 24px; }
.trd-btn--primary { background: var(--gradient); color: #fff; }
.trd-btn--primary:hover { opacity: .7; }                                   /* Primary Hover */
.trd-btn--primary:disabled { opacity: .5; cursor: not-allowed; }           /* Primary Disabled */
.trd-btn--outline { border-color: rgba(0, 0, 255, .2); color: #3232b5; background: transparent; }
.trd-btn--outline:hover { border-color: rgba(0, 0, 255, .5); background: rgba(0, 0, 255, .05); }   /* Outline Hover */

/* Зураг — 792×446, radius 24 */
.trd-cover { aspect-ratio: 792 / 446; border-radius: 24px; overflow: hidden; background: rgba(0, 0, 0, .05); display: grid; place-items: center; }
.trd-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.trd-cover__ph { font-size: 64px; color: rgba(0, 0, 0, .08); }

/* ---------- Үндсэн хэсэг (цагаан, 2fr / 1fr, gap 48) ---------- */
.trd-main { background: #fff; padding: 48px 0; }
.trd-main__grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.trd-content { display: flex; flex-direction: column; gap: 48px; min-width: 0; }
.trd-section { display: flex; flex-direction: column; gap: 20px; }
.trd-h2 { margin: 0; font-size: 36px; font-weight: 700; line-height: 1.4; color: rgba(0, 0, 0, .9); }

.trd-text { font-size: 16px; line-height: 1.6; color: rgba(0, 0, 0, .6); overflow-wrap: anywhere; }
.trd-text p { margin: 0 0 12px; }
.trd-text > :last-child { margin-bottom: 0; }
.trd-text img { max-width: 100%; height: auto; border-radius: 12px; }
.trd-text h2, .trd-text h3 { color: rgba(0, 0, 0, .9); margin: 1.2em 0 .5em; }
.trd-text a { color: var(--blue); }
.trd-text ul, .trd-text ol { padding-left: 1.3em; }
.trd-text table { width: 100%; border-collapse: collapse; }
.trd-text td, .trd-text th { border: 1px solid var(--grey-200); padding: 8px 10px; }
.trd-empty { margin: 0; font-size: 16px; color: rgba(0, 0, 0, .4); }

/* Хуваарь — 2×2, gap 12 */
.trd-timeline { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.trd-timeline li {
    display: flex; flex-direction: column; gap: 8px; padding: 12px 20px;
    background: rgba(0, 0, 255, .01); border: 1px solid rgba(0, 0, 255, .2); border-radius: 8px; line-height: 1;
}
.trd-timeline small { font-size: 12px; color: rgba(0, 0, 255, .5); }
.trd-timeline b { font-size: 16px; font-weight: 500; color: #3232b5; font-variant-numeric: tabular-nums; }

/* Багш */
.trd-teacher { display: flex; align-items: center; gap: 16px; }
.trd-teacher__img {
    width: 64px; height: 64px; border-radius: 50%; overflow: hidden; flex: none;
    display: grid; place-items: center; background: var(--gradient); color: #fff; font-size: 24px; font-weight: 700;
}
.trd-teacher__img img { width: 100%; height: 100%; object-fit: cover; }
.trd-teacher b { display: block; font-size: 18px; font-weight: 500; color: rgba(0, 0, 0, .9); }
.trd-teacher span { font-size: 14px; color: rgba(0, 0, 0, .5); }

/* ---------- Бүртгэлийн карт (градиент, padding 48, radius 24, gap 24) ---------- */
.trd-aside { position: sticky; top: 120px; }
.trd-reg {
    display: flex; flex-direction: column; gap: 24px; padding: 48px; border-radius: 24px;
    background: var(--gradient); color: #fff; overflow: hidden;
}
.trd-price { display: flex; align-items: flex-end; gap: 8px; line-height: 1; }
.trd-price b { font-size: 36px; font-weight: 700; white-space: nowrap; }
.trd-price small { font-size: 16px; color: rgba(255, 255, 255, .7); }

.trd-badge {
    align-self: flex-start; display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 12px; border-radius: 999px; background: rgba(255, 255, 255, .2);
    font-size: 16px; line-height: 1; color: #fff;
}
.trd-badge .icon { width: 16px; height: 16px; fill: currentColor; stroke: none; }
.trd-badge--open .icon { animation: trdPulse 1.6s infinite; }
.trd-badge--done { background: #fff; color: #3232b5; }
@keyframes trdPulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }

.trd-seats { display: flex; flex-direction: column; gap: 8px; }
.trd-seats__row { display: flex; justify-content: space-between; font-size: 14px; color: rgba(255, 255, 255, .7); font-variant-numeric: tabular-nums; }
.trd-seats__row b { color: #fff; }
.trd-bar { height: 6px; border-radius: 999px; background: rgba(255, 255, 255, .2); overflow: hidden; }
.trd-bar span { display: block; height: 100%; border-radius: inherit; background: #fff; }

.trd-dl { margin: 0; display: flex; flex-direction: column; }
.trd-dl div { display: flex; align-items: center; gap: 4px; padding: 4px 0; border-bottom: 1px solid rgba(255, 255, 255, .2); font-size: 16px; }
.trd-dl dt { flex: 1; line-height: 1; color: rgba(255, 255, 255, .7); }
.trd-dl dd { flex: 1; margin: 0; font-weight: 600; line-height: 1.4; text-align: right; color: #fff; font-variant-numeric: tabular-nums; }

.trd-reg__actions { display: flex; flex-direction: column; gap: 8px; }
.trd-reg .trd-btn { width: 100%; }
.trd-btn--white { background: #fff; color: #035ba5; }
.trd-btn--white:hover { opacity: .85; }
.trd-btn--ghost-white { border-color: #fff; color: #fff; background: transparent; }
.trd-btn--ghost-white:hover { background: rgba(255, 255, 255, .1); }
.trd-btn--ghost-white:disabled { opacity: .5; cursor: not-allowed; background: transparent; }   /* Figma: 50% */
.trd-note { margin: 0; font-size: 16px; line-height: 1.6; text-align: center; color: rgba(255, 255, 255, .7); }

/* ---------- Бусад сургалт (саарал дэвсгэр) ---------- */
.trd-more { background: var(--bg); padding: 48px 0; }
.trd-more .container { display: flex; flex-direction: column; gap: 24px; }
.trd-more__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; align-items: start; }
.trd-card {
    display: flex; flex-direction: column; overflow: hidden; color: inherit;
    background: #fff; border: 1px solid var(--grey-200); border-radius: 12px;
}
.trd-card__img { aspect-ratio: 16 / 9; overflow: hidden; background: rgba(0, 0, 0, .05); }
.trd-card__img img { width: 100%; height: 100%; object-fit: cover; }
.trd-card__body { display: flex; flex-direction: column; gap: 12px; padding: 20px 24px 24px; }
.trd-card__title { margin: 0 0 -4px; font-size: 20px; font-weight: 500; line-height: 1.4; color: rgba(0, 0, 0, .8); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trd-card__meta { margin: 0; display: flex; flex-direction: column; font-size: 16px; line-height: 1; }
.trd-card__meta div { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid rgba(0, 0, 0, .1); }
.trd-card__meta dt { color: rgba(0, 0, 0, .4); }
.trd-card__meta dd { margin: 0; color: rgba(0, 0, 0, .8); text-align: right; }
.trd-card__btn {
    display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
    padding: 11px 20px; border: 1px solid rgba(0, 0, 255, .2); border-radius: 999px;
    color: #3232b5; font-size: 16px; font-weight: 500; line-height: 1; white-space: nowrap;
    transition: background-color .2s, border-color .2s;
}
.trd-card__btn .icon { width: 16px; height: 16px; }
.trd-card:hover .trd-card__btn { border-color: rgba(0, 0, 255, .5); background: linear-gradient(90deg, rgba(102, 126, 234, .1), rgba(118, 75, 162, .1)); }

.trd .trd-btn:focus-visible, .trd a:focus-visible { outline: 2px solid #3232b5; outline-offset: 2px; }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
    .trd-more__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .trd-reg { padding: 32px; }
}
@media (max-width: 1100px) {
    .trd-hero__grid, .trd-main__grid { grid-template-columns: 1fr; }
    .trd-hero__grid { gap: 32px; }
    .trd-hero__text { order: 2; }
    .trd-aside { position: static; }
    .trd-more__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
    .trd-hero, .trd-main, .trd-more { padding: 24px 0; }
    .trd-title { font-size: 30px; }
    .trd-h2 { font-size: 26px; }
    .trd-content { gap: 32px; }
    .trd-cover { border-radius: 16px; }
    .trd-btn { font-size: 16px; padding: 10px 18px; height: 44px; }
    .trd-actions .trd-btn { flex: 1 1 auto; }
    .trd-reg { padding: 24px; border-radius: 16px; gap: 20px; }
    .trd-price b { font-size: 30px; }
    .trd-timeline { grid-template-columns: 1fr; }
    .trd-more__grid { gap: 16px; }
    .trd-card__body { padding: 16px; }
}
@media (max-width: 480px) { .trd-more__grid { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .trd * { animation: none !important; transition: none !important; } }
.trd-badge--closed, .trd-badge--full { background: rgba(0, 0, 0, .2); }
.trd-badge--soon, .trd-badge--unknown { background: rgba(255, 255, 255, .2); }

/* =========================================================
   Сургалтын жагсаалт (Figma "Leoson list" 724:4239)
   ========================================================= */
.tpl { background: var(--bg); padding: 24px 0 48px; }
.tpl .container { display: flex; flex-direction: column; gap: 24px; }
.tpl-title { margin: 0; font-size: 36px; font-weight: 700; line-height: 1.4; color: #000; }
.tpl-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; }

/* Шүүлтүүр — pill input (auth-field загвар) */
.tpl-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tpl-input {
    height: 48px; padding: 12px 20px; min-width: 0;
    border: 1px solid rgba(0, 0, 0, .1); border-radius: 999px; background: #fff;
    font: inherit; font-size: 16px; line-height: 1.36; color: #000; outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.tpl-input::placeholder { color: rgba(0, 0, 0, .5); }
.tpl-input:focus { border-color: #667eea; box-shadow: 0 0 0 3px rgba(102, 126, 234, .15); }
select.tpl-input {
    appearance: none; -webkit-appearance: none; padding-right: 44px; cursor: pointer;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233232b5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 16px center / 18px;
}
.tpl-search { position: relative; width: 300px; }
.tpl-search .tpl-input { width: 100%; padding-left: 48px; }
.tpl-search .icon { position: absolute; left: 18px; top: 50%; width: 20px; height: 20px; transform: translateY(-50%); color: rgba(0, 0, 0, .4); pointer-events: none; }
.tpl-select { width: 200px; }
.tpl-price { display: flex; align-items: center; gap: 4px; color: rgba(0, 0, 0, .4); }
.tpl-price .tpl-input { width: 120px; -moz-appearance: textfield; }
.tpl-price .tpl-input::-webkit-inner-spin-button, .tpl-price .tpl-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.tpl-filter .trd-btn .icon { width: 20px; height: 20px; }

.tpl-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: -8px; font-size: 16px; color: rgba(0, 0, 0, .5); }
.tpl-bar b { color: #3232b5; font-weight: 600; }
.tpl-clear { display: inline-flex; align-items: center; gap: 4px; color: #3232b5; font-weight: 500; transition: opacity .2s; }
.tpl-clear:hover { opacity: .7; }
.tpl-clear .icon { width: 18px; height: 18px; }

/* Карт — "Бусад сургалт"-ын .trd-card, 4 багана */
.tpl-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.trd-card__img { position: relative; }
.trd-card__ph { position: absolute; inset: 0; display: grid; place-items: center; font-size: 40px; color: rgba(0, 0, 0, .08); }
.trd-card__img img { position: relative; }
.trd-card__cat {
    position: absolute; left: 12px; top: 12px; z-index: 1; max-width: calc(100% - 24px);
    padding: 4px 12px; border-radius: 999px; background: rgba(255, 255, 255, .92);
    font-size: 13px; line-height: 1.4; color: #3232b5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.trd-card__desc {
    margin: 0; font-size: 14px; line-height: 1.5; color: rgba(0, 0, 0, .5);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 42px;
}
.trd-card__desc * { display: inline; margin: 0; padding: 0; font: inherit; color: inherit; background: none; border: 0; }
.trd-card__desc img, .trd-card__desc table, .trd-card__desc iframe, .trd-card__desc br { display: none; }
.trd-card__meta dd.is-free { color: #1a7f37; }
.trd-card { height: 100%; }
.trd-card__body { flex: 1; }
.trd-card__btn { margin-top: auto; }

/* Хоосон */
.tpl-empty {
    display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 64px 24px; text-align: center;
    background: #fff; border: 1px dashed rgba(0, 0, 0, .2); border-radius: 24px;
}
.tpl-empty b { font-size: 24px; font-weight: 700; color: rgba(0, 0, 0, .8); }
.tpl-empty p { margin: 0; font-size: 16px; color: rgba(0, 0, 0, .5); }

/* Хуудаслалт (Figma "pages") */
.pager { display: flex; justify-content: center; align-items: center; gap: 8px; }
.pager__item {
    display: flex; align-items: center; justify-content: center;
    min-width: 48px; height: 48px; padding: 12px; border-radius: 999px;
    border: 1px solid rgba(0, 0, 255, .2); color: #3232b5;
    font-size: 18px; font-weight: 500; line-height: 1.32;
    transition: background-color .2s, border-color .2s, opacity .2s;
}
.pager__item .icon { width: 24px; height: 24px; }
.pager__next { width: 48px; padding: 0; }
a.pager__item:hover { background: rgba(0, 0, 255, .05); border-color: rgba(0, 0, 255, .5); }
.pager__item.is-active { border-color: transparent; background: var(--gradient); color: #fff; }
.pager__item.is-active:hover { opacity: .7; }
.pager__gap, .pager__item.is-disabled { cursor: default; }
.pager__item.is-disabled { opacity: .35; }

/* Хөтөлбөрийн дэлгэрэнгүй — элсэлтийн badge */
.trd-badge--off { background: rgba(0, 0, 0, .2); }

@media (max-width: 1280px) { .tpl-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1100px) {
    .tpl-head { flex-direction: column; align-items: stretch; }
    .tpl-filter { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tpl-search, .tpl-select { width: 100%; }
    .tpl-search { grid-column: 1 / -1; }
    .tpl-price .tpl-input { width: 100%; flex: 1; }
}
@media (max-width: 900px) { .tpl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 768px) {
    .tpl-title { font-size: 28px; }
    .tpl-grid { gap: 16px; }
    .pager { gap: 6px; }
    .pager__item { min-width: 40px; height: 40px; padding: 8px; font-size: 16px; }
    .pager__next { width: 40px; }
}
@media (max-width: 560px) {
    .tpl-filter { grid-template-columns: 1fr; }
    .tpl-grid { grid-template-columns: 1fr; }
}