/* ==========BD Default Styles with YITH Wonder Integration ============*/
.wpbdp-listing .listing-title {
    border: none;
    border-bottom: 1px solid var(--wp--preset--color--primary);
    font-size: var(--wp--preset--font-size--medium, 1.5rem);
    margin-bottom: var(--wp--preset--spacing--10, 0.44rem);
    font-weight: bold;
}

.wpbdp-listing .listing-title h3 {
    margin-bottom: 0;
}

.wpbdp-listing .listing-title a {
    text-decoration: none;
    font-weight: bold;
    font-size: var(--wp--preset--font-size--x-large, 2rem);
}

.wpbdp-listing a:not(.wpbdp-button) {
    text-decoration: none;
}

.wpbdp-listing .wpbdp-button {
    padding: .7em 1em;
}

.wpbdp-listing .listing-thumbnail {
    float: left;
    width: 150px;
}

.wpbdp-listing .listing-thumbnail img {
    max-width: 150px;
}

.wpbdp-listing .listing-details {
    margin-left: calc(150px + var(--wp--preset--spacing--30, 1.25rem));
}

.wpbdp-listing .listing-details.wpbdp-no-thumb {
    margin-left: 0;
}

.wpbdp-listing .address-info .address-label {
    font-weight: bold;
    display: block;
    margin-bottom: var(--wp--preset--spacing--10, 0.44rem);
}

.wpbdp-listing .wpbdp-field {
    margin: var(--wp--preset--spacing--10, 0.44rem) 0;
}

.wpbdp-listing .wpbdp-field-type-textarea label,
.wpbdp-listing .wpbdp-field-type-textarea .field-label {
    display: block;
}

.wpbdp-view-show_listing h3 {
    font-size: var(--wp--preset--font-size--large, 1.75rem);
}

/* ========== Tabs ========== */
.bh-custom-listing-tabs {
    width: 100%;
    margin: var(--wp--preset--spacing--20, 0.75rem) 0 var(--wp--preset--spacing--30, 1.25rem);
    background: none;
    padding: 0;
}
.bh-custom-listing-tabs ol.tabs {
    list-style-type: none;
    margin: 0 0 0 var(--wp--preset--spacing--20, 0.75rem);
    padding: 0;
    max-width: 600px;
    border: none;
    border-radius: 0;
    background: none;
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
}
.bh-custom-listing-tabs li {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    margin: 0;
    border: 1px solid var(--wp--preset--color--border, #e8e8e8);
    border-bottom: none;
    background: var(--wp--preset--color--background, #ffffff);
    font-size: var(--wp--preset--font-size--x-small, 0.875rem);
    text-align: center;
    box-sizing: border-box;
    border-radius: var(--wp--custom--button-border-radius, 4px) var(--wp--custom--button-border-radius, 4px) 0 0;
    transition: background 0.2s;
}
.bh-custom-listing-tabs li:first-child {
    border-left: 1px solid var(--wp--preset--color--border, #e8e8e8);
}
.bh-custom-listing-tabs li:last-child {
    border-right: 1px solid var(--wp--preset--color--border, #e8e8e8);
}
.bh-custom-listing-tabs li a,
.bh-custom-listing-tabs li a:active,
.bh-custom-listing-tabs li a:visited {
    color: inherit;
    text-decoration: none;
    width: 100%;
    height: 100%;
    display: block;
    border: none;
    padding: var(--wp--preset--spacing--20, 0.75rem);
    background: inherit;
    outline: none;
    box-shadow: none;
    border-radius: var(--wp--custom--button-border-radius, 4px) var(--wp--custom--button-border-radius, 4px) 0 0;
}
.bh-custom-listing-tabs li.ui-state-active,
.bh-custom-listing-tabs li.ui-tabs-active {
    background: var(--wp--preset--color--background, #ffffff);
    border-bottom: 1px solid var(--wp--preset--color--background, #ffffff);
    z-index: 2;
}
.bh-custom-listing-tabs li.ui-state-active a,
.bh-custom-listing-tabs li.ui-tabs-active a {
    color: var(--wp--preset--color--primary, #007565);
    background: var(--wp--preset--color--background, #ffffff);
}
.bh-custom-listing-tabs li a:hover {
    background: var(--wp--preset--color--hover, #e8e8e8);
}
.bh-custom-listing-tabs .ui-tabs-panel {
    margin-left: var(--wp--preset--spacing--20, 0.75rem);
}

/* ========== Layout ========== */
.two-col-flex,
.bh-custom-details-wrapper , .bh-custom-listing {
    display: flex;
    gap: var(--wp--preset--spacing--50, 2.19rem);
    align-items: flex-start;
}

.bh-custom-thumbnail-col {
    flex: 0 0 auto;
    min-width: 250px;
    max-width: 50%;
    width: 400px;
    display: flex;
    flex-direction: column;
    margin-inline-start: var(--wp--preset--spacing--50, 2.19rem);
    margin-inline-end: var(--wp--preset--spacing--50, 2.19rem);
}
.bh-custom-details-col {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
.bh-custom-details-wrapper .listing-details {
    width: 100%;
    margin-left: 0;
}
.listing-actions {
    width: 100%;
    margin-top: var(--wp--preset--spacing--20, 0.75rem);
}
.wpbdp-sidebar-listings .listing-actions {
    display:flex;
    flex-direction: column;
    align-items: flex-start;
    margin-block-start: var(--wp--preset--spacing--50, 2.19rem);
}

/* ========== Main Image ========== */
.bh-custom-main-image {
    width: 100%;
    margin: 0 var(--wp--preset--spacing--20, 0.75rem) var(--wp--preset--spacing--10, 0.25rem) var(--wp--preset--spacing--20, 0.75rem);
    display: block;
    background: var(--wp--preset--color--background, #e8e8e8);
    position: relative;
    overflow: hidden;
    line-height: 0;
    /* Remove any height/min-height constraints */
    height: auto;
    min-height: auto;
}

.bh-custom-main-image .listing-thumbnail {
    display: block;
    width: 100%;
    float: none;
    line-height: 0;
}

.bh-custom-main-image .listing-thumbnail a,
.bh-custom-main-image .thickbox {
    display: block;
    width: 100%;
    line-height: 0;
}

.bh-custom-main-image img,
.bh-custom-main-image .listing-thumbnail img,
.bh-custom-main-image .thickbox img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: none !important; /* Remove max-height constraint */
    border-radius: var(--wp--custom--button-border-radius, 4px);
    display: block;
    object-fit: contain; /* Back to contain now that height is unrestricted */
}

/* ========== Slider ========== */
.bh-custom-slider {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 0 var(--wp--preset--spacing--20, 0.75rem) var(--wp--preset--spacing--20, 0.75rem) var(--wp--preset--spacing--20, 0.75rem);
    min-height: 100px;
    height: 100px;
    box-sizing: border-box;
    background: var(--wp--preset--color--background, #e8e8e8);
}
.bh-custom-slider img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: var(--wp--custom--button-border-radius, 4px);
    display: block;
}
.bh-custom-slider .slick-slide {
    display: flex !important;
    justify-content: center;
    align-items: center;
    height: 100px;
}

/* ========== Loading State ========== */
.bh-custom-main-image.is-loading,
.bh-custom-slider.is-loading {
    visibility: hidden;
}
.bh-custom-slider.is-loading {
    display: flex;
    flex-direction: row;
    gap: 0;
    overflow: hidden;
    min-height: 100px;
}
.bh-custom-slider.is-loading > div {
    flex: 0 0 100px;
    max-width: 100px;
}

/* ========== Slick Arrows ========== */
.slick-arrow,
.bh-custom-slider .slick-arrow {
    background: transparent !important;
    border: none !important;
    color: var(--wp--preset--color--primary, #404040);
    width: var(--wp--preset--spacing--70, 1.88rem);
    height: var(--wp--preset--spacing--40, 1.88rem);
    opacity: 0.8;
    transition: opacity 0.2s;
}
.slick-prev:before,
.slick-next:before {
    color: var(--wp--preset--color--primary, #404040) !important;
    opacity: 1 !important;
    font-size: var(--wp--preset--font-size--x-large, 2rem);
}
.bh-custom-slider .slick-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
}
.bh-custom-slider .slick-prev {
    left: calc(-1 * var(--wp--preset--spacing--70, 2.19rem)); /* Use spacing--50 instead */
}
.bh-custom-slider .slick-next {
    right: calc(-1 * var(--wp--preset--spacing--70, 2.19rem)); /* Use spacing--50 instead */
}
.bh-custom-slider .slick-arrow:hover {
    opacity: 1;
    background: var(--wp--preset--color--hover, #e8e8e8);
}

/* ========== Search Form Alignment ========== */
.main-fields .box-row {
    align-items: flex-end; /* Align all items to bottom */
}

.wpbdp-proximity-search-unit .wpbdp-search-filter,
.wpbdp-proximity-search-unit .wpbdp-form-field-select {
    margin-bottom: 0; /* Remove any bottom margin */
}

/* Ensure submit button matches input height */
.submit-btn{
   align-self: flex-end; /* Align submit button to bottom */
   flex: 0 0 auto; /* Don't grow or shrink */
}

/* Override BD's flex: 1 setting for proximity search unit specifically */
.wpbdp-main-box .main-fields form .search-fields .box-row .wpbdp-proximity-search-unit {
    flex: 0 0 180px !important; /* Don't grow, don't shrink, fixed 180px */
    width: 180px !important; /* Ensure width is set */
    max-width: 180px; /* Prevent it from getting larger */
}

/* Category grows to fill available space */
.wpbdp-main-box .main-fields form .search-fields .box-row .category-input {
    flex: 1 1 250px !important; /* Grow, min 250px */
    min-width: 250px;
}

/* Location input also flexible */
.wpbdp-main-box .main-fields form .search-fields .box-row .location-input {
    flex: 1 1 200px !important;
    min-width: 200px;
}

/* Ensure main input can still grow to fill remaining space */
.wpbdp-main-box .main-fields form .search-fields .box-row .main-input {
    flex: 1 1 200px !important; /* Grow to fill space, min 200px */
    min-width: 200px;
}
/* Center the main search box on the page */
#wpbdp-main-box,
.wpbdp-main-box,
#wpbdp-categories,
.wpbdp-categories.wpbdp-categories-4-columns-large {
    margin-left: auto;
    margin-right: auto;
    margin-top: var(--wp--preset--spacing--50, 2.19rem);
    margin-bottom: var(--wp--preset--spacing--50, 2.19rem);
    max-width: 1100px;
}
.wpbdp-listings-list {
    margin-left: auto;
    margin-right: auto;
    /* Optional: set a max-width if you want */
    max-width: 1100px;
}
.wpbdp-page,
.wp-block-group {
    /* FIX: Use spacing--50 instead of non-existent spacing--60 */
    padding: 0 var(--wp--preset--spacing--50, 2.19rem) 0 var(--wp--preset--spacing--50, 2.19rem);
}

/* ========== Responsive ========== */
@media screen and (max-width: 700px) {
    .bh-custom-listing-tabs ol.tabs {
        display: block;
    }
    .bh-custom-listing-tabs li {
        display: block;
        width: 100%;
        border-radius: 0;
        margin-bottom: var(--wp--preset--spacing--10, 0.25rem);
    }
    .bh-custom-listing-tabs li a {
        border-radius: 0;
    }
    .two-col-flex,
    .bh-custom-details-wrapper {
        flex-direction: column;
        gap: var(--wp--preset--spacing--20, 0.75rem);
    }
    .bh-custom-thumbnail-col,
    .bh-custom-details-col {
        width: 100%;
    }
}
/* ========== Listings Layout ========== */
.wpbdp-listing .listing-details .wpbdp-field-short_description,
.wpbdp-listing .listing-details .wpbdp-field-listing_category,
.wpbdp-listing .listing-details .wpbdp-field-rating_average {
    margin-bottom: var(--wp--preset--spacing--50, 2.19rem) !important;
}
.bh-custom-layout {
    display: flex;
    gap: var(--wp--preset--spacing--50, 2.19rem);
}
.wpbdp-sidebar {
    width: 250px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: var(--wp--preset--spacing--50, 2.19rem);
    float:left;
}
.wpbdp-region-sidelist-wrapper{
    width:100%;
}
.wpbdp-main {
    flex: 1 1 0;
}

@media (max-width: 900px) {
    .bh-custom-layout {
        flex-direction: column;
    }
    .wpbdp-sidebar {
        width: 100%;
    }
}
@media (max-width: 600px) {
  .custom-map-size {
    width: 100%;
    max-width: 600px;
    height: 300px;
    margin: 0 auto var(--wp--preset--spacing--50, 2.19rem) auto;
}
.custom-map-size iframe,
.custom-map-size > div {
    width: 100% !important;
    height: 100% !important;
}
}

/* Add at the end of your CSS file for better mobile typography */
@media (max-width: 768px) {
    .wpbdp-listing .listing-title a {
        font-size: var(--wp--preset--font-size--large, 1.75rem); /* Smaller on mobile */
    }
    
    .wpbdp-view-show_listing h3 {
        font-size: var(--wp--preset--font-size--medium, 1.5rem); /* Smaller on mobile */
    }
}

.wpbdp-claim-listings .claim-form-wrapper {
    display: block !important;
}

/* ========== Submit Button Height ========== */
.wpbdp-main-box .submit-btn input[type="submit"].wpbdp-button {
    min-height: 48px !important;
    margin: 0 !important;
    padding: 0px 12px !important; /* Keep horizontal padding, remove vertical */
}

/* ========== Edit Listing Image Lightbox ========== */
/* ONLY add cursor and hover effect - don't override BD's sizing */
.wpbdp-submit-page #wpbdp-uploaded-images .wpbdp-image-img a.thickbox,
.post-type-wpbdp_listing #wpbdp-uploaded-images .wpbdp-image-img a.thickbox {
    display: inline-block; /* Changed from block */
    cursor: zoom-in;
    transition: opacity 0.2s ease;
    line-height: 0; /* Prevent spacing issues */
}

.wpbdp-submit-page #wpbdp-uploaded-images .wpbdp-image-img a.thickbox:hover,
.post-type-wpbdp_listing #wpbdp-uploaded-images .wpbdp-image-img a.thickbox:hover {
    opacity: 0.85;
}

/* ========== Main Listing Display Images (Override BD) ========== */
/* These styles ONLY apply to the listing view pages, NOT edit pages */
.wpbdp-view-show_listing .bh-custom-main-image .listing-thumbnail a.thickbox {
    display: block;
    cursor: zoom-in;
}

.wpbdp-view-show_listing .bh-custom-main-image .listing-thumbnail a.thickbox:hover {
    opacity: 0.95;
}

.wpbdp-view-show_listing .bh-custom-main-image img,
.wpbdp-view-show_listing .bh-custom-main-image .listing-thumbnail img,
.wpbdp-view-show_listing .bh-custom-main-image .thickbox img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: none !important;
    border-radius: var(--wp--custom--button-border-radius, 4px);
    display: block;
    object-fit: contain;
}

/* Center the categories grid by constraining width and using auto margins */
#wpbdp-categories .wpbdp-categories,
.wpbdp-categories.wpbdp-categories-4-columns-large {
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: var(--wp--preset--spacing--70, 1.25rem) !important;
}

/* ========== Social Links Block Size Fix ========== */
.wp-block-social-links .wp-social-link,
.wp-block-social-links a {
    font-size: inherit !important;
}

/* ========== Fix Submit Form Button Sizes ========== */
/* Make Back/Next buttons match other button sizes */
.wpbdp-submit-listing-form-actions .wpbdp-button,
.wpbdp-submit-listing-form-actions .submit-back-button,
.wpbdp-submit-listing-form-actions .submit-next-button {
    min-height: 48px !important;
    padding: 12px 24px !important;
    font-size: var(--wp--preset--font-size--medium, 14px) !important;
}

/* Ensure consistent styling across all BD buttons */
.wpbdp-with-button-styles .wpbdp-submit-listing-form-actions .wpbdp-button,
.wpbdp-with-button-styles .wpbdp-submit-listing-form-actions .submit-back-button {
    padding: 12px 24px !important;
}