/* Property Single Template Styles
   Shared by property-rentals.php and property-for_sale.php */

/* ==========================================
   Hero Section
   ========================================== */

.property-hero {
    position: relative;
    margin-bottom: 40px;
}

/* ==========================================
   Video Wrapper
   ========================================== */

.property-video-wrapper {
    position: relative;
    max-width: 1400px;
    margin: 0 auto;
    background: #000;
    overflow: hidden;
    width: 100%;
    border-radius: 5px;
}

.property-video-wrapper.expanded {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    width: 90vw;
    max-width: none;
    height: auto;
    z-index: 9998;
    box-shadow: 0 0 50px rgba(0,0,0,0.8);
    border-radius: 5px;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                box-shadow 0.4s ease;
}

.property-video-wrapper.expanding {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.05);
    width: 90vw;
    max-width: none;
    height: auto;
    z-index: 9998;
    transition: none;
}

.property-video-wrapper.collapsing {
    transform: translate(-50%, -50%) scale(0.05);
    transition: transform 0.35s cubic-bezier(0.55, 0, 0.1, 1),
                box-shadow 0.35s ease;
}

.property-video-wrapper .plyr {
    width: 100%;
    height: 100%;
    --plyr-color-main: var(--accent);
}

.property-video-wrapper .plyr__controls {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.property-video-wrapper .plyr--playing .plyr__controls,
.property-video-wrapper .plyr:hover .plyr__controls {
    opacity: 1;
    pointer-events: auto;
}

.property-video-wrapper .plyr__control--overlaid {
    opacity: 1;
    pointer-events: auto;
}

.property-video-wrapper iframe,
.property-video-wrapper .plyr__video-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

.video-expand-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: background 0.2s ease;
    opacity: 0;
}

.property-video-wrapper:hover .video-expand-button {
    opacity: 1;
}

.video-expand-button:hover {
    background: rgba(0, 0, 0, 0.8);
}

.video-expand-button svg {
    width: 20px;
    height: 20px;
}

.expanded .video-expand-button svg {
    transform: rotate(180deg);
}

.video-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.4);
    z-index: 9997;
    cursor: pointer;
}

/* ==========================================
   Image Grid
   ========================================== */

.property-images-grid {
    display: grid;
    grid-template-columns: 1fr 0.8fr;
    gap: 20px;
    align-items: start;
}

.property-images-grid--no-video {
    grid-template-columns: 0.75fr 0.8fr;
    align-items: start;
}

.property-images-grid--wide-featured-image {
    grid-template-columns: 0.845fr 0.8fr;
}

.property-images-grid--16-9-image {
    grid-template-columns: 1fr 0.8fr;
}

.featured-image-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 5px;

    img {
        border-radius: 5px;
    }
}

.featured-image-link {
    display: block;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.featured-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.featured-image-link:hover .featured-image {
    transform: scale(1.05);
}

.gallery-section {
    position: relative;
    height: 0;
    padding-bottom: calc(56.25% * (1 / 0.8));
}

.gallery-preview-grid {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 10px;
}

.gallery-preview-item {
    overflow: hidden;
    position: relative;
    background-color: #ddd;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.gallery-preview-link {
    display: block;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.gallery-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.gallery-preview-link:hover img {
    transform: scale(1.05);
}

.view-all-images {
    text-align: right;
    max-width: 1400px;
    margin: 10px auto;
}

.view-gallery-link {
    color: #333;
    text-decoration: none;
    font-size: 14px;
}

.view-gallery-link:hover {
    text-decoration: underline;
}

#envira-gallery-wrapper {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ==========================================
   Property Header
   ========================================== */

.property-header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    max-width: 1200px;
    margin: 0 auto;
    font-family: poppins, sans-serif;
}

.property-location {
    color: var(--accent);
    font-size: 14px;
    display: block;
}

.property-features {
    display: flex;
    gap: 30px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    font-size: 15px;
}

.feature-item .gpc-icon {
    flex-shrink: 0;
}

.feature-item i {
    color: #999;
}

.property-badge {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 10px 16px;
    margin-bottom: 1rem;
    width: 100%;
}

.property-badge--pending {
    background: var(--accent);
    color: #fff;
}

.property-price {
    font-size: 18px;
    color: var(--accent);
    margin: 0.5rem 0 1rem 0;
}

.property-price strong {
    font-weight: 600;
}

/* ==========================================
   Property Layout (rental sidebar layout)
   ========================================== */

.property-layout__inner {
    display: flex;
    gap: 60px;
    align-items: flex-start;
}

.property-layout__main {
    flex: 1;
    min-width: 0;
}

.property-layout__sidebar {
    flex: 0 0 285px;
    position: sticky;
    top: 20px;
    align-self: flex-start;
}

/* ==========================================
   Booking Buttons
   ========================================== */

.property-booking-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 200px;
}

/* ==========================================
   Tabs
   ========================================== */

.property-content {
    padding: 40px 0;
}

.tab-nav {
    display: flex;
    list-style: none;
    margin: 0 0 40px;
    padding: 0;
    border-bottom: 2px solid #e0e0e0;
}

.tab-nav li {
    margin-right: 40px;
}

.tab-nav a {
    display: block;
    padding: 10px 0;
    color: #666;
    text-decoration: none;
    font-size: 16px;
    position: relative;
}

.tab-nav a:hover {
    color: var(--accent);
}

.tab-nav li:hover a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent);
}

.tab-nav li.active a {
    color: var(--blue-dark);
    font-weight: 500;
}

.tab-nav li.active a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--blue-dark);
}

.tab-content {
    position: relative;
    transition: min-height 0.3s ease;
}

.tab-pane {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tab-pane.active {
    display: block;
    opacity: 1;
}

/* ==========================================
   Rates Section
   ========================================== */

.rates-section {
    margin-bottom: 50px;
}

.rates-section h2,
.amenities-section h2,
.description-section h2,
.policies-section h2 {
    font-size: 24px;
    font-weight: 500;
    color: var(--accent);
    margin-bottom: 16px;
}

.rates-section .note {
    margin-top: 20px;
    border-top: 1px solid #e0e0e0;
    padding-top: 5px;
}

.rates-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.rate-column h3 {
    font-size: 18px;
    font-family: Nunito Sans, sans-serif;
    color: #4a7ba7;
    margin-bottom: 15px;
}

.rate-column h3 span {
    font-weight: 400;
    color: #666;
}

.rate-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.rate-list li {
    padding: 5px 0;
    color: #333;
}

/* ==========================================
   Amenities Section
   ========================================== */

.amenities-section {
    margin-bottom: 50px;
}

.amenity-item {
    padding: 5px 0;
}

/* ==========================================
   Description Section
   ========================================== */

.description-content p {
    margin-bottom: 20px;
}

/* ==========================================
   Responsive
   ========================================== */

@media (max-width: 1024px) {
    .gallery-preview-grid {
        width: 100%;
        grid-template-columns: repeat(4, 1fr);
        grid-template-rows: 1fr;
    }

    .property-layout__inner {
        flex-direction: column;
        gap: 30px;
    }

    .property-layout__sidebar {
        flex: none;
        width: 100%;
        position: static;
    }

    .property-header-content {
        flex-direction: column;
        gap: 30px;
    }

    .property-booking-buttons {
        width: 100%;
        flex-direction: row;
    }
}

@media (max-width: 768px) {
    .property-images-grid,
    .property-images-grid--no-video,
    .property-images-grid--wide-featured-image,
    .property-images-grid--16-9-image {
        grid-template-columns: 1fr;
    }

    .rates-grid,
    .amenities-grid {
        grid-template-columns: 1fr;
    }

    .gallery-preview-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 1fr 1fr;
    }

    .property-features {
        flex-direction: column;
        gap: 10px;
    }

    .tab-nav {
        overflow-x: auto;
    }

    .property-title {
        font-size: 24px;
    }
}
