/* =========================================================
   Сургалтын танхим — цаг захиалах (Figma "Room view" 732:13144)
   style.css-ийн дараа холбоно.
   ========================================================= */

/* Breadcrumb (.crumbs) — style.css дотор */

/* ---------- Хуанли ---------- */
.booking { padding-top: 48px; padding-bottom: 48px; }
.booking__grid { display: flex; align-items: flex-start; }

/* Цагийн багана — 70px, гарчгийн мөрийн доороос эхэлнэ */
.booking__hours { flex: none; width: 70px; padding-top: 62px; }
.hours__body { position: relative; height: var(--body-h, 576px); }
.hour {
    position: absolute; left: 0; right: 0; height: 41px; margin-top: -4px;
    display: flex; align-items: center; gap: 4px;
    font-size: 16px; line-height: 1; color: rgba(0, 0, 0, .5);
}
.hour .icon { width: 14px; height: 14px; color: rgba(0, 0, 0, .5); }

/* Өдрүүд — хэвтээ гүйдэг */
.booking__scroll {
    flex: 1; min-width: 0; overflow-x: auto; overflow-y: hidden;
    scrollbar-width: thin; scrollbar-color: rgba(0, 0, 0, .15) transparent;
    cursor: grab; -webkit-overflow-scrolling: touch;
}
.booking__scroll.is-dragging { cursor: grabbing; user-select: none; }
.booking__scroll::-webkit-scrollbar { height: 6px; }
.booking__scroll::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, .15); border-radius: 3px; }
.booking__days { display: flex; width: max-content; }

.day { width: 170px; flex: none; display: flex; flex-direction: column; gap: 2px; }

/* Өдрийн гарчиг (Figma "title") */
.day__title {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 8px; border-bottom: 2px solid rgba(0, 0, 0, .1);
    text-align: center; white-space: nowrap;
}
.day__name { font-size: 16px; line-height: 1; color: rgba(0, 0, 0, .3); }
.day__date { font-size: 16px; line-height: 1.4; color: rgba(0, 0, 0, .6); }
.day--today .day__title { border-bottom-color: #3232b5; }
.day--today .day__name { color: rgba(0, 0, 255, .4); }
.day--today .day__date { color: #3232b5; font-weight: 600; }
.day--weekend:not(.day--today) .day__name,
.day--weekend:not(.day--today) .day__date { color: rgba(255, 102, 0, .7); }

.day__body { position: relative; height: var(--body-h, 576px); }

/* ---------- Нүд (Figma "day": Default / Variant2 / Variant4) ---------- */
.slot {
    position: absolute; left: 4px; right: 4px;
    display: flex; flex-direction: column; gap: 8px;
    padding: 12px; border-radius: 8px; overflow: hidden;
}
.slot__info { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.slot__time { display: flex; gap: 8px; font-size: 16px; line-height: 1; white-space: nowrap; }
.slot__label { margin: 0; font-size: 14px; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Захиалсан */
.slot--booked { background: rgba(0, 0, 0, .05); }
.slot--booked .slot__time { color: rgba(0, 0, 0, .3); }
.slot--booked .slot__label { color: rgba(0, 0, 0, .7); }

/* Сул цаг */
.slot--free {
    justify-content: space-between;
    background: rgba(0, 255, 0, .05); border: 1px solid rgba(0, 255, 0, .3);
}
.slot--free .slot__time { color: rgba(0, 0, 0, .5); }
.slot--free .slot__label { color: rgba(0, 0, 0, .8); }

/* Хичээл */
.slot--class { background: rgba(0, 255, 0, .05); border: 1px solid rgba(0, 255, 0, .3); }
.slot--class .slot__time { color: #82c91e; }
.slot--class .slot__label { color: rgba(0, 0, 0, .8); }

/* Цуцлагдсан */
.slot--cancelled { background: rgba(255, 0, 0, .05); border: 1px solid rgba(255, 0, 0, .05); }
.slot--cancelled .slot__time { color: rgba(255, 0, 0, .5); }
.slot--cancelled .slot__label { color: rgba(255, 0, 0, .4); }

/* "Цаг захиалах" — Figma button Small/Primary/Outline */
.slot__btn {
    display: flex; align-items: center; justify-content: center; gap: 4px; width: 100%; flex: none;
    padding: 8px 16px; border: 1px solid rgba(0, 0, 255, .2); border-radius: 6px;
    background: transparent; color: #3232b5; cursor: pointer;
    font-size: 14px; font-weight: 500; line-height: 1; white-space: nowrap;
    transition: background-color .2s, border-color .2s;
}
/* Hover: border 50%, цайвар хөх дэвсгэр */
.slot__btn:hover { border-color: rgba(0, 0, 255, .5); background: linear-gradient(90deg, rgba(102, 126, 234, .1), rgba(118, 75, 162, .1)); }

/* "Бүтэн захиалах" — Figma button Small/Primary */
.day__foot { padding: 8px 4px 0; border-top: 1px solid rgba(0, 0, 0, .1); }
.day__btn {
    display: flex; align-items: center; justify-content: center; gap: 4px; width: 100%;
    padding: 8px 16px; border: 0; border-radius: 6px; cursor: pointer;
    background: var(--gradient); color: #fff;
    font-size: 14px; font-weight: 500; line-height: 1; white-space: nowrap;
    transition: opacity .2s;
}
.day__btn:hover { opacity: .7; }                    /* Figma: Hover opacity 70% */
.day__btn:disabled { opacity: .35; cursor: not-allowed; }

/* ---------- Танхимын танилцуулга (Figma "article 2") ---------- */
.room-info {
    display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 48px;
    align-items: start; padding-top: 48px; padding-bottom: 48px;
}
.room-info__img { border-radius: 24px; overflow: hidden; aspect-ratio: 2 / 1; background: rgba(0, 0, 0, .9); filter: drop-shadow(8px 8px 5px rgba(13, 39, 80, .04)); }
.room-info__img img { width: 100%; height: 100%; object-fit: cover; }
.room-info__text { display: flex; flex-direction: column; gap: 20px; }
.room-info__text h1 { margin: 0; font-size: 48px; font-weight: 700; line-height: 1.2; color: rgba(0, 0, 0, .9); }
.room-info__text p { margin: 0; font-size: 16px; line-height: 1.6; color: rgba(0, 0, 0, .6); }

/* "Google map" — Figma button Large/Primary/Outline (Hover: 5% дэвсгэр, 50% хүрээ) */
.btn-outline {
    display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
    padding: 12px 24px; border: 1px solid rgba(0, 0, 255, .2); border-radius: 999px;
    color: #3232b5; font-size: 18px; font-weight: 500; line-height: 1.32;
    transition: background-color .2s, border-color .2s;
}
.btn-outline .icon { width: 20px; height: 20px; }
.btn-outline:hover { background: rgba(0, 0, 255, .05); border-color: rgba(0, 0, 255, .5); }

/* ---------- Захиалгын цонх ---------- */
.booking-slot {
    display: flex; flex-direction: column; gap: 4px; padding: 12px 16px; border-radius: 12px;
    background: rgba(0, 255, 0, .05); border: 1px solid rgba(0, 255, 0, .3);
    font-size: 16px; color: rgba(0, 0, 0, .8);
}
.booking-slot b { color: #3232b5; }
.auth-btn .icon { width: 16px; height: 16px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .room-info { grid-template-columns: 1fr; gap: 32px; }
    .room-info__text h1 { font-size: 36px; }
}
@media (max-width: 768px) {
    .booking { padding-top: 24px; padding-bottom: 24px; }
    .booking__hours { width: 58px; }
    .hour { font-size: 13px; }
    .day { width: 150px; }
    .room-info { padding-top: 24px; }
    .room-info__img { border-radius: 16px; }
    .room-info__text h1 { font-size: 28px; }
    .crumbs__inner { font-size: 13px; }
}
.header__actions .btn .icon--log-in { width: 20px; height: 20px; }

/* ---------- Цагийн сонголт (захиалгын цонх) ---------- */
.booking__empty { padding: 48px 0; color: rgba(0, 0, 0, .5); }
.slot--small { padding: 8px 12px; gap: 4px; }
.slot--small .slot__info { gap: 4px; }
.slot--small .slot__label { display: none; }
.booking-hours { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 8px; max-height: 240px; overflow-y: auto; }
.booking-hour {
    display: flex; align-items: center; gap: 8px; padding: 8px 12px; cursor: pointer;
    background: #fff; border: 1px solid rgba(0, 0, 0, .1); border-radius: 999px;
    font-size: 14px; line-height: 1;
}
.booking-hour:has(input:checked) { border-color: rgba(0, 0, 255, .5); background: rgba(0, 0, 255, .05); color: #3232b5; }
.booking-hour input { accent-color: #3232b5; margin: 0; }
.booking-hour span { white-space: nowrap; }
.slot--compact { padding: 8px 12px; gap: 6px; }
.slot--compact .slot__label { display: none; }
.slot--compact .slot__btn { padding: 6px 8px; }
.booking-hour em { margin-left: auto; font-style: normal; font-size: 12px; color: rgba(0, 0, 0, .5); }
.booking-total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 12px; padding-top: 12px; border-top: 1px dashed rgba(0, 0, 0, .2); }
.booking-total b { font-size: 20px; color: #3232b5; }
@media (max-width: 480px) { .booking-hours { grid-template-columns: 1fr; } }

/* 1 цагийн сул нүд: цаг + жижиг дугуй товч нэг мөрөнд (товч таслагдахгүй) */
.slot--small.slot--free { flex-direction: row; align-items: center; justify-content: space-between; gap: 6px; padding: 6px 6px 6px 10px; }
.slot--small.slot--free .slot__info { flex: 1; }
.slot--small.slot--free .slot__time { gap: 6px; font-size: 15px; }
.slot--small .slot__btn { width: 32px; height: 32px; padding: 0; flex: none; border-radius: 999px; font-size: 0; gap: 0; }
.slot--small .slot__btn .icon { width: 16px; height: 16px; }

/* Танхимын тайлбар (editor HTML) ба үнэ */
.room-info__desc { font-size: 16px; line-height: 1.6; color: rgba(0, 0, 0, .6); overflow-wrap: anywhere; }
.room-info__desc p { margin: 0 0 8px; }
.room-info__desc > :last-child { margin-bottom: 0; }
.room-info__desc ul, .room-info__desc ol { margin: 0 0 8px; padding-left: 1.3em; }
.room-info__prices { margin: 0; display: flex; flex-direction: column; }
.room-info__prices div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid rgba(0, 0, 0, .1); font-size: 16px; }
.room-info__prices dt { color: rgba(0, 0, 0, .5); }
.room-info__prices dd { margin: 0; font-weight: 600; color: #3232b5; text-align: right; }


/* =========================================================
   Танхимын жагсаалт (Figma "Room list" 845:40910)
   style.css-ийн дараа холбоно (room.css шаардлагагүй).
   ========================================================= */

body { position: relative; }

/* Хуудасны дээд хэсгийн сакура дэлбээ (Figma: 1920×940, 50%) */
.petal-field--page { top: 0; height: 940px; z-index: 40; opacity: 1; }   /* Figma: энэ хуудсанд 100% */

/* ---------- Жагсаалт ---------- */
.rooms { display: flex; flex-direction: column; gap: 24px; padding-top: 24px; padding-bottom: 84px; }   /* 24 + footer хүртэл 60 */
.rooms__title { margin: 0; font-size: 36px; font-weight: 700; line-height: 1.4; color: #000; }
.rooms__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; align-items: start; }

/* Карт — Figma "leason" type=room */
.room-card {
    display: flex; flex-direction: column; overflow: hidden;
    background: #fff; border: 1px solid var(--grey-200); border-radius: 12px;
    color: inherit;
}
.room-card__img { aspect-ratio: 16 / 9; overflow: hidden; }
.room-card__img img { width: 100%; height: 100%; object-fit: cover; }
.room-card__body { display: flex; flex-direction: column; gap: 20px; padding: 20px 24px 24px; }
.room-card__txt { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.room-card__title {
    margin: 0; font-size: 20px; font-weight: 500; line-height: 1.4; color: rgba(0, 0, 0, .8);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.room-card__desc { margin: 0; font-size: 16px; line-height: 1; color: rgba(0, 0, 0, .6); overflow: hidden; text-overflow: ellipsis; }

/* "Цаг захиалах" — Figma button Medium/Primary/Outline
   Hover: хүрээ 50%, цайвар градиент дэвсгэр */
.room-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;   /* 40px өндөр */
    color: #3232b5; font-size: 16px; font-weight: 500; line-height: 1; white-space: nowrap;
    transition: background-color .2s, border-color .2s;
}
.room-card__btn .icon { width: 16px; height: 16px; }
.room-card:hover .room-card__btn {
    border-color: rgba(0, 0, 255, .5);
    background: linear-gradient(90deg, rgba(102, 126, 234, .1), rgba(118, 75, 162, .1));
}

/* ---------- Хуудаслалт (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; }
/* Outline hover: 5% дэвсгэр, 50% хүрээ */
a.pager__item:hover { background: rgba(0, 0, 255, .05); border-color: rgba(0, 0, 255, .5); }
/* Идэвхтэй: градиент (hover: 70%) */
.pager__item.is-active { border-color: transparent; background: var(--gradient); color: #fff; }
.pager__item.is-active:hover { background: var(--gradient); opacity: .7; }
.pager__gap { cursor: default; }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) { .rooms__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px)  { .rooms__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 768px) {
    .rooms__title { font-size: 28px; }
    .rooms__grid { gap: 16px; }
    .room-card__body { padding: 16px; gap: 16px; }
    .room-card__title { font-size: 17px; }
    .room-card__desc { font-size: 14px; line-height: 1.3; }
    .room-card__btn { padding: 10px 12px; font-size: 14px; }
    .pager { gap: 6px; }
    .pager__item { min-width: 40px; height: 40px; padding: 8px; font-size: 16px; }
}
@media (max-width: 480px) { .rooms__grid { grid-template-columns: 1fr; } }

/* ---------- Динамик өгөгдөл (halls.jsp) ---------- */
/* text нь editor-ийн HTML байж болох тул 2 мөрөөр тасална */
.room-card__desc {
    line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere;
}
.room-card__desc * { display: inline; margin: 0; padding: 0; font: inherit; color: inherit; background: none; border: 0; }
.room-card__desc img, .room-card__desc table, .room-card__desc iframe, .room-card__desc br { display: none; }
.room-card__price { margin: 0; font-size: 14px; line-height: 1; color: rgba(0, 0, 0, .5); }
.room-card__price b { font-size: 16px; font-weight: 600; color: #3232b5; }
.rooms__empty { margin: 0; padding: 64px 24px; text-align: center; font-size: 16px; color: rgba(0, 0, 0, .5); background: #fff; border: 1px dashed rgba(0, 0, 0, .2); border-radius: 24px; }