.censo-search-container, .censo-search-wrapper {
    max_width: 800px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.censo-search-box {
    position: relative;
    margin-bottom: 30px;
}

.censo-input-container {
    position: relative;
}

#censo-search-input {
    width: 100%;
    padding: 15px 40px 15px 15px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    text-transform: uppercase;
}

#censo-search-input:focus {
    border-color: #007cba;
    outline: none;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

.censo-clear-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    color: #999;
    cursor: pointer;
    line-height: 1;
}

.censo-clear-icon:hover {
    color: #333;
}

.censo-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #eee;
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    z-index: 1000;
    display: none;
    max-height: 400px;
    overflow-y: auto;
}

.censo-dropdown-header {
    padding: 10px 15px;
    font-size: 11px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    border-bottom: 1px solid #f0f0f0;
    letter-spacing: 0.5px;
}

.censo-dropdown ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.censo-dropdown li {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f5f5f5;
    display: flex;
    align-items: center;
    transition: background-color 0.2s;
}

.censo-dropdown li:last-child {
    border-bottom: none;
}

.censo-dropdown li:hover {
    background-color: #f9f9f9;
}

.censo-item-icon {
    margin-right: 15px;
    color: #ccc;
}

.censo-item-info {
    display: flex;
    flex-direction: column;
}

.censo-item-name {
    font-size: 15px;
    color: #333;
    margin-bottom: 2px;
}

.censo-item-name strong {
    font-weight: 700;
    color: #000;
}

.censo-item-cif {
    font-size: 12px;
    color: #888;
}

.censo-dropdown-footer {
    padding: 10px 15px;
    font-size: 12px;
    color: #999;
    text-align: center;
    background: #fafafa;
    border-top: 1px solid #eee;
}

.censo-no-results {
    padding: 20px;
    text-align: center;
    color: #777;
}

/* Results Cards */
.censo-results-title {
    font-size: 24px;
    margin-bottom: 25px;
    color: #222;
    border-bottom: 2px solid #eee;
    padding-bottom: 15px;
}

.censo-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
    margin: 0 auto 0; /* let the search box control vertical spacing */
    max-width: 1200px;
    width: 100%;
}

.censo-result-card {
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.censo-result-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

.censo-card-header {
    background: #f8f9fa;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.censo-header-row {
    margin-bottom: 10px;
}

.censo-header-row.stacked {
    display: flex;
    flex-direction: column;
}

.censo-header-row.stacked .censo-card-title {
    margin-top: 5px;
    display: block;
}

.censo-header-row:last-child {
    margin-bottom: 0;
}

.censo-header-label {
    color: #888;
    font-weight: 600;
    margin-right: 5px;
    font-size: 12px;
}

.censo-badge {
    display: inline-block;
    background: #9C0A23;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.censo-card-title {
    display: inline;
    margin: 0;
    font-size: 18px;
    line-height: 1.4;
    color: #333;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.censo-card-body {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.censo-info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 14px;
    border-bottom: 1px solid #f5f5f5;
    padding-bottom: 8px;
    align-items: flex-start;
}

.censo-info-row:last-child {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.censo-info-row.full-width {
    flex-direction: column;
    align-items: flex-start;
}

.censo-info-row.full-width .censo-value {
    margin-top: 4px;
    text-align: left;
}

.censo-label {
    color: #777;
    font-weight: 500;
    flex-shrink: 0;
    margin-right: 10px;
    max-width: 40%;
    font-size: 12px;
}

.censo-value {
    color: #333;
    font-weight: 600;
    text-align: right;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    flex-grow: 1;
    font-size: 14px;
}

/* Hide default theme titles on this page */
.page-id-censo-electoral .entry-title,
.page-id-censo-electoral .page-title,
.page-id-censo-electoral .site-title,
.page-id-censo-electoral .post-title {
    display: none !important;
}

/* Generic fallback if body class is not present but css is loaded */
h1.entry-title,
h1.page-title,
.site-branding .site-title {
    display: none !important;
}

/* Mobile: keep 15px left/right margins and center results */
@media (max-width: 600px) {
    .censo-results-grid {
        margin: 20px 15px 0;
        max-width: none;
        width: auto;
    }
}
