/**
 * Single Property Detail Page Styles
 * Based on Utopia Caribe property.css design system
 */

:root {
    --brand-color: #E0CDA2;
    --brand-color-dark: #b3a481;
}

.guesty-sp {
    font-family: 'Poppins', Sans-serif;
    font-size: 0.8rem;
}

/* ── Section Titles ── */
.guesty-sp-section-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.2rem;
    border-bottom: 1px solid var(--brand-color);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
}

/* ── Splash / Hero ── */
.guesty-sp-splash {
    height: 70dvh;
    position: relative;
}

.guesty-sp-splash img {
    width: 100%;
    height: 100%;
    position: absolute;
    left: 0;
    top: 0;
    object-fit: cover;
    object-position: center;
    z-index: 0;
}

.guesty-sp-splash .container {
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-end;
    padding-bottom: 1rem;
}

.guesty-sp-splash .btn-primary {
    background-color: var(--brand-color) !important;
    border-color: var(--brand-color) !important;
    color: black !important;
}

.guesty-sp-splash .btn-primary:hover {
    background-color: var(--brand-color-dark) !important;
    border-color: var(--brand-color-dark) !important;
}

/* ── Navigation ── */
.guesty-sp-navigation {
    position: sticky;
    top: 82px;
    z-index: 100;
    padding: 1rem;
    background: white;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

@media (max-width: 767px) {
    .guesty-sp-navigation {
        padding: 0.5rem;
        top: 63px;
        display: none;
    }
}

.guesty-sp-navigation .nav-pills .nav-link {
    color: black !important;
}

.guesty-sp-navigation .nav-pills .nav-link.active,
.guesty-sp-navigation .nav-pills .show > .nav-link {
    background-color: var(--brand-color);
    color: black;
}

.guesty-sp-navigation ul {
    margin: 0;
    padding: 0;
}

/* ── Description Section ── */
.guesty-sp-description {
    margin-bottom: 5rem;
}

.guesty-sp-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 2rem;
    font-weight: normal;
    margin: 0 0 0.25rem 0;
    line-height: 1.3;
}

.guesty-sp-location {
    font-size: 0.85rem;
    color: #666;
    margin: 0 0 0.5rem 0;
}

.guesty-sp-stats {
    padding: 1rem 0;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.guesty-sp-stat {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: #444;
}

.guesty-sp-stat svg {
    width: 24px;
    height: 24px;
}

.guesty-sp-desc-content {
    height: 200px;
    overflow: hidden;
    transition: all 500ms;
    transition-behavior: allow-discrete;
}

.guesty-sp-desc-content.open {
    height: auto;
}

.guesty-sp-desc-content ul {
    margin-left: 1rem;
}

.guesty-sp-desc-heading {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1rem;
    font-weight: 600;
    margin: 1.5rem 0 0.5rem;
}

/* ── View More / Less ── */
.guesty-sp-view-more {
    position: relative;
    text-align: center;
    margin: 1rem 0;
}

.guesty-sp-view-more a {
    padding: 0.5rem 1rem;
    color: var(--brand-color) !important;
    text-decoration: none;
    background: white;
    position: relative;
    z-index: 1;
}

.guesty-sp-view-more .js-less {
    display: none;
}

.guesty-sp-view-more::before {
    content: '';
    position: absolute;
    top: -5rem;
    left: 0;
    width: 100%;
    height: 5rem;
    background: linear-gradient(to bottom, transparent, white);
    z-index: 10;
}

.guesty-sp-desc-content.open + .guesty-sp-view-more::before {
    display: none;
}

.guesty-sp-view-more::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    border-top: 1px solid var(--brand-color);
    z-index: 0;
}

/* ── Gallery ── */
.guesty-sp-gallery {
    margin-bottom: 5rem;
}

.guesty-sp-gallery .image {
    margin-bottom: 1.5rem;
    text-decoration: none;
    display: block;
    width: 100%;
}

.guesty-sp-gallery .image img {
    border-radius: 1rem;
    aspect-ratio: 16/9;
    object-fit: cover;
    object-position: center;
    width: 100%;
}

.guesty-sp-gallery .image p {
    font-size: 0.75rem;
    color: black;
    margin-top: 0.25rem;
}

/* ── Amenities ── */
.guesty-sp-amenities {
    margin-bottom: 5rem;
}

.guesty-sp-amenities-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: flex-start;
}

.guesty-sp-amenity {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: 1px solid var(--brand-color);
    border-radius: 5rem;
    padding: 0.5rem 1rem;
    background: white;
    font-size: 0.8rem;
    color: #333;
}

.guesty-sp-amenity .material-symbols-outlined {
    font-size: 1.1rem;
    color: var(--brand-color);
}

/* ── House Rules ── */
.guesty-sp-house-rules {
    margin-bottom: 5rem;
}

.guesty-sp-house-rules-content {
    font-size: 0.9rem;
    line-height: 1.7;
    color: #444;
}

/* ── Location ── */
.guesty-sp-location-section {
    margin-bottom: 5rem;
}

.guesty-sp-location-section .map {
    aspect-ratio: 16/9;
}

.guesty-sp-location-section .map iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 1rem;
    overflow: hidden;
    margin-bottom: 1rem;
}

/* ── Sidebar Booking Card ── */

/* Close button — only visible on mobile */
.guesty-sp-sheet-close {
    display: none;
}

/* Overlay — only visible on mobile */
.guesty-sp-sheet-overlay {
    display: none;
}

/* Desktop: sticky sidebar */
@media (min-width: 901px) {
    .guesty-sp-sidebar {
        display: block;
        position: sticky;
        top: 170px; /* header (82px) + navigation (68px) + 20px gap */
    }
}

/* Mobile: bottom sheet */
@media (max-width: 900px) {
    .guesty-sp-sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 2001;
        transform: translateY(100%);
        transition: transform 0.3s ease;
        max-height: 90vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .guesty-sp-sidebar.open {
        transform: translateY(0);
    }

    .guesty-sp-sidebar .guesty-sp-booking-card {
        border-radius: 1rem 1rem 0 0;
        padding: 1rem 1.5rem 2rem;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    }

    .guesty-sp-sheet-close {
        display: block;
        position: absolute;
        top: 0.75rem;
        right: 0.75rem;
        background: none;
        border: none;
        font-size: 1.75rem;
        line-height: 1;
        color: #666;
        cursor: pointer;
        padding: 0.25rem 0.5rem;
        z-index: 1;
    }

    .guesty-sp-sheet-close:hover {
        color: #000;
    }

    .guesty-sp-sheet-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 2000;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s, visibility 0.3s;
    }

    .guesty-sp-sheet-overlay.open {
        opacity: 1;
        visibility: visible;
    }
}

.guesty-sp-booking-card {
    position: relative;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 0 1rem rgba(0, 0, 0, 0.08);
}

/* Reset booking widget styles inside sidebar card */
.guesty-sp-booking-card .guesty-booking-widget {
    max-width: 100%;
    margin: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
}

.guesty-sp-booking-card .guesty-bw-bar-title {
    display: none;
}

.guesty-sp-price {
    margin-bottom: 1rem;
}

.guesty-sp-price-amount {
    font-size: 1.25rem;
    font-weight: 600;
    color: #333;
}

.guesty-sp-price-unit {
    font-size: 0.85rem;
    color: #888;
    font-weight: 400;
}

.guesty-sp-book-btn {
    display: block;
    width: 100%;
    padding: 0.75rem 0;
    background-color: var(--brand-color);
    border-color: var(--brand-color);
    color: black;
    text-decoration: none;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.guesty-sp-book-btn:hover {
    background-color: var(--brand-color-dark);
    border-color: var(--brand-color-dark);
    color: black;
}

/* ── Book Now Sticky Bottom Bar ── */
.guesty-sp-book-bar {
    position: sticky;
    bottom: 0;
    z-index: 2000;
    background: white;
    box-shadow: 0 0 1rem rgba(0, 0, 0, 0.25);
}

.guesty-sp-book-bar .btn-primary {
    background-color: var(--brand-color) !important;
    border-color: var(--brand-color) !important;
    color: black !important;
}

.guesty-sp-book-bar .btn-primary:hover {
    background-color: var(--brand-color-dark) !important;
    border-color: var(--brand-color-dark) !important;
}

/* Mobile-only book bar: hidden on desktop when sidebar is visible */
.guesty-sp-book-bar-mobile {
    display: block;
}

@media (min-width: 901px) {
    .guesty-sp-book-bar-mobile {
        display: none;
    }
}

/* ── Native Booking Widget Bar (legacy, kept for iframe fallback) ── */
.guesty-sp-book-bar-native {
    padding: 0.75rem 0;
}

/* Legacy native bar styles removed — booking widget now lives in sidebar card */

/* ── Expanded Booking Iframe ── */
.guesty-sp-book-expanded {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    z-index: 2001;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(100%);
    transition: transform 0.3s ease-in-out;
}

.guesty-sp-book-expanded.open {
    transform: translateY(0);
}

.guesty-sp-book-expanded[hidden] {
    display: block;
    visibility: hidden;
}

.guesty-sp-book-expanded.open[hidden] {
    visibility: visible;
}

.guesty-sp-book-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    background: #f8f8f8;
}

.guesty-sp-book-close {
    background: none;
    border: none;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    color: #333;
    padding: 0.25rem 0.5rem;
    transition: color 0.2s;
}

.guesty-sp-book-close:hover {
    color: #000;
}

.guesty-sp-booking-iframe {
    width: 100%;
    height: 500px;
    border: none;
    display: block;
}

/* Native booking widget content container */
.guesty-sp-book-content {
    max-height: 80vh;
    overflow-y: auto;
    padding: 0;
}

.guesty-sp-book-content .guesty-booking-widget {
    max-width: 100%;
    border-radius: 0;
    box-shadow: none;
    padding: 24px;
}

@media (min-width: 600px) {
    .guesty-sp-book-content {
        max-height: 70vh;
    }

    .guesty-sp-book-content .guesty-booking-widget {
        max-width: 480px;
        margin: 0 auto;
        padding: 32px;
    }
}

@media (max-width: 767px) {
    .guesty-sp-booking-iframe {
        height: 80vh;
    }

    .guesty-sp-book-content {
        max-height: 85vh;
    }
}

/* Overlay behind expanded booking */
.guesty-sp-book-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.guesty-sp-book-overlay.open {
    opacity: 1;
    visibility: visible;
}

/* ── Two-column Layout ── */
.guesty-sp-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: start;
}

@media (min-width: 901px) {
    .guesty-sp-layout {
        grid-template-columns: 1fr 380px;
        gap: 3rem;
    }
}

/* ── Lightbox ── */
.guesty-sp-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10050;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
}

.guesty-sp-lightbox[hidden] {
    display: none;
}

.guesty-sp-lightbox-img-wrap {
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.guesty-sp-lightbox-img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 4px;
}

.guesty-sp-lightbox-close,
.guesty-sp-lightbox-prev,
.guesty-sp-lightbox-next {
    position: absolute;
    background: none;
    border: none;
    color: #333;
    cursor: pointer;
    z-index: 2;
}

.guesty-sp-lightbox-close {
    top: 20px;
    right: 24px;
    font-size: 36px;
    line-height: 1;
}

.guesty-sp-lightbox-prev,
.guesty-sp-lightbox-next {
    top: 50%;
    transform: translateY(-50%);
    font-size: 48px;
    padding: 10px 16px;
    line-height: 1;
}

.guesty-sp-lightbox-prev { left: 16px; }
.guesty-sp-lightbox-next { right: 16px; }

.guesty-sp-lightbox-close:hover,
.guesty-sp-lightbox-prev:hover,
.guesty-sp-lightbox-next:hover {
    color: #000;
}

.guesty-sp-lightbox-counter {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    color: #333;
    font-size: 14px;
}

/* ── Responsive ── */
/* On mobile, sidebar is hidden via .guesty-sp-sidebar display:none above */

@media (max-width: 600px) {
    .guesty-sp-lightbox-prev,
    .guesty-sp-lightbox-next {
        font-size: 32px;
    }
}
