/* ===== SP Drop-off Locator — Ported Feature Styles ===== */

/* ===== Custom Map Control: Use My Location (Feature 7) ===== */

.sp-dol-loc-btn {
    width: 40px;
    height: 40px;
    background: #fff;
    border: none;
    border-radius: 2px;
    box-shadow: 0 1px 4px -1px rgba(0, 0, 0, .3);
    cursor: pointer;
    padding: 0;
    margin: 0 0 0 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color .2s;
    border: 2px solid transparent;
}

.sp-dol-loc-btn:hover {
    box-shadow: 0 1px 6px -1px rgba(0, 0, 0, .35);
}

.sp-dol-loc-btn svg {
    width: 20px;
    height: 20px;
    stroke: #666;
    fill: none;
    stroke-width: 2;
}

.sp-dol-loc-btn.loading svg {
    animation: sp-dol-spin 1s linear infinite;
}

.sp-dol-loc-btn.error {
    border-color: #c8262b;
}

.sp-dol-loc-btn.error svg {
    stroke: #c8262b;
}

@keyframes sp-dol-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ===== Find Button Spinner ===== */

#codeAddress {
    position: relative;
}

#codeAddress .sp-dol-btn-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 14px;
    height: 14px;
    margin: -7px 0 0 -7px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    box-sizing: border-box;
    display: none;
}

#codeAddress:disabled .sp-dol-btn-text {
    opacity: 0;
}

#codeAddress:disabled .sp-dol-btn-spinner {
    display: inline-block;
    animation: sp-dol-spin .8s linear infinite;
}

/* ===== Error Banner (Feature 7) ===== */

.sp-dol-err-banner {
    position: absolute;
    left: 10px;
    right: 58px;
    bottom: 10px;
    background: #fff;
    border-left: 4px solid #c8262b;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
    border-radius: 4px;
    padding: 10px 30px 10px 12px;
    font-size: 12.5px;
    line-height: 1.4;
    z-index: 5;
}

.sp-dol-err-banner .sp-dol-err-close {
    position: absolute;
    right: 4px;
    top: 2px;
    width: 44px;
    height: 44px;
    border: none;
    background: none;
    font-size: 18px;
    color: #555;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== Share + Copy Address (Feature 9) ===== */

.sp-dol-links {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.sp-dol-lk {
    display: inline-block;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 3px;
    border: 1px solid hsl(var(--hue, 216), 50%, 55%);
    background: hsl(var(--hue, 216), 50%, 97%);
    color: hsl(var(--hue, 216), 50%, 30%);
    cursor: pointer;
    transition: background .15s;
}

.sp-dol-lk:hover {
    background: hsl(var(--hue, 216), 50%, 92%);
}

.sp-dol-lk.dark {
    background: hsl(var(--hue, 216), 50%, 45%);
    color: #fff;
    border-color: hsl(var(--hue, 216), 50%, 40%);
}

.sp-dol-lk.dark:hover {
    background: hsl(var(--hue, 216), 50%, 40%);
}

.sp-dol-lk.ok {
    background: #2e7d32;
    color: #fff;
    border-color: #2e7d32;
}

.sp-dol-lk-aria {
    font-size: 11px;
    color: #2e7d32;
    min-height: 14px;
}

/* ===== Nearest Highlight (OCCDOL-50) ===== */

#eventsList li.eventItem.nearest {
    position: relative;
    background: #eef6e9;
    border: 1px solid #a9cf95;
}

.sp-dol-tag {
    position: absolute;
    top: -9px;
    left: 12px;
    background: #3f7223;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 3px;
    letter-spacing: .03em;
    z-index: 1;
}

/* ===== Distance Pills (Feature 5) ===== */

#eventsList li.eventItem {
    position: relative;
}

#eventsList li.eventItem > .dist {
    position: absolute;
    top: -9px;
    right: 12px;
    z-index: 1;
}

.dist {
    display: inline-block;
    background: #fff;
    border: 1px solid #a9cf95;
    border-radius: 14px;
    color: #3f7223;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
    padding: 1px 8px;
    white-space: nowrap;
}

.dist.small {
    font-size: 11px;
    padding: 1px 7px;
    vertical-align: middle;
}

/* ===== Info Window Sticky Actions ===== */

.sp-dol-iw-actions {
    position: sticky;
    bottom: 0;
    background: #fff;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

/* ===== Copy Address Modal (Feature 9 fallback) ===== */

.sp-dol-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sp-dol-modal {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .3);
}

.sp-dol-modal-title {
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 600;
}

.sp-dol-modal-input {
    width: 100%;
    box-sizing: border-box;
    padding: 8px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    resize: none;
}

.sp-dol-modal-close {
    margin-top: 12px;
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid hsl(var(--hue, 216), 50%, 55%);
    background: hsl(var(--hue, 216), 50%, 97%);
    color: hsl(var(--hue, 216), 50%, 30%);
    border-radius: 3px;
    cursor: pointer;
}

.sp-dol-modal-close:hover {
    background: hsl(var(--hue, 216), 50%, 92%);
}
