/* ── plugin chrome ─────────────────────────────────────────────────── */
.ap-dropdown {
    position: fixed;
    z-index: 9999;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 6px 12px rgba(0,0,0,.175);
    max-height: 420px;
    flex-direction: column;
    display: none;
}
.ap-dropdown.ap-open { display: flex; }

.ap-crumb { padding: 8px 14px; border-bottom: 1px solid #f0f0f0; font-size: 13px; flex: 0 0 auto; }
.ap-crumb a { cursor: pointer; color: #337ab7; }

.ap-locate  { padding: 8px 14px; flex: 0 0 auto; }
.ap-locate a { cursor: pointer; }

.ap-results {
    flex: 1 1 auto; overflow-y: auto; min-height: 0; margin: 0;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}
.ap-section-label { padding: 10px 14px 4px; font-size: 12px; color: #999; list-style: none; }

.ap-results .list-group { margin: 0; }
.ap-results .list-group-item {
    padding: 12px 14px; border-left: 0; border-right: 0;
    border-radius: 0 !important; cursor: pointer;
}
.ap-results .list-group-item:first-child { border-top: 0; }
.ap-results .list-group-item.ap-focused  { background: #f0f6ff; outline: none; }

.ap-item-sub  { color: #888; font-size: 12px; margin: 2px 0 0; }
.ap-item-city { color: #337ab7; font-size: 12px; margin: 3px 0 0; }

/* city row */
.ap-city-main   { display: flex; align-items: center; gap: 8px; }
.ap-city-info   { flex: 1; min-width: 0; }
.ap-city-arrow  { color: #bbb; flex-shrink: 0; }

/* street row */
.ap-street-main  { display: flex; align-items: center; gap: 8px; }
.ap-street-info  { flex: 1; min-width: 0; }
.ap-street-arrow { color: #bbb; flex-shrink: 0; }

/* building form — shown at the third level instead of a list */
.ap-building-form {
    padding: 16px 14px;
    cursor: default;
}
.ap-building-form .form-group { margin-bottom: 12px; }
.ap-building-form .form-group:last-of-type { margin-bottom: 16px; }
.ap-building-form .control-label { font-weight: 600; font-size: 13px; margin-bottom: 4px; }

.ap-input-error {
    border-color: #d9534f !important;
    box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 6px rgba(217,83,79,.3) !important;
}

.ap-hidden { display: none !important; }

/* ── trigger / display mode ──────────────────────────────────────── */
.ap-trigger {
    display: flex;
    align-items: stretch;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
}
.ap-trigger-addon {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    background: #eee;
    border-right: 1px solid #ccc;
    border-radius: 3px 0 0 3px;
    color: #555;
    white-space: nowrap;
}
.ap-trigger .ap-display {
    flex: 1;
    min-width: 0;
    padding: 6px 12px;
    min-height: 34px;
    line-height: 1.5;
    white-space: normal;
    word-break: break-word;
    cursor: pointer;
    display: flex;
    align-items: center;
}
.ap-trigger .ap-clear-btn {
    display: flex;
    align-items: center;
    padding: 0 10px;
    background: none;
    border: none;
    border-left: 1px solid #ccc;
    border-radius: 0 3px 3px 0;
    color: #888;
    cursor: pointer;
    flex-shrink: 0;
}
.ap-trigger .ap-clear-btn:hover { background: #f5f5f5; color: #555; }
.ap-display--empty { color: #999; }

/* crumb decorators */
.ap-crumb-sep   { color: #ddd; }
.ap-crumb-arrow { font-size: 10px; color: #bbb; }

/* ── modal mode ──────────────────────────────────────────────────── */
.ap-modal-open { overflow: hidden; }

.ap-modal {
    display: none;
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    z-index: 1050;
    overflow-x: hidden;
    overflow-y: auto;
    outline: 0;
    opacity: 0;
    transition: opacity .2s linear;
    will-change: opacity;
}
.ap-modal.in { display: block; opacity: 1; }

.ap-modal-backdrop {
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    z-index: 1040;
    background: rgba(0,0,0,.5);
    opacity: 0;
    transition: opacity .2s linear;
    will-change: opacity;
}
.ap-modal-backdrop.in { opacity: 1; }

.ap-modal-dialog {
    position: relative;
    margin: 30px auto;
    max-width: 500px;
    width: auto;
}
@media (min-width: 576px) {
    .ap-modal-dialog { width: 500px; }
}

.ap-modal-content {
    position: relative;
    background: #fff;
    border: 1px solid rgba(0,0,0,.2);
    border-radius: 6px;
    box-shadow: 0 5px 15px rgba(0,0,0,.5);
    outline: 0;
}

.ap-modal-header {
    padding: 14px 16px;
    border-bottom: 1px solid #e5e5e5;
    display: flex;
    align-items: center;
}
.ap-modal-title {
    flex: 1;
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
}
.ap-modal-close {
    background: none;
    border: none;
    padding: 0;
    margin-left: 12px;
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
    color: #000;
    opacity: .3;
    cursor: pointer;
    flex-shrink: 0;
}
.ap-modal-close:hover { opacity: .6; }

.ap-modal-body { padding: 14px; }

/* ── shared utilities ────────────────────────────────────────────── */
.ap-match { background: rgba(255,193,7,.3); border-radius: 2px; padding: 0 1px; }

.ap-disabled { opacity: 0.65; }
.ap-disabled .ap-display,
.ap-disabled .ap-clear-btn { pointer-events: none; cursor: default; }

.ap-load-more { text-align: center; }
.ap-load-more button { background: none; border: none; padding: 0; font: inherit; cursor: pointer; color: #337ab7; }
.ap-load-more button:hover { text-decoration: underline; }
.ap-load-more button:focus-visible { outline: 2px solid #337ab7; outline-offset: 2px; border-radius: 2px; }

/* ── 3axid-theme search field ──────────────────────────────────────────
   Same recipe as pickup-point.css: join the BS3 addon + input [+ clear
   btn] into one rounded control (the group owns the border/radius/focus
   ring, the parts go borderless) instead of the disjoint pieces the
   landing skin makes of them. The .ap-search-group class is doubled in
   every selector because this file loads BEFORE cabinet.css
   (sm_add_cssfile order), so an equal-specificity tie would lose. */
.ap-search-group.ap-search-group {
    display: flex;
    align-items: stretch;
    flex-wrap: nowrap;
    width: 100%;
    background: #fff;
    border: 1px solid var(--border--input, #c9d0dc);
    border-radius: 12px;
    overflow: hidden;
    transition: border-color .55s;
}
.ap-search-group.ap-search-group:focus-within {
    border-color: var(--hover--blue, #0050bd);
}
.ap-search-group.ap-search-group .input-group-addon {
    display: flex;
    align-items: center;
    padding: 0 2px 0 14px;
    background: transparent;
    border: none;
    border-radius: 0;
    color: #8b96a5;
}
.ap-search-group.ap-search-group .form-control {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    padding-left: 10px;
}
.ap-search-group.ap-search-group .form-control:focus {
    outline: none;
    box-shadow: none;
}
.ap-search-group.ap-search-group .input-group-btn {
    display: flex;
    align-items: stretch;
}
.ap-search-group.ap-search-group .ap-clear-btn {
    display: flex;
    align-items: center;
    padding: 0 12px;
    background: transparent;
    border: none;
    border-radius: 0;
    color: #8b96a5;
    cursor: pointer;
}
.ap-search-group.ap-search-group .ap-clear-btn:hover {
    background: transparent;
    color: #43464d;
}

/* ── Mobile / WebView enhancements ──────────────────────────────── */

/* Remove 300ms tap delay and gray tap flash */
.ap-city, .ap-street, .ap-locate-btn, .ap-clear-btn,
.ap-display, .ap-back-cities, .ap-crumb-city,
.ap-back-streets, .ap-crumb-street,
.ap-load-more button, .ap-confirm-btn {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
.ap-results .list-group-item {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* Prevent iOS auto-zoom on inputs (font-size must be >= 16px) */
.ap-modal-body .form-control,
.ap-dropdown .form-control {
    font-size: 16px;
}

/* Full-screen modal on narrow screens + iPhone safe-area support */
@media (max-width: 575px) {
    .ap-modal-dialog {
        margin: 0;
        height: 100%;
        max-width: 100%;
        width: 100%;
    }
    .ap-modal-content {
        height: 100%;
        border-radius: 0;
        border-left: 0;
        border-right: 0;
        border-bottom: 0;
        display: flex;
        flex-direction: column;
    }
    .ap-modal-header {
        padding-left:  calc(16px + env(safe-area-inset-left));
        padding-right: calc(16px + env(safe-area-inset-right));
        flex-shrink: 0;
    }
    .ap-modal-body {
        flex: 1 1 auto;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        padding-bottom: calc(14px + env(safe-area-inset-bottom));
    }
}
