/*
 * Business Directory Plugin Styles
 * Version: 3.3 (Final)
 */

/* --- Body & General Wrapper --- */
body {
    background-color: #f8f9fa;
}

#bd-directory-wrapper, .bd-single-page-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

    /* --- State > Category Layout --- */
    #bd-directory-wrapper .bd-state-group-wrapper {
        display: grid;
        /*        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
*/
        grid-template-columns: none;
        gap: 30px;
    }

    #bd-directory-wrapper .bd-state-group {
        background-color: #ffffff;
        border: 1px solid #e9ecef;
        border-radius: 8px;
        padding: 25px 30px;
        box-shadow: 0 4px 15px rgba(0,0,0,0.06);
        transition: all 0.3s ease;
    }

        #bd-directory-wrapper .bd-state-group:hover {
            transform: translateY(-5px);
            box-shadow: 0 8px 25px rgba(0,0,0,0.1);
        }

    #bd-directory-wrapper .bd-state-title {
        font-size: 1.6em;
        font-weight: 600;
        color: #333;
        margin-top: 0;
        margin-bottom: 20px;
        padding-bottom: 15px;
        border-bottom: 1px solid #f0f0f0;
        display: flex;
        align-items: center;
    }

        #bd-directory-wrapper .bd-state-title::before {
            font-family: 'dashicons';
            content: "\f231";
            margin-right: 10px;
            color: #007bff;
        }

    #bd-directory-wrapper .bd-category-list-by-state {
        list-style: none;
        padding: 0;
        margin: 0;
        column-count: 5;
        column-gap: 20px;
    }

        #bd-directory-wrapper .bd-category-list-by-state li {
            margin-bottom: 10px;
            padding-left: 18px;
            position: relative;
        }

            #bd-directory-wrapper .bd-category-list-by-state li::before {
                content: "\f138";
                font-family: 'dashicons';
                position: absolute;
                left: 0;
                top: 3px;
                font-size: 14px;
                color: #6c757d;
            }

            #bd-directory-wrapper .bd-category-list-by-state li a {
                text-decoration: none;
                color: #0056b3;
                font-size: 1em;
            }

                #bd-directory-wrapper .bd-category-list-by-state li a:hover {
                    text-decoration: underline;
                }

@media (max-width: 480px) {
    #bd-directory-wrapper .bd-category-list-by-state {
        column-count: 1;
    }
}

/* --- Filter Bar --- */
#bd-directory-wrapper .bd-filters {
    margin-bottom: 40px;
    padding: 15px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.06);
    text-align: center;
}

#bd-directory-wrapper .bd-search-form input, #bd-directory-wrapper .bd-search-form select {
    padding: 12px 15px;
    margin: 5px;
    border: 1px solid #ddd;
    border-radius: 6px;
    min-width: 220px;
    font-size: 16px;
}

    #bd-directory-wrapper .bd-search-form input[type="submit"] {
        background-color: #007bff;
        color: white;
        font-weight: bold;
        cursor: pointer;
    }

/* --- Loading Spinner --- */
#bd-directory-wrapper #bd-listings-container {
    position: relative;
    transition: min-height 0.2s ease-out;
}

    #bd-directory-wrapper #bd-listings-container.is-loading > * {
        opacity: 0.3;
    }

    #bd-directory-wrapper #bd-listings-container.is-loading::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 40px;
        height: 40px;
        margin: -20px 0 0 -20px;
        border: 4px solid #f3f3f3;
        border-top: 4px solid #007bff;
        border-radius: 50%;
        animation: spin 1s linear infinite;
        z-index: 10;
    }

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* --- Card Grid Layout --- */
#bd-directory-wrapper .bd-listings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

#bd-directory-wrapper .bd-listing-item-card {
    display: block;
    text-decoration: none;
    background-color: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 4px 25px rgba(0,0,0,0.07);
    transition: all 0.3s ease;
}

    #bd-directory-wrapper .bd-listing-item-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 8px 30px rgba(0,0,0,0.1);
    }

#bd-directory-wrapper .bd-card-content {
    padding: 20px 25px;
}

#bd-directory-wrapper .bd-listing-item-card h3 {
    margin: 0 0 15px;
    font-size: 1.3em;
    color: #333;
    font-weight: 600;
}

#bd-directory-wrapper .bd-card-meta {
    color: #6c757d;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

    #bd-directory-wrapper .bd-card-meta::before {
        font-family: 'dashicons';
        margin-right: 8px;
        color: #6c757d;
    }

    #bd-directory-wrapper .bd-card-meta.rating::before {
        content: "\f155";
        color: #ffb900;
    }

    #bd-directory-wrapper .bd-card-meta.location::before {
        content: "\f231";
    }

#bd-directory-wrapper .bd-rating-stars {
    font-weight: 700;
    color: #495057;
    margin-right: 5px;
}

#bd-directory-wrapper .bd-rating-count {
    font-size: 0.9em;
}

#bd-directory-wrapper .bd-rating-none {
    font-style: italic;
}

/* --- Pagination --- */
#bd-directory-wrapper .bd-pagination {
    margin-top: 40px;
    text-align: center;
}

    #bd-directory-wrapper .bd-pagination .page-numbers {
        display: inline-block;
        padding: 10px 18px;
        margin: 0 4px;
        border: 1px solid #ddd;
        border-radius: 6px;
        text-decoration: none;
        color: #007bff;
        background-color: #fff;
        transition: all 0.3s ease;
    }

        #bd-directory-wrapper .bd-pagination .page-numbers:hover {
            background-color: #e9ecef;
            border-color: #ccc;
        }

        #bd-directory-wrapper .bd-pagination .page-numbers.current {
            background-color: #007bff;
            color: #fff;
            border-color: #007bff;
        }


/*
--- START: Single Business Listing Page Styles ---
*/
.bd-single-hero {
    position: relative;
    padding: 80px 40px;
    margin-bottom: 40px;
    background-size: cover;
    background-position: center center;
    border-radius: 8px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 300px;
}

.bd-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgb(225 225 225);
    border-radius: 8px;
    z-index: 1;
}

.bd-hero-content {
    position: relative;
    z-index: 2;
}

    .bd-hero-content .entry-title {
        font-size: 3em;
        margin: 0;
    }

.bd-single-category {
    font-size: 1.1em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.bd-single-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
}

.bd-main-content {
    flex: 2;
    min-width: 300px;
}

.bd-sidebar {
    flex: 1;
    min-width: 280px;
}

.bd-single-section {
    margin-bottom: 40px;
}

h2.bd-section-title {
    font-size: 1.8em;
    margin-top: 0;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.bd-key-info-box {
    background-color: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 4px 25px rgba(0,0,0,0.07);
    position: sticky;
    top: 40px;
}

.bd-rating-display {
    text-align: center;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 25px;
    margin-bottom: 25px;
}

.bd-rating-score {
    font-size: 3.5em;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1;
}

.bd-rating-max {
    font-size: 0.4em;
    font-weight: 500;
    color: #6c757d;
}

.bd-rating-reviews {
    font-size: 0.9em;
    color: #6c757d;
    margin-top: 5px;
}

.bd-location-display h4 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.2em;
    display: flex;
    align-items: center;
}

    .bd-location-display h4 .dashicons {
        margin-right: 8px;
    }

.bd-location-display p {
    margin-top: 0;
    margin-bottom: 15px;
    color: #555;
    line-height: 1.6;
}

.bd-full-address {
    font-size: 1.1em;
}

.bd-location-map-link {
    display: inline-block;
    width: 100%;
    text-align: center;
    padding-top: 12px;
    padding-bottom: 12px;
    padding-right: 0px;
    padding-left: 0px;
    background-color: #28a745;
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    border-radius: 6px;
    transition: background-color 0.3s ease;
}

    .bd-location-map-link:hover {
        background-color: #218838;
    }

.bd-details-list {
    margin: 0;
    padding: 0;
    border: 1px solid #eee;
    border-radius: 6px;
    overflow: hidden;
}

    .bd-details-list dt, .bd-details-list dd {
        padding: 15px;
        margin: 0;
    }

    .bd-details-list dt {
        font-weight: 600;
        color: #333;
        background-color: #f8f9fa;
        border-bottom: 1px solid #eee;
    }

    .bd-details-list dd {
        color: #555;
        border-bottom: 1px solid #eee;
    }

        .bd-details-list dt:last-of-type, .bd-details-list dd:last-of-type {
            border-bottom: none;
        }
/* --- END: Single Business Listing Page Styles --- */
/*
--- Front-end Submission Form Styles ---
*/
.bd-submission-form {
    background-color: #fff;
    padding: 30px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 4px 25px rgba(0,0,0,0.07);
}

    .bd-submission-form p {
        margin-bottom: 20px;
    }

    .bd-submission-form label {
        display: block;
        font-weight: 600;
        margin-bottom: 8px;
        color: #333;
    }

    .bd-submission-form input[type="text"],
    .bd-submission-form input[type="url"],
    .bd-submission-form input[type="number"],
    .bd-submission-form textarea {
        width: 100%;
        padding: 12px;
        border: 1px solid #ddd;
        border-radius: 6px;
        font-size: 16px;
        box-sizing: border-box;
    }

    .bd-submission-form textarea {
        min-height: 120px;
    }

    .bd-submission-form input[type="submit"] {
        background-color: #28a745;
        color: white;
        font-weight: bold;
        cursor: pointer;
        padding: 12px 25px;
        border: none;
        border-radius: 6px;
        font-size: 16px;
    }

.bd-form-row {
    display: flex;
    gap: 20px;
}

    .bd-form-row p {
        flex: 1;
    }

.bd-hidden-fields {
    /* You can hide these by default if you want */
    /* display: none; */
}

.bd-notice {
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 1.1em;
}

.bd-success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.bd-error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/*
--- Styles for Embedded Map ---
*/

.bd-map-embed {
    margin-top: 25px;
    border-radius: 8px;
    overflow: hidden; /* Ensures the iframe corners are rounded */
    border: 1px solid #dee2e6;
}

    .bd-map-embed iframe {
        display: block; /* Removes any potential space below the iframe */
    }
#page {
    max-width: 1280px;
    margin: auto;
}
#headerimg h1 {
    font-size: 20px;
    font-family: 'Inter';
    font-weight: 800;
    text-decoration: none;
    margin-top: 50px;
}
#headerimg a {
    text-decoration: none;
}

/*
--- START: Mobile Responsiveness for Details Page ---
*/

@media (max-width: 768px) {
    #page {
        padding-left: 30px;
        padding-right: 30px;
    }
    #bd-directory-wrapper, .bd-single-page-content
    {
        padding:0;
    }
    /* Stack the main content and sidebar on top of each other */
    .bd-single-wrapper {
        flex-direction: column;
    }

    /* Make the sidebar no longer sticky on mobile */
    .bd-sidebar .bd-key-info-box {
        position: static;
        top: auto;
    }

    /* Adjust hero section padding for smaller screens */
    .bd-single-hero {
        padding: 40px 20px;
        min-height: 200px;
    }

    /* Make the title smaller on mobile for a better fit */
    .bd-hero-content .entry-title {
        font-size: 2.2em;
    }

    /* Adjust section title size on mobile */
    h2.bd-section-title {
        font-size: 1.5em;
    }
}
/*
--- END: Mobile Responsiveness for Details Page ---
*/