/* ==========================================================================
    MAZMO HOTEL PLUGIN STYLESHEET V1.5 (FINAL)
    ========================================================================== */

/* --- WIDGET SINGLE HOMESTAY (LAYOUT 2 KOLOM OTOMATIS) --- */

.mazmo-single-main-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
    align-items: start;
    width: 100%;
    max-width: 100%; /* cegah lebih dari layar */
    margin-left: auto;
    margin-right: auto;
}

.mazmo-single-booking-box {
    background-color: #f9f9f9;
    padding: 25px;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
}

.homestay-title-single {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 28px;
}

.homestay-price-single {
    font-size: 20px;
    font-weight: bold;
    color: #4CAF50;
    margin-top: 0;
    margin-bottom: 20px;
}

ul.homestay-facilities-single {
    list-style: none;
    padding: 0;
    margin: 0 0 25px 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

ul.homestay-facilities-single li {
    display: flex;
    align-items: center;
    font-size: 15px;
}

ul.homestay-facilities-single i {
    color: #0073aa;
    margin-right: 8px;
    width: 20px;
}

.form-group-single { margin-bottom: 15px; }
.form-group-single label { display: block; margin-bottom: 5px; font-weight: 500; }
.form-group-single input { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 6px; }

/* Perbaikan Tombol WhatsApp */

.mazmo-single-booking-box .booking-button-single {
    display: block;
    width: 100%;
}

.booking-button-single {
    width: 100%;
    background-color: #FFC107;
    color: #000 !important;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
    text-align: center;
    display: block;
}
.booking-button-single i {
    font-size: 1.2em; /* Mengatur ukuran ikon */
    margin-right: 8px; /* Jarak antara ikon dan teks */
    vertical-align: middle; /* Meratakan ikon secara vertikal */
}

/* Hover effect */
.booking-button-single:hover { background-color: #ffca2c; }
/* Disabled state */
.booking-button-single:disabled,
.booking-button-single.disabled-wa {
    background-color: #bdbdbd;
    color: #fff !important;
    cursor: not-allowed;
}

.total-price-single { text-align: center; font-weight: bold; margin-top: 15px; font-size: 18px; }

@media (max-width: 768px) {
    .mazmo-single-main-grid {
        grid-template-columns: 1fr !important; /* paksa 1 kolom */
    }

    .mazmo-single-booking-box {
        padding: 15px; /* kurangi padding agar tombol lebih lega */
    }

    .mazmo-single-booking-box .booking-button-single {
        display: block;
        width: 100%;
    }
}


.mazmo-single-main-grid > * {
    min-width: 0; 
}

/* --- GALERI INTERAKTIF (SINGLE WIDGET) --- */
.mazmo-single-gallery-container {
    width: 100%;
    position: relative;
    /* FIX: Pastikan tidak ada margin/padding vertikal berlebih */
    padding: 0;
    margin-bottom: 0 !important; 
}
.main-image-viewport {
    width: 100%;
    
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 15px;
    cursor: pointer;
    background-color: #f0f0f0;
    position: relative;
}

.main-image-viewport img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* FIX: Memaksa gambar mengisi wadah, mengatasi rasio berbeda */
    display: block;
    position: static;
}

.thumbnail-nav-container {
    display: flex;
    align-items: center;
    position: relative;
}

/* Mengizinkan gulir pada thumbnail dan menyembunyikan scrollbar */
.thumbnail-nav {
    display: flex;
    overflow-x: scroll;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    gap: 10px;
    flex-grow: 1;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.thumbnail-nav::-webkit-scrollbar {
    display: none;
}

.thumbnail-nav img {
    flex: 0 0 auto;
    width: calc(25% - 7.5px);
    min-width: 80px;
    aspect-ratio: 1 / 1; /* MEMASTIKAN RASIO THUMBNAIL PERSEGI (1:1) */
    height: auto; /* Mengikuti rasio */
    object-fit: cover; /* FIX: Memaksa gambar mengisi kotak 1:1, mengatasi rasio berbeda */
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s, opacity 0.2s;
    opacity: 0.5; /* Opacity default untuk yang tidak aktif */
    scroll-snap-align: center;
}

.thumbnail-nav img:hover { border-color: #aaa; }
.thumbnail-nav img.active {
    border-color: #0073aa;
    box-shadow: 0 0 5px rgba(0, 115, 170, 0.5);
    opacity: 1; /* Opacity penuh untuk yang aktif */
}

/* Menghapus style untuk panah navigasi */
.thumb-nav-arrow {
    display: none;
}

/* --- LIGHTBOX KUSTOM --- */
.mazmo-lightbox-overlay { 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(0, 0, 0, 0.85); 
    z-index: 99999; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    animation: fadeIn 0.3s ease;
    pointer-events: auto; /* Memastikan semua elemen di dalamnya bisa diklik */
}

.mazmo-lightbox-overlay.closing { 
    animation: fadeOut 0.3s ease forwards; 
}

@keyframes fadeIn { 
    from { opacity: 0; } 
    to { opacity: 1; } 
}

@keyframes fadeOut { 
    from { opacity: 1; } 
    to { opacity: 0; } 
}

.mazmo-lightbox-content { 
    position: relative; 
    max-width: 90vw; 
    max-height: 90vh; 
}

.mazmo-lightbox-content img { 
    width: auto;
    height: auto;
    max-width: 100%; 
    max-height: 100%;
    object-fit: contain;
    display: block; 
    border-radius: 4px; 
    transition: opacity 0.2s linear; 
}

.mazmo-lightbox-close, 
.mazmo-lightbox-prev, 
.mazmo-lightbox-next { 
    position: absolute; 
    color: #fff; 
    font-size: 35px; 
    font-weight: bold; 
    cursor: pointer; 
    user-select: none; 
    transition: color 0.2s; 
}

.mazmo-lightbox-close:hover, 
.mazmo-lightbox-prev:hover, 
.mazmo-lightbox-next:hover { 
    color: #bbb; 
}

.mazmo-lightbox-close { 
    top: 15px; 
    right: 35px; 
}

.mazmo-lightbox-prev, 
.mazmo-lightbox-next { 
    top: 50%; 
    transform: translateY(-50%); 
    padding: 16px; 
}

.mazmo-lightbox-prev { 
    left: 10px; 
}

.mazmo-lightbox-next { 
    right: 10px; 
}

/* --- WIDGET GRID HOMESTAY --- */
.mazmo-homestay-grid-wrapper { width: 100%; }
.mazmo-homestay-grid { display: grid; gap: 25px; }
.homestay-grid-item { border: 1px solid #e0e0e0; border-radius: 8px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.07); transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out; display: flex; flex-direction: column; background-color: #fff; }
.homestay-grid-item:hover { transform: translateY(-5px); box-shadow: 0 4px 15px rgba(0,0,0,0.1); }

/* FIX: Memberi wadah pada gambar grid dengan rasio 4:3 */
.grid-item-thumbnail {
    width: 100%;
    aspect-ratio: 4 / 3; 
    overflow: hidden;
}

.grid-item-thumbnail img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; /* FIX: Memaksa gambar mengisi area 4:3 */
    display: block; 
}

.grid-item-content { padding: 15px 20px; flex-grow: 1; display: flex; flex-direction: column; }
.grid-item-title { margin: 0 0 10px 0; font-size: 18px; line-height: 1.4; }
.grid-item-title a { text-decoration: none; color: #333; }
.grid-item-title a:hover { color: #0073aa; }
.grid-item-price { font-size: 16px; font-weight: bold; color: #4CAF50; margin-bottom: 15px; }
.grid-item-button { margin-top: auto; display: inline-block; background-color: #0073aa; color: #fff !important; padding: 10px 15px; border-radius: 5px; text-align: center; text-decoration: none; font-weight: 500; transition: background-color 0.2s; }
.grid-item-button:hover { background-color: #005a87; }
ul.grid-item-facilities { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 12px; margin: 0 0 15px 0; padding: 0; list-style: none; }
.grid-item-facilities li { display: flex; align-items: center; }
.grid-item-facilities i { margin-right: 8px; width: 20px; text-align: center; }
.grid-item-facilities .facility-text { font-size: 14px; }


/* --- PAGINATION --- */
.mazmo-pagination { margin-top: 40px; text-align: center; }
.mazmo-pagination .page-numbers { padding: 8px 14px; margin: 0 4px; border: 1px solid #ddd; border-radius: 5px; text-decoration: none; color: #333; transition: background-color 0.2s, color 0.2s; }
.mazmo-pagination .page-numbers:hover { background-color: #f0f0f0; }
.mazmo-pagination .page-numbers.current { background-color: #0073aa; color: #fff; border-color: #0073aa; }


/* --- STABILITAS FONT AWESOME --- */
.grid-item-facilities i.fas,
.homestay-facilities-single i.fas {
    font-family: 'Font Awesome 5 Free' !important;
    font-weight: 900 !important;
}
.grid-item-facilities i.far,
.homestay-facilities-single i.far {
    font-family: 'Font Awesome 5 Free' !important;
    font-weight: 400 !important;
}