/**
 * EVContractors Directory Page Styles
 *
 * UPLOAD TO: /wp-content/themes/generatepress-child/evcontractors-directory.css
 *
 * Includes:
 * - Directory page layout (two-column grid)
 * - Filter sidebar styling
 * - FacetWP checkbox fix (overrides broken sprite rendering)
 * - Result card styling
 * - Reset button styling
 * - Responsive breakpoints
 */


/* ═══════════════════════════════════════════════
   DIRECTORY PAGE LAYOUT
   ═══════════════════════════════════════════════ */

.evc-directory-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 60px;
}

.evc-directory-header {
    text-align: center;
    padding: 40px 0 32px;
}

.evc-directory-header h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 10px;
}

.evc-directory-header p {
    color: #6b7280;
    font-size: 16px;
}


/* ═══════════════════════════════════════════════
   TWO-COLUMN LAYOUT
   ═══════════════════════════════════════════════ */

.evc-search-wrap {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 32px;
    align-items: start;
}

.evc-filters-col {
    position: sticky;
    top: 20px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
}

.evc-results-col {
    min-width: 0;
}


/* ═══════════════════════════════════════════════
   FILTER SIDEBAR
   ═══════════════════════════════════════════════ */

.evc-filters-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.evc-filter-label {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
}

.evc-filter-group {
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.evc-filter-group:last-child {
    border-bottom: none;
}

.evc-filter-group h4 {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #6b7280;
    margin: 0 0 10px;
}


/* ═══════════════════════════════════════════════
   CLEAR ALL FILTERS BUTTON
   ═══════════════════════════════════════════════ */

.evc-reset-btn {
    display: inline-block;
    background: #374151;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    line-height: 1;
    transition: background 0.2s ease;
}

.evc-reset-btn:hover {
    background: #1f2937;
}

.evc-reset-btn:active {
    background: #111827;
}


/* ═══════════════════════════════════════════════
   FACETWP CHECKBOX FIX
   Overrides the broken sprite-based checkboxes
   with clean CSS-only checkboxes.
   ═══════════════════════════════════════════════ */

/* Remove the broken background-image sprite */
.facetwp-checkbox {
    background-image: none !important;
    background: none !important;
    display: block !important;
    padding-left: 28px !important;
    position: relative !important;
    margin-bottom: 8px !important;
    cursor: pointer !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    color: #374151 !important;
}

/* Create a CSS checkbox using ::before */
.facetwp-checkbox::before {
    content: "" !important;
    position: absolute !important;
    left: 0 !important;
    top: 2px !important;
    width: 18px !important;
    height: 18px !important;
    border: 2px solid #d1d5db !important;
    border-radius: 4px !important;
    background: #fff !important;
    transition: all 0.15s ease !important;
    box-sizing: border-box !important;
}

/* Hover state */
.facetwp-checkbox:hover::before {
    border-color: #2563eb !important;
}

/* Checked state — blue fill with checkmark */
.facetwp-checkbox.checked {
    background-image: none !important;
    background: none !important;
    color: #111827 !important;
    font-weight: 600 !important;
}

.facetwp-checkbox.checked::before {
    background: #2563eb !important;
    border-color: #2563eb !important;
}

.facetwp-checkbox.checked::after {
    content: "" !important;
    position: absolute !important;
    left: 4px !important;
    top: 5px !important;
    width: 10px !important;
    height: 6px !important;
    border-left: 2px solid #fff !important;
    border-bottom: 2px solid #fff !important;
    transform: rotate(-45deg) !important;
    box-sizing: border-box !important;
}

/* Disabled state */
.facetwp-checkbox.disabled {
    opacity: 0.4 !important;
    cursor: default !important;
}

/* Counter styling */
.facetwp-checkbox .facetwp-counter {
    color: #9ca3af !important;
    font-weight: 400 !important;
    margin-left: 4px !important;
    font-size: 13px !important;
}

/* Display value (the label text) */
.facetwp-checkbox .facetwp-display-value {
    display: inline !important;
}


/* ═══════════════════════════════════════════════
   FACETWP SEARCH INPUT
   ═══════════════════════════════════════════════ */

.facetwp-search {
    width: 100%;
    padding: 10px 36px 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.facetwp-search:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}


/* ═══════════════════════════════════════════════
   FACETWP PAGER
   ═══════════════════════════════════════════════ */

.facetwp-pager {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-top: 32px;
    flex-wrap: wrap;
}

.facetwp-page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
    transition: all 0.15s;
}

.facetwp-page:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.facetwp-page.active {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
    font-weight: 600;
}


/* ═══════════════════════════════════════════════
   RESULTS AREA
   ═══════════════════════════════════════════════ */

.evc-results-header {
    margin-bottom: 16px;
    font-size: 13px;
    color: #6b7280;
}

.facetwp-template {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.evc-no-results {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
    font-size: 15px;
}


/* ═══════════════════════════════════════════════
   RESULT CARDS
   ═══════════════════════════════════════════════ */

.evc-result-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    position: relative;
    transition: box-shadow 0.2s ease;
}

.evc-result-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.evc-card--featured {
    border-color: #2563eb;
}

.evc-card-header {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 12px;
}

.evc-card-logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid #f0f0f0;
}

.evc-card-logo-placeholder {
    width: 60px;
    height: 60px;
    background: #2563eb;
    color: #fff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    flex-shrink: 0;
}

.evc-card-title-wrap {
    flex: 1;
    min-width: 0;
}

.evc-card-title {
    font-size: 17px;
    font-weight: 700;
    margin: 0 0 4px;
    line-height: 1.3;
}

.evc-card-title a {
    color: #111827;
    text-decoration: none;
}

.evc-card-title a:hover {
    color: #2563eb;
}

.evc-card-location {
    font-size: 13px;
    color: #6b7280;
}

.evc-card-desc {
    font-size: 14px;
    color: #4b5563;
    line-height: 1.5;
    margin-bottom: 10px;
}

.evc-card-phone {
    font-size: 14px;
    color: #374151;
    margin-bottom: 12px;
}

.evc-card-link {
    display: inline-block;
    font-size: 14px;
    font-weight: 600;
    color: #2563eb;
    text-decoration: none;
}

.evc-card-link:hover {
    text-decoration: underline;
}


/* ═══════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════ */

@media (max-width: 768px) {
    .evc-search-wrap {
        grid-template-columns: 1fr;
    }

    .evc-filters-col {
        position: static;
    }

    .facetwp-template {
        grid-template-columns: 1fr;
    }

    .evc-directory-header h1 {
        font-size: 24px;
    }
}

.evc-filter-divider {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 8px 0 16px;
}

/* ─── Browse by City Section ─── */
/* APPEND this to the bottom of evcontractors-directory.css */

.evc-browse-by-city {
    max-width: 1200px;
    margin: 48px auto 0;
    padding: 40px 24px;
    border-top: 1px solid #e0e0e0;
}

.evc-browse-by-city h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 8px;
    color: #1a1a1a;
}

.evc-browse-by-city > p {
    color: #666;
    margin: 0 0 24px;
    font-size: 0.95rem;
}

.evc-city-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 24px;
}

.evc-city-group h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1E8449;
    margin: 0 0 8px;
    padding-bottom: 6px;
    border-bottom: 2px solid #1E8449;
}

.evc-city-group ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.evc-city-group li {
    margin: 0 0 4px;
}

.evc-city-group a {
    color: #333;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.15s;
}

.evc-city-group a:hover {
    color: #1E8449;
    text-decoration: underline;
}

.evc-filter-divider {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 8px 0 16px;
}
