/* ==========================================================================
   PORTAL LIGHTBOX SYSTEM - REFINED PROPORTIONS
   ========================================================================== */

/* 1. Root Portal Container */
.c-universal-portal {
    position: fixed !important;
    inset: 0 !important;
    z-index: 2147483647 !important;
    display: none;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.c-universal-portal.is-visible {
    display: flex !important;
}

/* 2. Backdrop Overlay */
.c-universal-portal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(15px);
}

/* 3. The Window Container (Desktop) */
.c-universal-portal__window {
    position: relative;
    background: #171717;
    width: 90vw;
    max-width: 1100px;
    height: 650px;
    /* FIXED HEIGHT FOR DESKTOP CONSISTENCY */
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: portalFadeUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.c-universal-portal__close,
.c-lb-corner-save {
    position: absolute;
    top: 1.25rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10000;
    transition: all 0.2s ease;
    backdrop-filter: blur(5px);
}

.c-universal-portal__close {
    right: 1.25rem;
}

.c-lb-corner-save {
    left: 1.25rem;
}

.c-universal-portal__close:hover,
.c-lb-corner-save:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.05);
}

.c-universal-portal__close i,
.c-lb-corner-save i {
    font-size: 1.1rem;
}

@keyframes portalFadeUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.c-universal-portal__scroller {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.c-universal-portal__body {
    display: flex;
    flex-direction: row;
    height: 100%;
}

/* 4. Desktop Media (Fixed 1:1) */
.c-universal-portal__media {
    width: 650px;
    /* Match Height for 1:1 */
    height: 650px;
    flex: none;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.c-universal-portal__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Specific override for placeholder logos to prevent "huge & cropped" issue */
.u-image-placeholder img {
    width: auto !important;
    height: auto !important;
    max-width: 120px;
    max-height: 120px;
    object-fit: contain !important;
}

.c-universal-portal__media:hover .c-lb-nav {
    opacity: 1;
}

/* 5. Desktop Info (Fixed Actions & Header) */
.c-universal-portal__info {
    flex: 1;
    height: 650px;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.02);
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.c-universal-portal__content-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    height: 100%;
    min-height: 0;
}

.c-universal-portal__header {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 1.25rem !important;
    margin-bottom: 2rem !important;
    flex: none;
}

/* Hide Top Part in Focused Modes */
.is-desc-focused .c-universal-portal__header,
.is-desc-focused .c-universal-portal__title,
.is-desc-focused .c-universal-portal__price-row,
.is-desc-focused .c-lb-stats-bar,
.is-reviews-focused .c-universal-portal__header,
.is-reviews-focused .c-universal-portal__title,
.is-reviews-focused .c-universal-portal__price-row,
.is-reviews-focused .c-lb-stats-bar,
.is-comments-focused .c-universal-portal__header,
.is-comments-focused .c-universal-portal__title,
.is-comments-focused .c-universal-portal__price-row,
.is-comments-focused .c-lb-stats-bar,
.is-amenities-focused .c-universal-portal__header,
.is-amenities-focused .c-universal-portal__title,
.is-amenities-focused .c-universal-portal__price-row,
.is-amenities-focused .c-lb-stats-bar,
.is-booking-focused .c-universal-portal__header,
.is-booking-focused .c-universal-portal__title,
.is-booking-focused .c-universal-portal__price-row,
.is-booking-focused .c-lb-stats-bar {
    display: none !important;
}

.c-universal-portal__user {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.c-universal-portal__meta-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    margin-top: 0;
}

.c-universal-portal__location {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.c-universal-portal__rating {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding-left: 1rem;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.u-rating-val {
    color: var(--color-text-primary);
    font-weight: 700;
}

.c-universal-portal__avatar {
    width: 52px !important;
    height: 52px !important;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--color-primary);
    padding: 2px;
    flex: none;
}

.c-universal-portal__title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    flex: none;
}

.c-universal-portal__price-row {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.6rem;
    margin-bottom: 1rem;
}

.c-universal-portal__price {
    font-size: 1.25rem; /* Smaller, highly integrated description column price */
    font-weight: 700;
    color: var(--color-primary);
    margin-top: 0.25rem;
    margin-bottom: 0.75rem;
}

.c-universal-portal__price .u-currency {
    width: 1.1em;
    height: 0.65em;
    background-color: var(--color-primary);
    display: inline-block;
    vertical-align: middle;
}

.c-lb-reviews-link {
    background: none;
    border: none;
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.2s;
    padding: 0.5rem;
    border-radius: 8px;
}

.c-lb-reviews-link:hover {
    color: var(--color-primary);
    background: rgba(29, 155, 240, 0.05);
}

.c-lb-reviews-link i {
    font-size: 1.1rem;
}

/* Lightbox Reviews View */
.c-lb-reviews-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-border);
}

/* Back Button - Minimalist Inline Text & Icon Link (No Button capsule wrapper) */
.c-lb-back-btn {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    color: rgba(255, 255, 255, 0.6) !important;
    font-size: 0.95rem !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    transition: color 0.2s ease, transform 0.2s ease !important;
}

.c-lb-back-btn i {
    font-size: 1.25rem !important;
}

.c-lb-back-btn:hover {
    color: #fff !important;
    transform: translateX(-3px) !important;
}

/* Ensure headers clear the absolute close button */
.c-lb-comments-header,
.c-lb-reviews-header,
.is-desc-focused .c-lb-desc-back {
    padding-right: 60px !important;
}

.c-lb-reviews-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.c-review-card--mini {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.c-review-card--mini .c-review-card__header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.c-review-card--mini .c-review-card__avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.c-review-card--mini .c-review-card__info {
    flex: 1;
}

.c-review-card--mini .c-review-card__name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--color-text-primary);
}

.c-review-card--mini .c-review-card__stars {
    font-size: 0.7rem;
    color: #FFD700;
    display: flex;
    gap: 2px;
}

.c-review-card--mini .c-review-card__text {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--color-text-secondary);
}

.c-universal-portal__desc-container {
    position: relative;
    margin-bottom: 1.5rem;
}

.c-universal-portal__desc {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--color-text-secondary);
    display: inline;
    word-break: break-word;
}

.c-universal-portal__desc-full {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--color-text-secondary);
    white-space: pre-line;
    flex: 1;
    overflow: visible !important;
    height: auto !important;
}

.c-lb-view-more {
    background: none;
    border: none;
    color: var(--color-primary);
    font-weight: 500;
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0;
    margin-left: 0.4rem;
    display: inline-block;
    vertical-align: baseline;
    opacity: 0.9;
    transition: opacity 0.2s;
}

.c-lb-view-more:hover {
    opacity: 1;
    text-decoration: underline;
}

/* Hide View More globally when focused */
.is-desc-focused .c-lb-view-more {
    display: none !important;
}

/* Hide social icons only on Desktop when expanded */
@media (min-width: 768px) {

    .is-desc-focused .c-universal-portal__actions,
    .is-reviews-focused .c-universal-portal__actions,
    .is-amenities-focused .c-universal-portal__actions,
    .is-booking-focused .c-universal-portal__actions {
        display: none !important;
    }
}

.c-universal-portal__info.is-desc-focused,
.c-universal-portal__info.is-reviews-focused,
.c-universal-portal__info.is-amenities-focused,
.c-universal-portal__info.is-booking-focused {
    display: block !important;
    height: auto !important;
    /* Let it grow */
    overflow-y: visible !important;
    /* Don't trap scroll */
}

@media (min-width: 768px) {

    .c-universal-portal__info.is-desc-focused,
    .c-universal-portal__info.is-reviews-focused,
    .c-universal-portal__info.is-amenities-focused,
    .c-universal-portal__info.is-booking-focused {
        overflow: hidden !important;
        height: 100% !important;
        padding-top: 2rem !important;
    }

    .c-universal-portal__info.is-comments-focused,
    .c-universal-portal__info.is-reviews-focused,
    .c-universal-portal__info.is-booking-focused {
        height: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
        padding: 0 !important; /* Push header to the very top to align perfectly with the absolute close button */
    }
}

#js-lb-main-view {
    flex: 1;
    overflow-y: auto;
    padding-right: 0.5rem;
    display: flex;
    flex-direction: column;
}

.is-desc-focused .c-universal-portal__desc,
.is-desc-focused .c-lb-view-more {
    display: none !important;
}

.is-desc-focused .c-universal-portal__desc-full {
    display: block !important;
    height: auto !important;
    overflow: visible !important;
}

.c-universal-portal__desc::-webkit-scrollbar {
    width: 4px;
}

.c-universal-portal__desc::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.c-universal-portal__actions {
    position: absolute;
    bottom: 1rem;
    right: 1.25rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
    z-index: 10;
    background: transparent;
    backdrop-filter: none;
    padding: 0;
    border-radius: 0;
}

.c-universal-portal__actions .c-portal-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
}

.c-universal-portal__actions .c-portal-btn span {
    display: none;
}

.c-universal-portal__actions .c-portal-btn i {
    font-size: 1.05rem;
}

/* The contact/actions section is an independent bottom bar inside the window:
   hide it in every focused (reading / sub-view) mode — including the
   "View More" full-description view. */
.c-universal-portal__window:has(.c-universal-portal__info.is-desc-focused) #js-universal-actions,
.c-universal-portal__window:has(.c-universal-portal__info.is-reviews-focused) #js-universal-actions,
.c-universal-portal__window:has(.c-universal-portal__info.is-comments-focused) #js-universal-actions,
.c-universal-portal__window:has(.c-universal-portal__info.is-amenities-focused) #js-universal-actions,
.c-universal-portal__window:has(.c-universal-portal__info.is-booking-focused) #js-universal-actions {
    display: none !important;
}

/* Focused Description State */
.c-universal-portal__info.is-desc-focused .c-universal-portal__header,
.c-universal-portal__info.is-desc-focused .c-universal-portal__title,
.c-universal-portal__info.is-desc-focused .c-universal-portal__price-row {
    display: none !important;
}

.c-universal-portal__info.is-desc-focused .c-universal-portal__desc {
    padding-top: 2rem;
    font-size: 1.1rem;
    line-height: 1.8;
}

.c-lb-desc-back {
    display: none;
    margin-bottom: 1.5rem;
    background: none;
    border: none;
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    align-items: center;
    gap: 0.5rem;
    padding: 0;
    transition: color 0.2s;
}

.c-lb-desc-back:hover {
    color: var(--color-primary);
}

.c-universal-portal__info.is-desc-focused .c-lb-desc-back {
    display: flex;
}

/* ==========================================================================
   MOBILE RESET (CRITICAL FIX)
   ========================================================================== */
@media (max-width: 767px) {
    .c-universal-portal {
        background: #121212 !important;
    }

    /* Focused sub-views (desc/reviews/comments/amenities/booking) hide the media
       on mobile for a clean full-screen reading view. On desktop the media stays
       and the focused view is confined to the .c-universal-portal__info column. */
    .c-universal-portal:has(.c-universal-portal__info.is-desc-focused) .c-universal-portal__media,
    .c-universal-portal:has(.c-universal-portal__info.is-reviews-focused) .c-universal-portal__media,
    .c-universal-portal:has(.c-universal-portal__info.is-comments-focused) .c-universal-portal__media,
    .c-universal-portal:has(.c-universal-portal__info.is-amenities-focused) .c-universal-portal__media,
    .c-universal-portal:has(.c-universal-portal__info.is-booking-focused) .c-universal-portal__media {
        display: none !important;
    }

    .c-universal-portal__window {
        position: fixed !important;
        inset: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        max-width: none !important;
        max-height: none !important;
        border-radius: 0 !important;
        border: none !important;
        background: #121212 !important;
        margin: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    .c-universal-portal__scroller {
        display: block !important;
        flex: 1 !important;
        min-height: 0 !important;
        height: auto !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .c-universal-portal__body {
        display: block !important;
        overflow: visible !important;
    }

    .c-universal-portal__media {
        width: 100% !important;
        aspect-ratio: 1/1 !important;
        height: auto !important;
    }

    .c-universal-portal__info {
        width: 100% !important;
        padding: 1.5rem !important;
        padding-bottom: 7rem !important;
        background: none !important;
        height: auto !important;
    }

    .c-universal-portal__desc {
        overflow: hidden !important;
        /* Prevent scroll on preview */
        height: auto !important;
        flex: none !important;
        padding-right: 0 !important;
    }

    .c-universal-portal__actions {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 110 !important;
        background: #121212 !important;
        padding: 0.9rem 1.5rem !important;
        padding-bottom: calc(0.9rem + env(safe-area-inset-bottom, 0px)) !important;
        border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
        border-radius: 0 !important;
        justify-content: center !important;
        gap: 1.5rem !important;
        flex-wrap: nowrap !important;
        margin: 0 !important;
    }

    /* Portal Buttons */
    .c-portal-btn {
        width: 42px !important;
        height: 42px !important;
        border-radius: 50% !important;
        padding: 0 !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .c-portal-btn span {
        display: none !important;
    }

    .c-portal-btn i {
        font-size: 1.2rem !important;
    }

    .c-universal-portal__close {
        position: fixed !important;
        top: 1rem !important;
        right: 1rem !important;
        z-index: 1000 !important;
    }
}

/* Common Components */
.c-universal-portal__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

/* Gallery Navigation */
.c-lb-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s;
    opacity: 0;
}

.c-universal-portal__media:hover .c-lb-nav {
    opacity: 1;
}

.c-lb-nav:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: translateY(-50%) scale(1.1);
}

.c-lb-nav--prev { left: 1rem; }
.c-lb-nav--next { right: 1rem; }

.c-lb-gallery-dots {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    z-index: 10;
}

.c-lb-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transition: all 0.2s;
}

.c-lb-dot--active {
    background: #fff;
    transform: scale(1.3);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.c-portal-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.85rem;
    border-radius: 12px;
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    transition: transform 0.2s;
}

.c-portal-btn--whatsapp {
    background: #25D366;
}

.c-portal-btn--viber {
    background: #7360f2;
}

.c-portal-btn--telegram {
    background: #0088cc;
}

.c-portal-btn--call {
    background: var(--color-primary);
}

.c-lb-corner-save {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    z-index: 50;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.c-lb-corner-save:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.c-lb-corner-save.is-saved {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
    box-shadow: 0 0 20px rgba(29, 155, 240, 0.4);
}

.c-lb-stats-bar {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.c-lb-stat-item {
    background: none;
    border: none;
    color: var(--color-text-secondary);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    transition: all 0.2s;
}

.c-lb-stat-item:hover {
    color: var(--color-text-primary);
}

.c-lb-stat-item i {
    font-size: 1.25rem;
}

.c-lb-stat-item.is-liked {
    color: #f91880;
}

.c-lb-stat-item.is-liked i {
    color: #f91880;
}

/* ==========================================================================
   COMMENTS VIEW (Instagram-style, full-width of info panel)
   ========================================================================== */

#js-lb-comments-view,
#js-lb-reviews-view,
#js-lb-amenities-view,
#js-lb-booking-view {
    display: none;
    flex-direction: column;
    height: 100%;
    width: 100%;
    position: absolute;
    inset: 0;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    min-height: 0;
    z-index: 5;
    background: #16181b;
}

#js-lb-booking-view {
    overflow-y: auto;
}

.c-universal-portal__info:has(.is-comments-focused) #js-lb-comments-view,
.c-universal-portal__info:has(.is-reviews-focused) #js-lb-reviews-view {
    display: flex !important;
}

.c-universal-portal__info:has(.is-booking-focused) #js-lb-booking-view,
.c-universal-portal__info:has(.is-amenities-focused) #js-lb-amenities-view {
    display: block !important;
}

/* Hide the media gallery slider (prev/next arrows + dots) when a sub-view is open */
.c-universal-portal:has(.is-comments-focused) .c-lb-nav,
.c-universal-portal:has(.is-comments-focused) .c-lb-gallery-dots,
.c-universal-portal:has(.is-reviews-focused) .c-lb-nav,
.c-universal-portal:has(.is-reviews-focused) .c-lb-gallery-dots,
.c-universal-portal:has(.is-amenities-focused) .c-lb-nav,
.c-universal-portal:has(.is-amenities-focused) .c-lb-gallery-dots,
.c-universal-portal:has(.is-booking-focused) .c-lb-nav,
.c-universal-portal:has(.is-booking-focused) .c-lb-gallery-dots {
    display: none !important;
}

.is-comments-focused #js-lb-comments-view,
.is-reviews-focused #js-lb-reviews-view {
    display: flex !important;
}

.is-comments-focused #js-lb-comments-view {
    background: rgba(0, 0, 0, 0.25);
}

.js-lb-comment-sticky,
.js-lb-review-sticky {
    width: 100% !important;
    box-sizing: border-box !important;
}

/* ---- Full-width comment bar ---- */
.c-lb-comment-bar {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    width: 100%;
    padding: 0.9rem 1.5rem 1.1rem;
    margin-top: auto;
    flex-shrink: 0;
    position: relative;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.c-lb-comment-bar .c-lb-comment-input {
    flex: 1;
    min-height: 46px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 23px;
    color: #fff;
    font-size: 0.95rem;
    padding: 0.85rem 1.15rem;
    outline: none;
    resize: none;
    line-height: 1.4;
    caret-color: var(--color-primary);
    transition: border-color 0.2s, background 0.2s;
}

.c-lb-comment-bar .c-lb-comment-input::placeholder {
    color: var(--color-text-secondary);
    opacity: 0.7;
}

.c-lb-comment-bar .c-lb-comment-input:focus {
    border-color: var(--color-primary);
    background: rgba(255, 255, 255, 0.08);
}

.c-lb-comment-submit {
    background: var(--color-primary);
    border: none;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0.35;
    pointer-events: none;
    transition: all 0.2s;
    flex-shrink: 0;
}

.c-lb-comment-submit i {
    font-size: 1.2rem;
}

.c-lb-comment-bar .js-comment-counter {
    position: absolute;
    right: 4.4rem;
    bottom: 0.35rem;
    font-size: 0.62rem;
    color: var(--color-text-secondary);
    opacity: 0.55;
    pointer-events: none;
}

/* ---- Guest / admin bar ---- */
.c-lb-login-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    padding: 1.1rem 1.5rem 1.25rem;
    margin-top: auto;
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.c-lb-login-bar p {
    margin: 0;
    color: var(--color-text-secondary);
    font-size: 0.9rem;
}

.c-lb-login-note {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-text-secondary);
    font-size: 0.9rem;
}

.c-lb-login-btn {
    background: var(--color-primary);
    color: #fff;
    border: none;
    padding: 0.55rem 1.25rem;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    text-decoration: none;
    transition: filter 0.2s;
}

.c-lb-login-btn:hover {
    filter: brightness(1.1);
}

/* ---- Comments Header ---- */
.c-lb-comments-header {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 1.1rem 1.5rem 1rem;
    flex: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    position: relative;
    width: 100%;
    background: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    min-height: auto !important;
    margin-bottom: 0;
}

/* Comments Count - Minimal Plain Text with Pill Badge */
.c-lb-comments-count {
    display: inline-flex;
    align-items: baseline;
    gap: 0.45rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    background: none !important;
    border: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.c-lb-comments-count .c-lb-count-badge {
    font-size: 0.7rem;
    font-weight: 700;
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    padding: 0.15rem 0.55rem;
    border-radius: 20px;
}

/* ---- Comments List ---- */
.c-lb-comments-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 1.25rem 1.5rem 0.5rem;
    display: flex;
    flex-direction: column;
}

.c-lb-comments-list::-webkit-scrollbar {
    width: 4px;
}

.c-lb-comments-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

/* ---- Comment Item ---- */
.c-comment-item {
    display: flex;
    gap: 0.9rem;
    margin-bottom: 1.4rem;
    animation: commentFadeIn 0.3s ease;
}

@keyframes commentFadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.c-lb-comment-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), #8d4bff);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    flex: none;
    overflow: hidden;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.06);
}

.c-comment-item__content {
    flex: 1;
    min-width: 0;
}

.c-comment-item__user {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.2rem;
}

.c-comment-item__time {
    font-weight: 400;
    color: var(--color-text-secondary);
    font-size: 0.75rem;
    margin-left: 0.5rem;
    opacity: 0.75;
}

.c-comment-item__text {
    font-size: 0.92rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.92);
    margin-bottom: 0.35rem;
    word-break: break-word;
}

.c-comment-item__actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.1rem;
}

.c-comment-item__actions button {
    background: none;
    border: none;
    padding: 0;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: color 0.2s;
}

.c-comment-item__actions button:hover {
    color: var(--color-primary);
}

.c-comment-item__actions button i {
    font-size: 0.9rem;
}

/* ---- Empty state ---- */
.c-lb-comments-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    margin: auto;
    /* Centers the empty state in the available list area instead of
       pinning it to the top with a large void below. */
    padding: 3rem 1.5rem;
    color: var(--color-text-secondary);
    text-align: center;
}

.c-lb-comments-empty i {
    font-size: 2.4rem;
    color: var(--color-primary);
    opacity: 0.55;
}

.c-lb-comments-empty p {
    font-size: 0.9rem;
    margin: 0;
    opacity: 0.85;
}

/* Replies & Mentions */
.c-comment-item--reply {
    margin-top: 1rem;
    padding-left: 1.5rem;
    border-left: 2px solid rgba(255, 255, 255, 0.05);
}

.c-comment-item--reply .c-comment-item__avatar {
    width: 28px;
    height: 28px;
}

.u-mention {
    color: var(--color-primary);
    font-weight: 700;
}

.c-comment-item__view-replies {
    background: none;
    border: none;
    padding: 0;
    margin-top: 0.75rem;
    color: var(--color-text-secondary);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.c-comment-item__view-replies .u-line {
    display: block;
    width: 24px;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.c-comment-item__view-replies:hover {
    color: var(--color-text-primary);
}

.c-comment-item__replies {
    margin-top: 0.5rem;
}

/* Sticky Input Area */
.c-lb-comments-input-wrap {
    flex: none;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.c-lb-comments-input-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    flex: none;
}

.c-lb-comments-input-field {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    border: 1px solid transparent;
    transition: border-color 0.2s;
}

.c-lb-comments-input-field:focus-within {
    border-color: var(--color-primary);
}

.c-lb-comments-input-field textarea {
    flex: 1;
    background: none;
    border: none;
    color: #fff;
    font-size: 0.9rem;
    resize: none;
    padding: 0.25rem 0;
    max-height: 100px;
    font-family: inherit;
}

.c-lb-comments-input-field textarea:focus {
    outline: none;
}

.c-lb-comments-input-field button {
    background: none;
    border: none;
    color: var(--color-primary);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0.25rem 0;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.c-lb-comments-input-field textarea:not(:placeholder-shown)+button {
    opacity: 1;
}

/* Comments View (Sticky Bottom Logic) */
/* Reviews View (Flex Column for Sticky Footer) */
#js-lb-reviews-view {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.c-post__comment-box-seamless {
    flex-shrink: 0;
    background: #111;
    padding: 1.25rem 1.5rem 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 -10px 30px rgba(0,0,0,0.5);
    z-index: 10;
    margin-top: auto;
    width: 100%;
}

@media (max-width: 767px) {
    .c-universal-portal__close,
    .c-lb-corner-save {
        width: 40px !important;
        height: 40px !important;
        top: 1.25rem !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        background: rgba(0,0,0,0.5) !important;
        backdrop-filter: blur(10px) !important;
        z-index: 10000 !important;
        border: 1px solid rgba(255,255,255,0.1) !important;
    }

    .c-universal-portal__close {
        right: 1.25rem !important;
    }

    .c-lb-corner-save {
        left: 1.25rem !important;
    }

    #js-lb-corner-price-badge {
        top: auto !important;
        bottom: 1.25rem !important;
        right: 1.25rem !important;
    }
}

/* Back buttons match the property lightbox: icon-only 38px circle */
#js-universal-lightbox .c-lb-back-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    flex: none;
}

/* Mobile Adjustments for Comments & Reviews */
@media (max-width: 767px) {
    #js-lb-comments-view,
    #js-lb-reviews-view,
    #js-lb-amenities-view {
        position: fixed !important;
        inset: 0 !important;
        width: 100vw !important; /* Full-bleed: ignore the scrollbar gutter of the containing block */
        z-index: 30 !important;
        background: #121212 !important;
    }

    .js-lb-comment-sticky,
    .js-lb-review-sticky {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100vw !important; /* Full-bleed: ignore the scrollbar gutter of the containing block */
        z-index: 1000 !important;
        background: #111 !important;
        padding: 1rem 1.5rem 2.5rem !important; /* Proper breathing room and home bar space */
        box-shadow: 0 -15px 40px rgba(0,0,0,0.8) !important; /* Eliminate peek-through gaps */
        border-top: 1px solid rgba(255,255,255,0.1) !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    /* Ensure list doesn't get hidden behind fixed footer */
    .c-lb-comments-list {
        padding-bottom: 120px !important;
    }

    /* While a full-screen sub-view (reviews/comments/amenities) is open, strip
       the window's glass blur (backdrop-filter creates a containing block that
       drags the fixed input bar along when the window scrolls on mobile) and
       disable the window's own scrolling so the fixed bar binds to the viewport
       and can never leave empty space under it. */
    .c-universal-portal:has(.is-reviews-focused) .c-universal-portal__window.u-glass,
    .c-universal-portal:has(.is-comments-focused) .c-universal-portal__window.u-glass,
    .c-universal-portal:has(.is-amenities-focused) .c-universal-portal__window.u-glass {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        overflow-y: hidden !important;
    }
}

@media (min-width: 768px) {
    /* Desktop Close Button: Minimalist Cross (No Circle background/borders) */
    .c-universal-portal__close {
        background: none !important;
        border: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
        width: auto !important;
        height: auto !important;
        color: rgba(255, 255, 255, 0.55) !important;
        font-size: 1.35rem !important;
        top: 1.38rem !important; /* Positions it exactly inside the comments/reviews header vertically! */
        right: 1.5rem !important; /* Positions it exactly inside the comments/reviews header horizontally! */
        padding: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        transition: color 0.2s ease, transform 0.2s ease !important;
        z-index: 10000 !important;
    }
    .c-universal-portal__close:hover {
        color: #fff !important;
        transform: scale(1.15) !important;
    }
}

/* ==========================================================================
   MEDIA VIEWER - PRESERVE ORIGINAL IMAGE RATIO
   Images are contained instead of cropped so landscape, portrait and square
   photos all display in their natural aspect ratio.
   ========================================================================== */

.c-universal-portal__media {
    background: radial-gradient(circle at 50% 40%, #181b20 0%, #08090b 100%);
}

.c-universal-portal__media img {
    object-fit: contain;
}

/* ==========================================================================
   BLURRED BACKDROP FILL
   Non-square images leave empty space beside/above the contained photo.
   A blurred + darkened copy of the actual image fills that space behind it.
   ========================================================================== */

.c-lb-media-backdrop,
.c-lb-media-overlay {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.c-lb-media-backdrop {
    background-size: cover;
    background-position: center;
    filter: blur(30px) brightness(0.5);
    transform: scale(1.15);
}

.c-lb-media-overlay {
    background: rgba(0, 0, 0, 0.35);
}

#js-universal-img,
.u-image-placeholder {
    position: relative;
    z-index: 1;
}

/* ==========================================================================
   LINK POSTS - STANDARD LAYOUT
   Link posts render exactly like normal posts (picture + title + stats).
   Clicking the image opens the linked page.
   ========================================================================== */

/* ==========================================================================
   MOBILE - KEEP ORIGINAL RATIO, NO FORCED SQUARE
   ========================================================================== */

@media (max-width: 767px) {
    .c-universal-portal__media,
    #js-universal-lightbox .c-universal-portal__media {
        width: 100% !important;
        height: auto !important;
        aspect-ratio: auto !important;
        max-height: none !important;
    }

    #js-universal-lightbox .c-universal-portal__media #js-lb-gallery-container,
    .c-universal-portal__media #js-lb-gallery-container {
        height: auto !important;
    }

    .c-universal-portal__media img {
        width: 100% !important;
        height: auto !important;
        max-height: none !important;
        object-fit: contain !important;
    }

    #js-lb-media-backdrop,
    .c-lb-media-overlay {
        display: none !important;
    }

    .c-universal-portal:has(.is-comments-focused) .c-lb-corner-save,
    .c-universal-portal:has(.is-comments-focused) .c-universal-portal__close,
    .c-universal-portal:has(.is-reviews-focused) .c-lb-corner-save,
    .c-universal-portal:has(.is-reviews-focused) .c-universal-portal__close,
    .c-universal-portal:has(.is-amenities-focused) .c-lb-corner-save,
    .c-universal-portal:has(.is-amenities-focused) .c-universal-portal__close,
    .c-universal-portal:has(.is-booking-focused) .c-lb-corner-save,
    .c-universal-portal:has(.is-booking-focused) .c-universal-portal__close,
    .c-universal-portal:has(.is-desc-focused) .c-lb-corner-save,
    .c-universal-portal:has(.is-desc-focused) .c-universal-portal__close {
        display: none !important;
    }
}

/* Hide the save & close buttons while the full description ("View More")
   is expanded, so they never overlap the reading text. */
.c-universal-portal:has(.c-universal-portal__info.is-desc-focused) .c-lb-corner-save,
.c-universal-portal:has(.c-universal-portal__info.is-desc-focused) .c-universal-portal__close {
    display: none !important;
}

/* Utility: Glass effect */
.u-glass {
    background: rgba(20, 22, 25, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* The lightbox window has an opaque background, so backdrop-filter is purely
   decorative here — but it ALSO makes the window a containing block for its
   absolutely-positioned sub-views, which would blow them up across the whole
   card. Neutralise it so sub-views stay scoped to the info panel. */
.c-universal-portal__window {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

/* Avatar wrap & name in lightbox */
.c-universal-portal__avatar-wrap {
    position: relative;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
}

.c-universal-portal__name {
    font-weight: 600;
    color: #fff;
    font-size: 1rem;
}

/* "Page Owner" label next to a commenter's name */
.c-comment-owner-badge {
    display: inline-block;
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--color-primary);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 0.06rem 0.35rem;
    border-radius: 999px;
    vertical-align: middle;
    margin-left: 0.3rem;
    user-select: none;
}

/* ==========================================================================
   PROPERTY POSTS (resorts / hotels / guesthouses / excursions)
   Posts from property pages get a filled 1:1 crop in the preview lightbox
   instead of the contained (fit) layout used for marketplace posts.
   ========================================================================== */

.c-universal-portal.is-property-post .c-universal-portal__media img {
    object-fit: cover;
}

.c-universal-portal.is-property-post .c-lb-media-backdrop,
.c-universal-portal.is-property-post .c-lb-media-overlay {
    display: none !important;
}

@media (max-width: 767px) {
    #js-universal-lightbox.c-universal-portal.is-property-post .c-universal-portal__media {
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 1 / 1 !important;
        max-height: none !important;
    }

    #js-universal-lightbox.c-universal-portal.is-property-post #js-lb-gallery-container {
        height: 100% !important;
    }

    #js-universal-lightbox.c-universal-portal.is-property-post .c-universal-portal__media img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }
}