/* =============================================================
   Finn Distributor Locator — Frontend Styles
   File: assets/css/frontend.css
   ============================================================= */

/* ── Section wrapper ─────────────────────────────────────────── */
#fad-section {
    max-width: 1100px;
    margin: 0 auto;
    padding: 10px 10px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    box-sizing: border-box;
}

/* ── Heading ─────────────────────────────────────────────────── */
.fad-title {
    text-align: center;
    font-size: 32px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 8px;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.fad-subtitle {
    text-align: center;
    color: #666;
    font-size: 15px;
    margin: 0 0 32px;
}

/* ── Search bar ──────────────────────────────────────────────── */
#fad-search-wrap {
    display: flex;
    gap: 10px;
    max-width: 560px;
    margin: 0 auto 28px;
}

#fad-input {
    flex: 1;
    padding: 13px 18px;
    border: 1.5px solid #d0d5dd;
    border-radius: 8px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s ease;
    color: #1a1a2e;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
}

#fad-input:focus {
    border-color: #C8102E;
    box-shadow: 0 0 0 3px rgba(200,16,46,.1);
}

#fad-btn {
    padding: 8px 26px;
    background: #188ED0;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
    white-space: nowrap;
    letter-spacing: 0.01em;
}

#fad-btn:hover {
    background: #188ED0;
}

#fad-btn:active {
    transform: scale(0.98);
}

/* ── Two-column layout ───────────────────────────────────────── */
#fad-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 16px;
    height: 480px;
}

/* ── Results list ────────────────────────────────────────────── */
#fad-list {
    overflow-y: auto;
    border: 1px solid #e4e7ec;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
}

#fad-list::-webkit-scrollbar {
    width: 4px;
}
#fad-list::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 4px;
}

/* ── Individual list item ────────────────────────────────────── */
.fad-item {
    padding: 14px 16px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.15s ease;
    border-left: 3px solid transparent;
}

.fad-item:last-child {
    border-bottom: none;
}

.fad-item:hover {
    background: #fff5f6;
}

.fad-item.active {
    background: #fff5f6;
    border-left-color: #C8102E;
}

.fad-num {
    display: inline-block;
    width: 22px;
    height: 22px;
    background: #188ED0;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    line-height: 22px;
    border-radius: 50%;
    margin-right: 6px;
    flex-shrink: 0;
}

.fad-company {
    font-weight: 600;
    font-size: 13px;
    color: #1a1a2e;
    margin-bottom: 3px;
    display: flex;
    align-items: center;
}

.fad-addr {
    font-size: 12px;
    color: #666;
    line-height: 1.5;
    padding-left: 28px;
}

.fad-dist {
    font-size: 11px;
    color: #C8102E;
    font-weight: 600;
    margin-top: 4px;
    padding-left: 28px;
}

/* ── Map container ───────────────────────────────────────────── */
#fad-map {
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e4e7ec;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
}

/* ── Status messages ─────────────────────────────────────────── */
.fad-status-msg {
    text-align: center;
    padding: 40px 20px;
    color: #aaa;
    font-size: 13px;
}

.fad-no-results {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 13px;
}

.fad-no-key {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: #f9f9f9;
    color: #888;
    font-size: 14px;
    text-align: center;
    padding: 24px;
    box-sizing: border-box;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media ( max-width: 768px ) {
    #fad-layout {
        grid-template-columns: 1fr;
        height: auto;
    }

    #fad-list {
        max-height: 280px;
    }

    #fad-map {
        height: 340px;
    }

    .fad-title {
        font-size: 24px;
    }

    #fad-search-wrap {
        flex-direction: column;
    }

    #fad-btn {
        width: 100%;
    }
}

/* ── Warning banner (geocoding API not enabled) ──────────────── */
.fad-warn {
    background: #fff8e1;
    border-left: 3px solid #f0b429;
    padding: 10px 14px;
    font-size: 12px;
    color: #7a5c00;
    margin-bottom: 4px;
}
