/**
 * SwiftFlow — Address Autocomplete Dropdown
 */

/* ── Wrapper ──────────────────────────────────────────────────────────── */

.sfac-input-wrap {
    position: relative;
    display: block;
}

/* ── Dropdown — appended to body, position:fixed via JS ──────────────── */

.sfac-dropdown {
    position: fixed; /* JS sets top/left/width via getBoundingClientRect() */
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .12);
    z-index: 999999;
    max-height: 300px;
    overflow-y: auto;
    font-family: "Rubik", "Segoe UI", Tahoma, sans-serif;
}

/* ── Items ────────────────────────────────────────────────────────────── */

.sfac-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    cursor: pointer;
    font-size: 13.5px;
    color: #374151;
    transition: background .1s, color .1s;
    border-bottom: 1px solid #f1f5f9;
}

.sfac-item:last-of-type {
    border-bottom: none;
}

.sfac-item:hover,
.sfac-item--focused {
    background: #f0fdfa;
    color: var(--sfc-primary, #0d9488);
}

.sfac-item:hover .sfac-item-icon svg,
.sfac-item--focused .sfac-item-icon svg {
    stroke: var(--sfc-primary, #0d9488);
}

/* ── Icon ─────────────────────────────────────────────────────────────── */

.sfac-item-icon {
    flex-shrink: 0;
    color: #94a3b8;
    display: flex;
    align-items: center;
    transition: color .1s;
}

/* ── Main text ────────────────────────────────────────────────────────── */

.sfac-item-main {
    flex: 1;
    line-height: 1.4;
    direction: rtl;
    text-align: right;
    font-weight: 500;
}

/* ── Postcode badge ───────────────────────────────────────────────────── */

.sfac-item-zip {
    flex-shrink: 0;
    font-size: 11.5px;
    color: #64748b;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 2px 7px;
    font-family: monospace;
    letter-spacing: .5px;
}

/* ── Attribution (OSM — required) ────────────────────────────────────── */

.sfac-attribution {
    padding: 6px 14px;
    font-size: 11px;
    color: #94a3b8;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}

.sfac-attribution a {
    color: #64748b;
    text-decoration: none;
}

.sfac-attribution a:hover {
    text-decoration: underline;
}

/* ── Scrollbar ────────────────────────────────────────────────────────── */

.sfac-dropdown::-webkit-scrollbar {
    width: 5px;
}

.sfac-dropdown::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.sfac-dropdown::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

/* ── Admin guide styles ───────────────────────────────────────────────── */

.sfac-guide {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sfac-guide-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px 16px;
}

.sfac-guide-step-num {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--sfc-primary, #0d9488);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sfac-guide-step-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 13px;
    color: #374151;
    line-height: 1.5;
}

.sfac-guide-step-text strong {
    color: #0f172a;
    font-weight: 700;
}

.sfac-guide-step-text a {
    color: var(--sfc-primary, #0d9488);
    text-decoration: none;
}

.sfac-guide-step-text a:hover {
    text-decoration: underline;
}

.sfac-guide-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.5;
}

.sfac-guide-note--warn {
    background: #fffbeb;
    border: 1.5px solid #fde68a;
    color: #92400e;
}

.sfac-guide-note--info {
    background: #f0fdfa;
    border: 1.5px solid #99f6e4;
    color: #134e4a;
}

.sfac-guide-note svg {
    flex-shrink: 0;
    margin-top: 1px;
}
