/* ==========================================================================
   1. GLOBAL & CONTAINER LAYOUT
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.wp-block-columns {
    display: flex;
    align-items: stretch;
    gap: 2rem;
    margin: 0 auto;
    padding: 1rem;
}

.wp-block-column {
    margin: 0;
    padding: 0;
}

.product-detail-layout {
    display: flex;
    align-items: flex-start;
    gap: 40px;
    margin-top: 2rem;
}

.product-main-content {
    flex: 1;
    min-width: 0;
}

/* ==========================================================================
   2. AIRBNB GALLERY GRID (Main: Contain / Thumbs: Cover)
   ========================================================================== */
.product-gallery-grid {
    display: grid;
    grid-template-columns: 2fr 1fr; 
    gap: 8px;
    height: 500px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 2rem;
    position: relative;
    background: #fff;
}

/* --- THE FIRST IMAGE (Main Hero) --- */
.gallery-main {
    background: #e0e0e0; /* Or your preferred gray */
    display: flex;
    align-items: center;    /* Vertical center */
    justify-content: center; /* Horizontal center */
    height: 500px;           /* Ensure this matches your grid height */
    overflow: hidden;
}

.gallery-main img {
    /* CHANGE THESE: Use 'max' instead of '100%' */
    max-width: 100%;
    max-height: 100%;
    
    /* This ensures it doesn't stretch or distort */
    width: auto;
    height: auto;
    
    object-fit: contain;
    display: block;
}

/* --- THE THUMBNAILS (Right Side) --- */
.gallery-thumbnails {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 8px;
    height: 100%;
}

.gallery-thumb {
    height: 100%;
    width: 100%;
    overflow: hidden;
    position: relative;
    background: #f0f0f0;
    cursor: pointer;
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Grid remains clean and filled */
    object-position: center center;
    display: block;
    transition: transform 0.4s ease;
}

.gallery-main:hover img, 
.gallery-thumb:hover img {
    transform: scale(1.03);
}

.show-all-btn {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: white;
    padding: 6px 14px;
    border-radius: 6px;
    border: 1px solid #222;
    font-weight: 600;
    font-size: 13px;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 6px;
    color: #222;
    cursor: pointer;
}

/* ==========================================================================
   3. QUICK PICKER (Below Grid)
   ========================================================================== */
.product-quick-picker {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 10px 0 20px 0;
    margin-bottom: 10px;
    scrollbar-width: none;
}

.product-quick-picker::-webkit-scrollbar { display: none; }

.quick-thumb {
    min-width: 100px;
    height: 70px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    cursor: pointer;
    border: 1px solid #ddd;
    transition: transform 0.2s ease;
}

.quick-thumb:hover {
    transform: translateY(-2px);
    border-color: #2c5aa0;
}

.quick-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ==========================================================================
   4. LIGHTBOX & ARROW NAVIGATION
   ========================================================================== */
.lightbox-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: white;
    z-index: 99999;
}

.lightbox-overlay.active { display: block; }

.lightbox-content {
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

.lightbox-close {
    position: absolute;
    top: 20px; left: 20px;
    font-size: 40px; cursor: pointer;
    z-index: 101;
}

/* Navigation Arrows */
.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #ddd;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.nav-arrow:hover { background: #fff; border-color: #222; }
.prev-btn { left: 20px; }
.next-btn { right: 20px; }

.lightbox-main-display {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
    background: #fff;
}

.lightbox-main-display img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
}

.lightbox-picker {
    height: 150px;
    display: flex;
    gap: 15px;
    padding: 20px;
    overflow-x: auto;
    background: #f7f7f7;
    justify-content: center;
}

.picker-card {
    min-width: 120px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    opacity: 0.5;
    border: 2px solid transparent;
    transition: opacity 0.3s;
}

.picker-card.active {
    opacity: 1;
    border-color: #2c5aa0;
}

.picker-card img {
    width: 100%; height: 100%; object-fit: cover;
}

/* ==========================================================================
   5. BOOKING SIDEBAR & STICKY WIDGET
   ========================================================================== */
.product-booking-sidebar {
    width: 380px;
    flex-shrink: 0;
    align-self: flex-start;
}

.booking-widget-sticky {
    position: sticky;
    top: 100px;
    z-index: 10;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

.price-display {
    font-size: 1.5rem;
    font-weight: bold;
    color: #222;
    margin-bottom: 1rem;
}

.booking-dates {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border: 1px solid #ccc;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 10px;
}

.date-field { padding: 10px; }
.date-field:first-child { border-right: 1px solid #ccc; }
.date-field label { display: block; font-size: 10px; text-transform: uppercase; font-weight: bold; }
.date-field input { border: none; width: 100%; font-size: 14px; outline: none; }

.guests-button {
    width: 100%; text-align: left; padding: 10px; border: 1px solid #ccc;
    border-radius: 8px; background: white; cursor: pointer; margin-bottom: 15px;
}

.book-now-button {
    width: 100%; background: #2c5aa0; color: white; padding: 14px;
    border-radius: 8px; font-weight: bold; border: none; cursor: pointer; font-size: 16px;
}

.book-now-button:hover { background: #1e3d6f; }

/* ==========================================================================
   6. VIDEO & CONTENT STYLING
   ========================================================================== */
.product_title { font-size: 2rem; font-weight: bold; margin-bottom: 1.5rem; }

.product-video-container {
    max-width: 100%; margin: 24px 0 !important;
    display: flex; justify-content: center; background: #000; border-radius: 12px;
}

.product-video-container video { max-height: 500px; width: auto; max-width: 100%; }

/* ==========================================================================
   7. RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 991px) {
    .product-detail-layout { flex-direction: column; }
    .product-booking-sidebar { width: 100%; order: -1; }
    .booking-widget-sticky { position: static; margin-bottom: 2rem; }
}

@media (max-width: 768px) {
    .desktop-only { display: none !important; }
    .mobile-only { display: flex !important; }

    .product-gallery-grid {
        height: 300px;
        grid-template-columns: 1fr;
    }

    .gallery-thumbnails { display: none !important; }
    .gallery-main { width: 100% !important; height: 100% !important; }

    .nav-arrow { width: 40px; height: 40px; font-size: 18px; }
    .prev-btn { left: 10px; }
    .next-btn { right: 10px; }
    
    .product-quick-picker { padding: 10px 1rem; }
}