/*
 * Boat Listings Manager - Frontend Stylesheet
 * Version: 1.3
 */

/* --- Main Archive & Sidebar Layout --- */
.blm-archive-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
}
.blm-filter-sidebar {
    flex: 1 1 100%; /* Full width on mobile by default */
}
.blm-main-content {
    flex: 1 1 100%; /* Full width on mobile by default */
}
@media (min-width: 992px) {
    .blm-filter-sidebar {
        flex: 1 1 250px; /* Sidebar takes ~25% */
        max-width: 280px;
    }
    .blm-main-content {
        flex: 2 1 0; /* Main content takes remaining space */
    }
}

/* --- Responsive Filters (Final Version) --- */

/* On mobile, show the button */
@media (max-width: 768px) {
    #filter-toggle-btn {
        display: block;
        margin-bottom: 15px;
        width: 100%;
        padding: 10px;
        text-align: center;
        border: 1px solid #4198ce;
        background-color: #4198ce;
        cursor: pointer;
    }

    /* Hide the filter container by default, using !important to override the theme */
    #collapsible-filters {
        display: none !important;
    }

    /* Show the container when JS adds the 'is-open' class, using !important */
    #collapsible-filters.is-open {
        display: block !important;
    }
}

/* Hide the toggle button on desktop */
@media (min-width: 769px) {
    #filter-toggle-btn {
        display: none;
    }
}

.blm-boat-search-form {
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    padding: 20px;
    margin-bottom: 30px;
    border-radius: 0 5px 5px;
}
.blm-filter-container
{
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    padding: 20px;
    margin-bottom: 30px;
    border-radius: 5px;
}
.blm-filter-container .widget-title,
.blm-boat-search-form h4 {
    font-size: 1.4em;
    margin: 0 0 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}
.blm-filter-container .filter-group,
.blm-boat-search-form .blm-form-field,
.blm-boat-search-form .blm-form-row {
    margin-bottom: 0;
}
.blm-filter-container label,
.blm-boat-search-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}
.blm-filter-container input,
.blm-filter-container select,
.blm-boat-search-form input,
.blm-boat-search-form input[type="date"],
.blm-boat-search-form select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}
.blm-filter-container .button-group,
.blm-boat-search-form .blm-submit-field {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}
.blm-filter-container button,
.blm-filter-container a.clear-filters-button,
.blm-boat-search-form .blm-search-button {
    flex: 1;
    padding: 12px 20px;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.1em;
    text-align: center;
    text-decoration: none;
    background-color: #0073aa;
}
.blm-filter-container a.clear-filters-button {
    background-color: #777;
}
.blm-filter-container button:hover,
.blm-filter-container a.clear-filters-button:hover,
.blm-boat-search-form .blm-search-button:hover {
    opacity: 0.9;
}

/* --- Boat Grid & Card Styles --- */
.blm-boat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}
.blm-boat-card,
.blm-boat-grid-item {
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    text-align: center;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
.blm-boat-card:hover,
.blm-boat-grid-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}
.blm-boat-card .blm-boat-thumbnail-link,
.blm-boat-grid-item .blm-boat-thumbnail-link {
    display: block;
    height: 200px;
}
.blm-boat-card img,
.blm-boat-grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.blm-boat-card .entry-header,
.blm-boat-grid-item .entry-header {
    padding: 20px 15px 10px;
}
.blm-boat-card .entry-title,
.blm-boat-grid-item .entry-title {
    font-size: 1.4em;
    font-weight: 600;
    margin: 0 0 5px;
}
.blm-boat-card .entry-title a,
.blm-boat-grid-item .entry-title a {
    text-decoration: none;
    color: #2c3e50;
}
.blm-boat-card .entry-summary,
.blm-boat-grid-item .entry-summary {
    font-size: 0.95em;
    color: #666;
    padding: 0 15px 15px;
    flex-grow: 1;
}
.blm-boat-card .blm-boat-meta,
.blm-boat-grid-item .blm-boat-meta {
     padding: 0 15px 15px;
}
.blm-boat-card .blm-boat-price {
    font-weight: bold;
    color: #0073aa;
    font-size: 1.1em;
    margin: 10px 0;
}
.blm-boat-card .blm-view-boat-button,
.blm-boat-grid-item .blm-view-boat-button {
    display: block;
    padding: 12px 15px;
    background-color: #3498db;
    color: white !important;
    text-decoration: none;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    margin-top: auto;
}

/* --- Single Boat Page Styles --- */
.blm-single-boat-gallery-wrapper {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
}
.blm-main-image-container {
    flex: 3;
    height: 480px;
}
.blm-main-gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.blm-thumbnails-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    height: 480px;
}
.blm-thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.blm-input-wrapper { position: relative; }
.blm-input-wrapper .dashicons { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); pointer-events: none; color: #777; }
.blm-input-wrapper input { padding-right: 35px !important; }

/* --- Checkout Page Styles --- */
.blm-booking-page-wrapper,
.blm-checkout-wrapper { display: flex; flex-wrap: wrap; gap: 30px; }
.blm-booking-form-col,
.blm-checkout-form-col { flex: 2; min-width: 320px; }
.blm-boat-details-col,
.blm-checkout-summary-col { flex: 1; min-width: 280px; background: #f9f9f9; border: 1px solid #eee; padding: 20px; border-radius: 5px; }

/* --- Pagination --- */
.pagination { margin-top: 40px; text-align: center; }
.page-numbers { display: inline-block; padding: 8px 12px; margin: 0 4px; border: 1px solid #ddd; text-decoration: none; color: #0073aa; border-radius: 3px; }
.page-numbers.current, .page-numbers:hover { background-color: #0073aa; color: #fff; }

/* --- Responsive Adjustments --- */
@media (max-width: 991px) {
    .blm-single-boat-gallery-wrapper { flex-direction: column; }
    .blm-thumbnails-grid { grid-template-columns: repeat(4, 1fr); height: auto; }
    .blm-thumbnail-item { height: 120px; }
}
@media (max-width: 767px) {
    .blm-booking-form-row { flex-direction: column; gap: 0; }
    .blm-booking-form-column { width: 100%; margin-bottom: 15px; }
    .blm-booking-page-wrapper, .blm-checkout-wrapper { flex-direction: column-reverse; }
}
/* --- Style Tour Page to Match Boat Page --- */

/* 1. Make the tour list a responsive grid */
.blm-tour-list-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

/* 2. Style the individual tour card */
.blm-tour-item-card {
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column; /* Stack content vertically like the boat card */
    text-align: center;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.blm-tour-item-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

/* 3. Style the card's image */
.blm-tour-item-image {
    width: 100%;
    height: 200px; /* Give it a fixed height */
    overflow: hidden;
}

.blm-tour-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 4. Style the card's text content */
.blm-tour-item-content {
    padding: 20px 15px 15px;
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Allows footer to stick to the bottom */
}

.blm-tour-item-content h3 {
    font-size: 1.4em;
    font-weight: 600;
    margin: 0 0 10px 0;
}

.blm-tour-item-content h3 a {
    color: #2c3e50;
    text-decoration: none;
}

.blm-tour-item-meta {
    color: #555;
    font-size: 0.9em;
    margin-bottom: 10px;
}

.blm-tour-item-meta p {
    margin: 3px 0;
}

.blm-tour-item-meta .dashicons {
    font-size: 16px;
    vertical-align: middle;
}

.blm-tour-item-features {
    margin-bottom: 15px;
    font-size: 0.9em;
}

/* 5. Style the card's footer (price) */
.blm-tour-item-footer {
    border-top: 1px solid #eee;
    padding-top: 15px;
    margin-top: auto; /* Pushes the footer to the bottom */
}

.blm-tour-price-label {
    display: block;
    font-size: 0.85em;
    color: #777;
}

.blm-tour-price-amount {
    font-size: 1.3em;
    font-weight: 600;
    color: #0775bf;
}
/* --- UNIFIED STYLES FOR ALL FILTERS --- */

/* 1. Main filter container styling */
.blm-filter-container,
.blm-filter-widget {
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    padding: 20px;
    margin-bottom: 30px;
    border-radius: 5px;
}

/* 2. Filter title styling */
.blm-filter-container .widget-title,
.blm-filter-widget h4 {
    font-size: 1.5em;
    margin-top: 0;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

/* 3. Styling for each row (label + input) */
.blm-filter-container .filter-group,
.blm-filter-widget .blm-filter-field {
    margin-bottom: 15px;
}

/* 4. General label styling */
.blm-filter-container .filter-group label,
.blm-filter-widget .blm-filter-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

/* 5. General input and select field styling */
.blm-filter-container input[type="number"],
.blm-filter-container select,
.blm-filter-widget input[type="number"],
.blm-filter-widget select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

/* 6. General button styling */
.blm-filter-container button,
.blm-filter-widget button {
    width: 100%;
    padding: 10px;
    background-color: #0775bf;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    margin-top: 10px;
}
.blm-filter-container button:hover,
.blm-filter-widget button:hover {
     background-color: #005f8a;
}

/* --- DESKTOP: Two-Column Filter Layout --- */
@media (min-width: 769px) {
    .blm-filter-container .filter-group,
    .blm-filter-widget .blm-filter-field {
        display: flex;
        align-items: center;
        gap: 15px;
    }

    .blm-filter-container .filter-group label,
    .blm-filter-widget .blm-filter-field label {
        flex-basis: 120px;
        flex-shrink: 0;
        text-align: right;
        margin-bottom: 0; /* Remove bottom margin for flex layout */
    }

    .blm-filter-container .filter-group input[type="number"],
    .blm-filter-container .filter-group select,
    .blm-filter-widget .blm-filter-field input[type="number"],
    .blm-filter-widget .blm-filter-field select {
        flex-grow: 1;
    }
}
/*
 * Creates a 2-column layout for the date fields in the search form.
*/

/* This targets the div that wraps both date fields */
.booking-form-placeholder .blm-form-row {
    display: flex;
    gap: 20px; /* This adds a space between the two date fields */
}

/* This targets each individual date field */
.booking-form-placeholder .blm-form-row .blm-form-field {
    flex: 1; /* This tells each field to take up an equal amount of the available space */
}
/*--------------------------------------------------------------
# Search Form Tabs
--------------------------------------------------------------*/
.blm-search-tabs {
    display: flex;
    margin-bottom: -1px; /* Pulls the form up to meet the tab border */
}

.blm-tab-link {
    padding: 10px 20px;
    border: 1px solid transparent;
    border-bottom: 1px solid #ddd;
    background-color: #eee;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: #555;
    border-radius: 5px 5px 0 0; /* Rounded top corners */
}

.blm-tab-link.active {
    background-color: #f9f9f9;
    border-color: #ddd;
    border-bottom: 1px solid var(--white);
    color: var(--primary-color); /* Uses the primary color for active text */
}