/* --- CSS Variables for Theme Color --- */
:root {
    --primary-color: #fa5754; /* Red/pink accent color */
    --primary-light: #ffe6e6; /* Very light background for specialization box */
    --secondary-color: #28a745; /* New: Green color for location/price */
    --secondary-light: #e6ffe6; /* New: Light green for status tag background */
}

#keyword_filter {
    border: 1px solid #ddd;
    padding: 5px;
    width: 100%;
    border-radius: 5px;
    color: #848484;
}

.vendors-list-container {
    width: 100%;
}
/* --- Listing Container (Wrapper for Grid) --- */
.vendor-listing-full-width {
    margin: 0 auto;
    padding: 20px 15px; /* Add padding for breathing room */
}

/* --- New: Main Grid Layout (Filters + List) --- */
.listing-page-grid {
    display: flex;
    gap: 30px; /* Space between filter sidebar and list */
    /* Removed flex-wrap: wrap; to prevent layout breaking on desktop */
}

/* --- New: Filter Panel Column --- */
.filter-panel-column {
    width: 280px; /* Fixed width for the sidebar */
    flex-shrink: 0;
}

@media (max-width: 991px) {
    .listing-page-grid {
        flex-wrap: wrap; /* Only wrap on smaller screens */
    }

    .filter-panel-column {
        width: 100%; /* Full width on tablets and mobile */
        position: static; /* Remove sticky on mobile */
    }
    
    .filter-panel-card {
        position: static;
        margin-bottom: 20px;
    }
}

/* --- New: Vendor List Column (Takes up remaining space) --- */
.vendor-list-column {
    flex-grow: 1;
    min-width: 0; /* Ensures content doesn't overflow */
}

/* --- New: Filter Card Styles --- */
.filter-panel-card {
    background-color: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    padding: 25px;
    margin-bottom: 30px;
    position: sticky;
    top: 20px;
    border: 1px solid #f0f0f0;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.filter-title {
    font-size: 1.2em;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
    border: none;
}

.filter-title i {
    margin-right: 8px;
    color: var(--primary-color);
}

.btn-reset-filters {
    color: #95a5a6;
    font-size: 0.9em;
    transition: color 0.2s;
}

.btn-reset-filters:hover {
    color: var(--primary-color);
}

.filter-group {
    margin-bottom: 25px;
}

.filter-label {
    display: block;
    font-size: 0.85em;
    font-weight: 700;
    color: #34495e;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Input & Select Styling */
.input-icon-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #bdc3c7;
}

.filter-text-input {
    width: 100%;
    padding: 12px 12px 12px 50px; /* Increased padding for icon */
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95em;
    color: #2c3e50;
    transition: all 0.2s;
    background-color: #f9f9f9;
}

/* Rating Filter Styles */
.filter-radio-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    cursor: pointer;
}

.filter-radio-item input[type="radio"] {
    accent-color: var(--primary-color);
    width: 16px;
    height: 16px;
    margin-right: 10px;
    cursor: pointer;
}

.filter-radio-item label {
    font-size: 0.95em;
    color: #555;
    cursor: pointer;
    margin: 0;
    display: flex;
    align-items: center;
}

.filter-radio-item .stars {
    color: #f39c12; /* Star color */
    margin-right: 5px;
    font-size: 0.9em;
}

.filter-text-input:focus {
    border-color: var(--primary-color);
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(250, 87, 84, 0.1);
    outline: none;
}

/* Checkbox Styling */
.services-list-container {
    max-height: 300px;
    overflow-y: auto;
    padding-right: 5px;
}

/* Custom Scrollbar for services list */
.services-list-container::-webkit-scrollbar {
    width: 4px;
}
.services-list-container::-webkit-scrollbar-track {
    background: #f1f1f1; 
}
.services-list-container::-webkit-scrollbar-thumb {
    background: #ddd; 
    border-radius: 2px;
}

.filter-checkbox-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    cursor: pointer;
}

.filter-checkbox-item input[type="checkbox"] {
    accent-color: var(--primary-color);
    width: 16px;
    height: 16px;
    margin-right: 10px;
    cursor: pointer;
}

.filter-checkbox-item label {
    font-size: 0.95em;
    color: #555;
    cursor: pointer;
    margin: 0;
    line-height: 1.4;
}

.filter-checkbox-item:hover label {
    color: var(--primary-color);
}

/* Apply Button */
.btn-apply-filters {
    display: block;
    width: 100%;
    background-color: var(--primary-color);
    color: white;
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 6px rgba(250, 87, 84, 0.2);
}

.btn-apply-filters:hover {
    background-color: #e64542;
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(250, 87, 84, 0.3);
}

.btn-apply-filters:active {
    transform: translateY(0);
}

.btn-apply-filters:hover {
    background-color: #d84542;
}

.btn-clear-filters {
    display: block;
    width: 100%;
    text-align: center;
    color: #777;
    padding: 10px;
    text-decoration: none;
    font-weight: 500;
}
/* -------------------------------------- */


/* --- Vendor Row Card (Full-Width Item) --- */
.vendor-row-card {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.1);
    position: relative; /* Needed for absolute positioning of status/tag */
    overflow: hidden;
    display: flex; 
    margin-bottom: 30px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.vendor-row-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

/* --- 1. Left Image Container --- */
.vendor-row-image-container {
    width: 200px; 
    overflow: hidden;
    padding: 10px;
    flex-shrink: 0;
}

.vendor-row-image {
    width: 180px;
    height: 180px;
    object-fit: cover; 
    display: block;
    margin:auto;
    border-radius: 20px;
}

/* --- New: Vendor Status Tag (Top Right Corner) --- */
.vendor-row-review-status {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 0.8em;
    font-weight: 600;
    color: var(--primary-color);
    background-color: var(--secondary-light);
    border: 1px solid var(--primary-color);
    padding: 4px 10px;
    border-radius: 6px;
    z-index: 10;
}

/* --- 2. Right Details Content Area --- */
.vendor-row-details-content {
    flex-grow: 1;
    padding: 15px;
    display: flex;
    flex-direction: column; 
}

/* Header & Logo/Rating */
.vendor-row-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start; /* Align header items to the top */
}

.vendor-title-block {
    display: flex;
    align-items: center;
}

.vendor-full-logo {
    height: 40px; 
    margin-right: 15px;
    object-fit: contain;
}

.vendor-row-name {
    font-size: 1.8em;
    font-weight: 700;
    color: #333;
    margin: 0;
}

/* Rating Styles */
.vendor-row-rating {
    display: flex;
    align-items: center;
    font-size: 1em;
    color: var(--primary-color);
}
.vendor-row-rating .rating-icon { color: #ffc100; } 
.vendor-row-description {
    color: #666;
    line-height: 1.5;
    margin-top: 10px;
}


/* --- 3. Specializations Block (The Isolated Pink Box) --- */
.vendor-row-services {
    margin: 10px 0 20px;
    padding: 15px;
    background-color: var(--primary-light); 
    border-radius: 8px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    flex-shrink: 0; 
}

.services-label {
    font-size: 0.9em;
    font-weight: 600;
    color: #333;
    margin-right: 15px;
    flex-shrink: 0;
}

.service-tag {
    display: inline-block;
    background-color: transparent;
    color: var(--primary-color);
    padding: 2px 8px;
    margin-right: 8px;
    margin-bottom: 5px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 600;
    border: 1px solid var(--primary-color);
}

.vendor-row-footer-actions {
    border-top: 1px solid #eee;
    display: flex; /* Enable Flexbox layout */
    justify-content: space-between; /* Push items to opposite ends (Address left, Button right) */
    align-items: center; /* Vertically align items in the middle */
    padding-top: 15px; /* Add some space above this section */
}

.vendor-footer-info {
    flex-grow: 1; /* Allow the address container to take up maximum available space */
    margin-right: 20px; /* Add some horizontal spacing between the address and the button */
    /* You might want to adjust font size/color here */
}

/* 3. Address text style */
.vendor-row-location {
    font-size: 0.9rem; /* Use a smaller, cleaner font size */
    color: #6c757d; /* Use a muted color for secondary info */
    line-height: 1.4;
    margin: 0; /* Remove default paragraph margins */
}

.vendor-row-location i {
    margin-right: 5px;
}

/* Price Block: Ensures vertical alignment (the fix) */
.vendor-row-price-block {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    /* Removed unnecessary padding and centering */
    align-items: center; 
    padding-top: 20px;
}

.price-label {
    font-size: 0.8em;
    color: #999;
    margin: 0;
}

.price-amount {
    font-size: 1.6em;
    font-weight: 800;
    /* Updated color to green */
    color: var(--primary-color); 
    margin: 0;
}

/* 4. Button style */
.btn-view-row-profile {
    background-color: var(--primary-color);
    color: white;
    flex-shrink: 0; /* Prevents the button from shrinking when space is tight */
    /* Ensure your button styles (padding, color, height) match your design */
    padding: 10px 20px;
    text-align: center;
    border-radius: 8px;
    font-weight: 600;
    min-width: 150px; /* Give the button a fixed width to ensure it looks consistent */
    /* Example: background-color: #f75d59; color: white; border-radius: 5px; */
}

.btn-view-row-profile:hover {
    background-color: #d84542;
    color: white;
}


/* --- Responsive Adjustments --- */
@media (max-width: 991px) {
    /* Tablet/Smaller Desktop: Adjust layout */
    .listing-page-grid {
        gap: 20px;
        flex-direction: column;
    }
    .filter-panel-column {
        width: 100%; 
    }
    
    /* Also make card responsive at this breakpoint */
    .vendor-row-card {
        flex-direction: column;
    }
    .vendor-row-image-container {
        width: 100%;
        max-height: none; /* Let it grow */
        margin: auto;
        padding: 20px 20px 0;
        text-align: center;
    }
    
    .vendor-row-image {
        width: 120px;
        height: 120px;
        border-radius: 12px; /* Not circle, but rounded rect */
        margin: 0 auto;
    }

    .vendor-row-details-content {
        padding: 20px;
    }
    .vendor-row-header {
        flex-direction: column;
        align-items: center; /* Center align header items */
        text-align: center;
    }
    .vendor-title-block {
        margin-bottom: 5px;
        justify-content: center;
    }
    /* Center the rating stars */
    .vendor-row-rating {
        justify-content: center;
        margin-bottom: 10px;
    }
    
    .vendor-row-description {
        text-align: center;
    }
    
    .vendor-row-services {
        justify-content: center;
    }

    .vendor-row-footer-actions {
        flex-direction: column;
        align-items: center;
        gap: 15px;
        text-align: center;
    }
    
    .vendor-footer-info {
        margin-right: 0;
    }
    
    .btn-view-row-profile {
        width: 100%;
        text-align: center;
        align-self: stretch; 
    }

    .vendor-row-review-status {
        position: static;
        margin: 10px auto 0;
        text-align: center;
        display: inline-block;
    }
    
    /* Also handle the price block which might be inside image container */
    .vendor-row-price-block {
        position: static;
        margin-top: 10px;
        padding-top: 5px;
    }
}

@media (max-width: 768px) {
    /* Additional tweaks for very small screens if needed, 
       but the 991px block should cover most mobile cases now. */
    .vendor-row-image {
        width: 100px;
        height: 100px;
    }
    .vendor-row-name {
        font-size: 1.5em; /* Smaller title on mobile */
    }
}

.hidden-content {
    display: none; 
}

.view-more-toggle {
    color: var(--primary-color);
    cursor: pointer;
    font-weight: 600;
    margin-left: 5px;
    white-space: nowrap; 
}
.list {
  max-height: 200px;
  overflow-y: scroll !important;
}

/* --------------------------------------
   NO RESULTS MESSAGE STYLES (.no-results-message)
   -------------------------------------- */
.no-results-message {
    /* Layout and Spacing */
    padding: 40px 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    
    /* Appearance */
    background-color: var(--primary-light); /* Light background to stand out */
    border: 1px dashed #c0ccda; /* Dashed border for attention */
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    
    /* Ensure it takes full width of the vendor list column */
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.no-results-message h3 {
    color: #334e68; /* Darker heading text */
    margin-bottom: 0.5rem;
    font-size: 1.5rem; /* text-2xl from Tailwind */
}

.no-results-message p {
    color: #606f84;
    line-height: 1.6;
}

.no-results-message ul {
    text-align: left;
    margin-left: 20px;
}

.no-results-message .btn-clear-filters-large {
    /* Button Styling */
    display: inline-block;
    padding: 10px 25px;
    margin-top: 20px;
    background-color: #f56565; /* Red color for a clear action */
    color: white;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    transition: background-color 0.2s ease;
    border: none;
    cursor: pointer;
}

.no-results-message .btn-clear-filters-large:hover {
    background-color: #e53e3e;
    box-shadow: 0 4px 10px rgba(229, 62, 62, 0.4);
}
.review-count {
    padding-left: 5px;
}

.sort-by-container {
    /* 1. Enable Flexbox for the container */
    display: flex;
    /* 2. Push all content (label and select) to the right side */
    justify-content: flex-end;
    /* 3. Vertically align items in the center (optional, but good practice) */
    align-items: flex-end;;
    width: 300px;
    margin: auto;
    padding-bottom: 10px;
    float: right;
}

.sort-by-container label {
    margin-right: 5px; 
    width: 100px;
}
.upper-container {
    width: 100%;
    align-content: flex-end;
}


/* --- Star Icon General Styling --- */

/* Style applied to all star icons to set base size and alignment */
.vendor-row-rating .star-icons i {
    font-size: 1rem;       /* Set desired size */
    margin-right: 2px;     /* Small spacing between stars */
    line-height: 1;        /* Helps vertical alignment */
}

/* --- Color Definition: Filled Stars (Full and Half) --- */

/* Use gold for standard rating visual, which is recognized by users */
.vendor-row-rating .full-star,
.vendor-row-rating .half-star {
    /* !important is used here only as a debugging measure if a global style is overriding */
    color: gold !important; 
}

/* --- Color Definition: Empty/Outline Stars --- */

.vendor-row-rating .empty-star {
    /* Neutral gray color for stars that are not rated */
    color: #ccc;
}

/* --- Optional: General Rating Container Layout --- */
.vendor-row-rating {
    display: flex;
    align-items: center;
    gap: 5px; /* Space between stars and review count text */
}

.vendor-row-rating .review-count {
    font-size: 0.85rem;
    color: #6c757d;
}
/* --- Mobile Filter Toggle Button --- */
.btn-mobile-filter-toggle {
    display: none; /* Hidden on desktop */
}

/* --- Mobile Filter Wrapper --- */
.mobile-filter-wrapper {
    display: block; /* Visible on desktop */
}

@media (max-width: 991px) {
    .btn-mobile-filter-toggle {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        padding: 15px;
        background-color: #fff;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        font-weight: 600;
        margin-bottom: 15px;
        color: #2c3e50;
        cursor: pointer;
        transition: background-color 0.2s;
    }

    .btn-mobile-filter-toggle:hover {
        background-color: #f9f9f9;
        /* No rotation on hover usually */
    }

    .btn-mobile-filter-toggle i {
        color: var(--primary-color);
    }
    
    .btn-mobile-filter-toggle i#filter-arrow {
        color: #95a5a6;
        transition: transform 0.3s ease;
    }

    .btn-mobile-filter-toggle.active i#filter-arrow {
        transform: rotate(180deg);
    }

    .mobile-filter-wrapper {
        display: none; /* Hidden by default on mobile */
    }

    .mobile-filter-wrapper.active {
        display: block; /* Show when active */
        animation: fadeIn 0.3s ease-in-out;
    }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 991px) {
    .sort-by-container {
        width: 100%;
        float: none;
        justify-content: space-between;
        margin-bottom: 15px;
    }
    
    .sort-by-container label {
        width: auto;
        white-space: nowrap;
    }
    
    .sort-by-container .filter-select {
        flex-grow: 1;
        max-width: none;
    }
}
