/*
 * Hộp xem ảnh gốc của PHÒNG khách sạn — tự chứa, không mượn class/biến của theme.
 * Mọi class đều mang tiền tố hrl- (hotel room lightbox) nên không theme nào style trúng.
 * Không dùng !important: đã ở z-index cao nhất và không trùng tên với class của theme nào.
 */

/* Con trỏ báo "bấm được". Loại ô "No image"/ảnh mặc định ra: mở hộp xem ảnh gốc của một
   placeholder là hứa suông. File này chỉ nạp ở trang chi tiết khách sạn nên không chạm
   .room-thumbnail của du thuyền. */
.room-thumbnail img:not(.is-placeholder) {
    cursor: zoom-in;
}

.hrl-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    background: rgba(9, 11, 16, .94);
    opacity: 0;
    transition: opacity .18s ease;
    /* Vùng an toàn của máy có tai thỏ */
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.hrl-overlay.is-open {
    opacity: 1;
}

/* ===== Thanh trên: đếm ảnh + nút đóng ===== */
.hrl-bar {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    color: #fff;
}

.hrl-count {
    font: 500 14px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    letter-spacing: .02em;
    opacity: .85;
    font-variant-numeric: tabular-nums;
}

.hrl-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    cursor: pointer;
    transition: background .15s ease, transform .15s ease;
}

.hrl-btn:hover,
.hrl-btn:focus-visible {
    background: rgba(255, 255, 255, .24);
}

.hrl-btn:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.hrl-btn svg {
    width: 20px;
    height: 20px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ===== Khung ảnh ===== */
.hrl-stage {
    flex: 1 1 auto;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    padding: 0 16px;
    /* Vuốt ngang do JS xử lý, không để trình duyệt cuộn trang phía sau */
    touch-action: pan-y;
}

.hrl-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 6px;
    opacity: 1;
    transition: opacity .15s ease;
    /* Ảnh gốc khách sạn hay rất lớn: không để nó tràn ra ngoài khung */
    width: auto;
    height: auto;
}

.hrl-stage.is-loading .hrl-img {
    opacity: .25;
}

.hrl-spinner {
    position: absolute;
    width: 34px;
    height: 34px;
    border: 3px solid rgba(255, 255, 255, .25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: hrl-spin .7s linear infinite;
    display: none;
}

.hrl-stage.is-loading .hrl-spinner {
    display: block;
}

@keyframes hrl-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== Nút trái/phải ===== */
.hrl-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 46px;
    height: 46px;
    background: rgba(255, 255, 255, .14);
}

.hrl-nav:hover,
.hrl-nav:focus-visible {
    background: rgba(255, 255, 255, .28);
}

.hrl-prev {
    left: 10px;
}

.hrl-next {
    right: 10px;
}

/* ===== Chú thích + dải ảnh nhỏ ===== */
.hrl-foot {
    flex: 0 0 auto;
    padding: 10px 16px 16px;
    text-align: center;
}

.hrl-caption {
    margin: 0 0 10px;
    color: rgba(255, 255, 255, .8);
    font: 400 13px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    /* Tên phòng dài không được đẩy dải ảnh nhỏ xuống mất */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hrl-strip {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    justify-content: flex-start;
    padding: 2px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, .35) transparent;
}

/* Ít ảnh thì căn giữa cho cân, nhiều ảnh thì cuộn từ trái */
.hrl-strip.is-short {
    justify-content: center;
}

.hrl-strip::-webkit-scrollbar {
    height: 6px;
}

.hrl-strip::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .35);
    border-radius: 3px;
}

.hrl-thumb {
    flex: 0 0 auto;
    width: 74px;
    height: 52px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 5px;
    overflow: hidden;
    background: rgba(255, 255, 255, .08);
    cursor: pointer;
    opacity: .55;
    transition: opacity .15s ease, border-color .15s ease;
}

.hrl-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hrl-thumb:hover {
    opacity: .85;
}

.hrl-thumb.is-active {
    opacity: 1;
    border-color: #fff;
}

.hrl-thumb:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* Một ảnh thì không có gì để chuyển: giấu hẳn nút và dải ảnh nhỏ */
.hrl-overlay.is-single .hrl-nav,
.hrl-overlay.is-single .hrl-strip,
.hrl-overlay.is-single .hrl-count {
    display: none;
}

/* Khoá cuộn trang nền khi hộp ảnh đang mở */
body.hrl-lock {
    overflow: hidden;
}

@media (max-width: 575.98px) {
    .hrl-nav {
        width: 38px;
        height: 38px;
    }

    .hrl-prev {
        left: 4px;
    }

    .hrl-next {
        right: 4px;
    }

    .hrl-stage {
        padding: 0 6px;
    }

    .hrl-thumb {
        width: 58px;
        height: 42px;
    }
}

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

    .hrl-overlay,
    .hrl-img,
    .hrl-btn,
    .hrl-thumb {
        transition: none;
    }

    .hrl-spinner {
        animation-duration: 2s;
    }
}
