/* ============================================================
   NOBLE — Find Your Rep Page Styles
   ============================================================ */

/* ── Page hero ──────────────────────────────────────────────── */
.rep-hero {
    background: #3a7bc8;
    padding: 60px 0 52px;
    text-align: center;
}
.rep-hero .section-label { color: rgba(255,255,255,0.60); }
.rep-hero h1 {
    font-family: var(--font-logo);
    font-size: 2.6rem;
    font-weight: 700;
    color: var(--white);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin: 10px 0 14px;
}
.rep-hero p {
    font-size: 1rem;
    color: rgba(255,255,255,0.70);
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.7;
}

/* ── Map section ────────────────────────────────────────────── */
.map-section {
    padding: 64px 0 80px;
    background: var(--gray-100);
}

.map-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 40px;
    align-items: start;
}

/* ── SVG map ─────────────────────────────────────────────────── */
.map-wrap {
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 2px 16px rgba(13,36,98,0.08);
    padding: 24px;
    overflow: hidden;
}
.map-wrap svg {
    width: 100%;
    height: auto;
    display: block;
}

#us-map-container {
    min-height: 340px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Default state fill & transitions */
.map-wrap svg path.state {
    fill: var(--gray-200);
    stroke: rgba(255,255,255,0.85);
    stroke-width: 0.75;
    cursor: pointer;
    transition: opacity 0.15s ease;
}
.map-wrap svg path.state:hover {
    opacity: 0.78;
}
.map-wrap svg path.state.active {
    stroke: var(--navy-dark);
    stroke-width: 2;
    opacity: 1;
}

/* Split states get a dashed outline to signal they are shared */
.map-wrap svg path.state--split {
    stroke: rgba(255,255,255,0.95);
    stroke-width: 1;
    stroke-dasharray: 4 2;
}
.map-wrap svg path.state--split:hover {
    opacity: 0.82;
}

/* ── Region picker (split-state disambiguation) ─────────────── */
.rep-picker-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(9, 26, 72, 0.45);
    backdrop-filter: blur(3px);
    z-index: 2100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
}
.rep-picker-backdrop.open {
    opacity: 1;
    pointer-events: all;
}

.rep-picker {
    background: var(--white);
    border-radius: 18px;
    box-shadow: 0 24px 64px rgba(9,26,72,0.28);
    width: 100%;
    max-width: 380px;
    overflow: hidden;
    transform: translateY(16px) scale(0.97);
    transition: transform 0.22s ease;
}
.rep-picker-backdrop.open .rep-picker {
    transform: translateY(0) scale(1);
}

.rep-picker-header {
    background: var(--navy);
    padding: 18px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}
.rep-picker-title {
    font-family: var(--font-logo);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--white);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.rep-picker-options {
    padding: 12px 0;
}

.rep-picker-option {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 14px 24px;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s ease;
    border-bottom: 1px solid var(--gray-100);
}
.rep-picker-option:last-child {
    border-bottom: none;
}
.rep-picker-option:hover {
    background: var(--gray-100);
}

.rep-picker-swatch {
    width: 14px;
    height: 36px;
    border-radius: 4px;
    flex-shrink: 0;
}

.rep-picker-option-body {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
    min-width: 0;
}
.rep-picker-region {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--navy);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.rep-picker-name {
    font-size: 0.78rem;
    color: var(--gray-500);
}

.rep-picker-arrow {
    color: var(--gray-400);
    font-size: 0.75rem;
    flex-shrink: 0;
}

/* ── Sidebar: legend + prompt ───────────────────────────────── */
.map-sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.map-prompt {
    background: var(--white);
    border-radius: 14px;
    padding: 28px 24px;
    box-shadow: 0 2px 12px rgba(13,36,98,0.07);
    text-align: center;
    border-top: 4px solid var(--red);
}
.map-prompt i {
    font-size: 2rem;
    color: var(--red);
    margin-bottom: 12px;
    display: block;
}
.map-prompt p {
    font-size: 0.9rem;
    color: var(--gray-600);
    line-height: 1.6;
}

.map-legend {
    background: var(--white);
    border-radius: 14px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(13,36,98,0.07);
}
.map-legend h3 {
    font-family: var(--font-logo);
    font-size: 0.8rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--navy);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--red);
    display: inline-block;
}
.legend-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    list-style: none;
    padding: 0;
    margin: 0;
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--gray-800);
    cursor: pointer;
    border-radius: 6px;
    padding: 4px 6px;
    transition: background 0.2s;
}
.legend-item:hover { background: var(--gray-100); }
.legend-swatch {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    flex-shrink: 0;
}

/* ── Rep popup ───────────────────────────────────────────────── */
.rep-popup-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(9, 26, 72, 0.45);
    backdrop-filter: blur(3px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.rep-popup-backdrop.open {
    opacity: 1;
    pointer-events: all;
}

.rep-popup {
    background: var(--white);
    border-radius: 18px;
    box-shadow: 0 24px 64px rgba(9,26,72,0.28);
    width: 100%;
    max-width: 440px;
    overflow: hidden;
    transform: translateY(20px) scale(0.97);
    transition: transform 0.25s ease;
}
.rep-popup-backdrop.open .rep-popup {
    transform: translateY(0) scale(1);
}

.rep-popup-header {
    background: var(--navy);
    padding: 24px 28px 20px;
    display: flex;
    align-items: center;
    gap: 18px;
    position: relative;
}
.rep-popup-photo {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255,255,255,0.25);
    flex-shrink: 0;
    background: var(--navy-dark);
}
.rep-popup-photo-placeholder {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    border: 3px solid rgba(255,255,255,0.20);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.6rem;
    color: rgba(255,255,255,0.55);
}
.rep-popup-name {
    font-family: var(--font-logo);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--white);
    letter-spacing: 0.04em;
}
.rep-popup-title {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.65);
    margin-top: 3px;
}
.rep-popup-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: rgba(255,255,255,0.12);
    border: none;
    color: rgba(255,255,255,0.70);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}
.rep-popup-close:hover { background: var(--red); color: var(--white); }

.rep-popup-body {
    padding: 24px 28px 28px;
}
.rep-contact-list {
    list-style: none;
    padding: 0;
    margin: 0 0 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.rep-contact-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    color: var(--gray-800);
}
.rep-contact-list li i {
    color: var(--red);
    font-size: 0.95rem;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}
.rep-contact-list a {
    color: var(--navy);
    text-decoration: none;
    font-weight: 600;
}
.rep-contact-list a:hover { color: var(--red); }

.rep-states-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    color: var(--gray-400);
    margin-bottom: 8px;
}
.rep-states-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 24px;
}
.rep-states-badges span {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--navy);
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: 5px;
    padding: 3px 9px;
}
.rep-popup-actions {
    display: flex;
    gap: 12px;
}
.rep-popup-actions .btn {
    flex: 1;
    justify-content: center;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 960px) {
    .map-layout {
        grid-template-columns: 1fr;
    }
    .map-sidebar {
        flex-direction: row;
        flex-wrap: wrap;
    }
    .map-prompt, .map-legend { flex: 1 1 220px; }
}
@media (max-width: 600px) {
    .rep-hero h1 { font-size: 1.8rem; }
    .map-sidebar { flex-direction: column; }
    .rep-popup-actions { flex-direction: column; }
}
