/*
 * ===================================================================
 * Enhanced Airbnb-Style CSS for API-Driven Single Product Page
 * ===================================================================
 */

/* --- 1. Reset Theme's Default Page Styles --- */
.page-template-default .site-content .entry-header,
.page-template-default .site-content .entry-meta {
    display: none !important;
}

.page-template-default .site-content .entry-content {
    padding: 0 !important;
    margin: 0 !important;
}

/* Hide specific WordPress elements */
.has-text-align-center.wp-block-post-title.has-huge-font-size {
    display: none !important;
}

.wp-block-spacer[style*="height:40px"] {
    display: none !important;
}

/* --- 2. Base Styles --- */
#api-product-detail-page {
    font-family: "Circular", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.5;
    color: #222222;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* --- 3. Header Section with Title and Actions --- */
#api-product-detail-page .product-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    padding: 1rem 0;
}

#api-product-detail-page .product_title {
    font-size: 2rem;
    font-weight: 600;
    margin: 0;
    border: none;
    padding: 0;
    color: #222222;
    letter-spacing: -0.02em;
    flex: 1;
}

#api-product-detail-page .product-actions {
    display: flex;
    gap: 1rem;
    margin-left: 2rem;
}

#api-product-detail-page .action-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    color: #222222;
    text-decoration: underline;
    transition: background-color 0.2s ease;
}

#api-product-detail-page .action-button:hover {
    background-color: #f7f7f7;
}

/* --- 4. Main Content Layout --- */
#api-product-detail-page .product-detail-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 1024px) {
    #api-product-detail-page .product-detail-layout {
        grid-template-columns: 1fr 380px;
        gap: 3rem;
    }
}

/* --- 5. Enhanced Image Gallery Grid (Airbnb Style) --- */
#api-product-detail-page .product-gallery-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 2rem;
    border-radius: 12px;
    overflow: hidden;
    height: 400px;
    position: relative;
}

@media (min-width: 768px) {
    #api-product-detail-page .product-gallery-grid {
        grid-template-columns: 1fr 1fr;
        height: 480px;
    }
}

@media (min-width: 1024px) {
    #api-product-detail-page .product-gallery-grid {
        height: 560px;
    }
}

#api-product-detail-page .product-gallery-grid .main-image {
    position: relative;
    overflow: hidden;
}

@media (min-width: 768px) {
    #api-product-detail-page .product-gallery-grid .main-image {
        border-radius: 12px 0 0 12px;
    }
}

#api-product-detail-page .product-gallery-grid .main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    cursor: pointer;
}

#api-product-detail-page .product-gallery-grid .main-image:hover img {
    transform: scale(1.05);
}

#api-product-detail-page .product-gallery-grid .thumbnail-images {
    display: none;
}

@media (min-width: 768px) {
    #api-product-detail-page .product-gallery-grid .thumbnail-images {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 1fr 1fr;
        gap: 8px;
    }
}

#api-product-detail-page .product-gallery-grid .thumbnail-images img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease, filter 0.3s ease;
    cursor: pointer;
}

#api-product-detail-page .product-gallery-grid .thumbnail-images img:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

/* Show all photos button */
#api-product-detail-page .show-all-photos {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    background: white;
    border: 1px solid #222222;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    z-index: 10;
}

#api-product-detail-page .show-all-photos:hover {
    background: #f7f7f7;
    transform: scale(1.02);
}

/* --- 6. Property Details Section --- */
#api-product-detail-page .property-details {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #DDDDDD;
}

#api-product-detail-page .property-title {
    font-size: 1.375rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #222222;
}

#api-product-detail-page .property-subtitle {
    font-size: 1rem;
    color: #717171;
    margin-bottom: 1rem;
}

#api-product-detail-page .property-stats {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

#api-product-detail-page .rating-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #f7f7f7;
    border-radius: 12px;
    font-size: 0.875rem;
}

#api-product-detail-page .rating-stars {
    color: #FFB400;
}

#api-product-detail-page .rating-score {
    font-weight: 600;
}

#api-product-detail-page .review-count {
    color: #717171;
}

/* Short Description */
#api-product-detail-page .woocommerce-product-details__short-description {
    font-size: 1rem;
    color: #717171;
    margin-bottom: 2rem;
    line-height: 1.6;
}

#api-product-detail-page .woocommerce-product-details__short-description p {
    margin: 0;
}

/* Long Description */
#api-product-detail-page .product-long-description {
    font-size: 1rem;
    line-height: 1.6;
    color: #484848;
}

#api-product-detail-page .product-long-description h2,
#api-product-detail-page .product-long-description h3 {
    font-weight: 600;
    color: #222222;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

#api-product-detail-page .product-long-description p {
    margin-bottom: 1rem;
}

/* --- 7. Booking Widget (Right Sidebar) --- */
#api-product-detail-page .product-booking-sidebar {
    order: 1;
}

@media (min-width: 1024px) {
    #api-product-detail-page .product-booking-sidebar {
        order: 2;
    }
}

#api-product-detail-page .booking-widget-sticky {
    position: sticky;
    top: 24px;
    padding: 1.5rem;
    border: 1px solid #DDDDDD;
    border-radius: 12px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    background: #FFFFFF;
    transition: box-shadow 0.3s ease;
}

#api-product-detail-page .booking-widget-sticky:hover {
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.15);
}

/* Price Display */
#api-product-detail-page .booking-widget-sticky .price-display {
    font-size: 1.375rem;
    font-weight: 600;
    color: #222222;
    margin-bottom: 1.5rem;
    text-align: left;
}

/* Booking Form */
#api-product-detail-page .booking-form-api .booking-dates {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border: 1px solid #DDDDDD;
    border-radius: 8px 8px 0 0; /* Top corners rounded */
    overflow: hidden;
    transition: border-color 0.2s ease;
}

#api-product-detail-page .booking-form-api .booking-dates:hover {
    border-color: #222222;
}

#api-product-detail-page .booking-form-api .booking-dates:focus-within {
    border-color: #222222;
    box-shadow: 0 0 0 2px rgba(34, 34, 34, 0.1);
}

#api-product-detail-page .booking-form-api .date-field {
    padding: 0.75rem;
    position: relative;
}

#api-product-detail-page .booking-form-api .date-field:first-child {
    border-right: 1px solid #DDDDDD;
}

#api-product-detail-page .booking-form-api .date-field label {
    display: block;
    font-size: 0.625rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #222222;
    margin-bottom: 0.25rem;
    letter-spacing: 0.04em;
}

#api-product-detail-page .booking-form-api .date-field input {
    border: none;
    padding: 0;
    width: 100%;
    font-size: 0.875rem;
    color: #717171;
    background: transparent;
    outline: none;
    font-family: inherit;
}

#api-product-detail-page .booking-form-api .date-field input:focus {
    color: #222222;
}

#api-product-detail-page .booking-form-api .date-field input::placeholder {
    color: #B0B0B0;
}

/* Guests Dropdown Button */
#api-product-detail-page .booking-form-api .guests-button {
    display: block;
    width: 100%;
    text-align: left;
    border: 1px solid #DDDDDD;
    border-top: none; /* Joins with the date fields */
    border-radius: 0 0 8px 8px; /* Bottom corners rounded */
    padding: 0.75rem;
    margin-bottom: 1rem;
    cursor: pointer;
    background: #FFFFFF;
    transition: border-color 0.2s ease;
}

#api-product-detail-page .booking-form-api .guests-button:hover {
    border-color: #222222;
}

#api-product-detail-page .booking-form-api .guests-button label {
    display: block;
    font-size: 0.625rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #222222;
    margin-bottom: 0.25rem;
    letter-spacing: 0.04em;
}

#api-product-detail-page .booking-form-api .guests-button .guests-value {
    font-size: 0.875rem;
    color: #717171;
}

/* Price Breakdown Section */
#api-product-detail-page .booking-form-api .price-breakdown {
    margin-bottom: 1rem;
    padding: 1rem;
    background: #f7f7f7;
    border-radius: 8px;
    font-size: 0.875rem;
}

#api-product-detail-page .booking-form-api .price-breakdown .breakdown-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    color: #484848;
}

#api-product-detail-page .booking-form-api .price-breakdown .total-amount {
    display: flex;
    justify-content: space-between;
    padding-top: 0.75rem;
    border-top: 1px solid #DDDDDD;
    font-size: 1rem;
    color: #222222;
}

/* Book Now Button */
#api-product-detail-page .booking-form-api .book-now-button {
    width: 100%;
    padding: 0.875rem;
    background: linear-gradient(135deg, #E61E4D 0%, #BD1E59 100%);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 0.75rem;
    transition: all 0.2s ease;
    font-family: inherit;
    letter-spacing: 0.01em;
}

#api-product-detail-page .booking-form-api .book-now-button:hover {
    background: linear-gradient(135deg, #D70466 0%, #A91B52 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(230, 30, 77, 0.3);
}

#api-product-detail-page .booking-form-api .book-now-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(230, 30, 77, 0.3);
}

#api-product-detail-page .booking-form-api .book-now-button:disabled {
    background: #B0B0B0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Disclaimer */
#api-product-detail-page .booking-form-api .disclaimer {
    font-size: 0.875rem;
    color: #717171;
    text-align: center;
    margin: 0;
    font-weight: 400;
}

/* Booking Message */
#api-product-detail-page .booking-form-api .booking-message {
    font-size: 0.875rem;
    color: #E61E4D;
    margin-bottom: 0.5rem;
    text-align: center;
    font-weight: 500;
    min-height: 1.2em;
}

/* --- 8. GUEST SELECTION MODAL --- */
.guest-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(34, 34, 34, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.guest-modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.guest-modal {
    background: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    width: 90%;
    max-width: 380px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.28);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.guest-modal-overlay.visible .guest-modal {
    transform: scale(1);
}

.guest-counter {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    border-bottom: 1px solid #EEEEEE;
}
.guest-counter:first-of-type {
    padding-top: 0;
}

..guest-counter-label strong {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
}
.guest-counter-label span {
    font-size: 0.875rem;
    color: #717171;
    margin-left: 4px!important;
}

.guest-counter-label a {
    font-size: 0.875rem;
    color: #222222;
    font-weight: 600;
    text-decoration: underline;
}

.guest-counter-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.guest-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid #B0B0B0;
    background: #fff;
    color: #717171;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
}
.guest-btn:hover {
    border-color: #222222;
    color: #222222;
}
.guest-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    border-color: #EBEBEB;
}
.guest-modal .count {
    font-size: 1rem;
    font-weight: 500;
    color: #222222;
}

.modal-info {
    font-size: 0.75rem;
    color: #717171;
    margin-top: 1rem;
    line-height: 1.4;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 1.5rem;
}
.modal-close-btn {
    background: #222222;
    color: #FFFFFF;
    border: none;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
}


/* --- Mobile Responsive Adjustments --- */
@media (max-width: 1023px) {
    #api-product-detail-page .product-detail-layout {
        grid-template-columns: 1fr;
    }

    #api-product-detail-page .product-booking-sidebar {
        order: 3;
    }

    #api-product-detail-page .booking-widget-sticky {
        position: static;
        margin-top: 2rem;
    }
}

@media (max-width: 768px) {
    #api-product-detail-page {
        padding: 0 1rem;
    }

    #api-product-detail-page .product-header {
        flex-direction: column;
        gap: 1rem;
    }

    #api-product-detail-page .product-actions {
        margin-left: 0;
        align-self: flex-start;
    }

    #api-product-detail-page .product_title {
        font-size: 1.5rem;
    }

    #api-product-detail-page .product-gallery-grid {
        height: 300px;
        border-radius: 8px;
    }

    #api-product-detail-page .booking-form-api .booking-dates {
        grid-template-columns: 1fr;
    }

    #api-product-detail-page .booking-form-api .date-field:first-child {
        border-right: none;
        border-bottom: 1px solid #DDDDDD;
    }
}

/* Loading State Animation */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.6; }
    100% { opacity: 1; }
}

#api-product-detail-page .booking-form-api .book-now-button:disabled {
    animation: pulse 1.5s ease-in-out infinite;
}