/* Simplicity Fibre Coverage Map – Public CSS */

:root {
    --sfcm-primary:   #123151;
    --sfcm-secondary: #4374ba;
    --sfcm-radius:    10px;
    --sfcm-shadow:    0 4px 24px rgba(18,49,81,.10);
}

/* ------------------------------------------------------------------ */
/*  Wrapper                                                             */
/* ------------------------------------------------------------------ */

.sfcm-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    border-radius: var(--sfcm-radius);
    overflow: hidden;
    box-shadow: var(--sfcm-shadow);
    border: 1px solid #e2e8f0;
    background: #fff;
}

/* ------------------------------------------------------------------ */
/*  Search bar                                                          */
/* ------------------------------------------------------------------ */

.sfcm-search-bar {
    background: var(--sfcm-primary);
    padding: 16px 20px;
}

.sfcm-search-inner {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
    position: relative;
}

.sfcm-search-icon {
    width: 18px;
    height: 18px;
    margin: 0 12px;
    color: #94a3b8;
    flex-shrink: 0;
}

#sfcm-address-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 13px 8px 13px 0;
    font-size: 15px;
    color: #1e293b;
    background: transparent;
    min-width: 0;
}

#sfcm-address-input::placeholder {
    color: #94a3b8;
}

#sfcm-check-btn {
    background: var(--sfcm-secondary);
    color: #fff;
    border: none;
    padding: 13px 22px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background .2s;
    letter-spacing: .02em;
}

#sfcm-check-btn:hover  { background: #3260a0; }
#sfcm-check-btn:active { background: var(--sfcm-primary); }
#sfcm-check-btn:disabled { opacity: .6; cursor: not-allowed; }

/* ------------------------------------------------------------------ */
/*  Map                                                                 */
/* ------------------------------------------------------------------ */

#sfcm-map {
    width: 100%;
    z-index: 0;
}

/* Custom pin marker */
.sfcm-pin { background: transparent; border: none; }
.sfcm-pin-dot {
    width: 22px;
    height: 22px;
    background: var(--sfcm-secondary);
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(67,116,186,.5);
    animation: sfcmPop .3s cubic-bezier(.34,1.56,.64,1);
}

@keyframes sfcmPop {
    from { transform: scale(0); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

/* ------------------------------------------------------------------ */
/*  Results panel                                                       */
/* ------------------------------------------------------------------ */

#sfcm-results {
    display: none;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    padding: 20px;
    animation: sfcmFadeIn .3s ease;
}

@keyframes sfcmFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.sfcm-results-inner { max-width: 960px; }

/* Address found strip */
.sfcm-address-found {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #64748b;
    margin-bottom: 14px;
}

.sfcm-address-found svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    color: var(--sfcm-secondary);
}

/* Result message */
.sfcm-result-msg {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 16px;
    padding: 12px 16px;
    border-radius: 8px;
}

.sfcm-result-msg svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 1px;
}

.sfcm-covered {
    background: #ecfdf5;
    color: #065f46;
}
.sfcm-covered svg { stroke: #10b981; }

.sfcm-not-covered {
    background: #fff7ed;
    color: #9a3412;
}
.sfcm-not-covered svg { stroke: #f97316; }

/* Provider grid */
.sfcm-provider-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
    margin-top: 4px;
}

/* Provider card */
.sfcm-provider-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-top: 4px solid var(--sfcm-primary);
    border-radius: 8px;
    padding: 18px 16px 16px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    transition: transform .15s, box-shadow .15s;
}

.sfcm-provider-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,.1);
}

.sfcm-provider-logo {
    max-height: 36px;
    max-width: 120px;
    object-fit: contain;
}

.sfcm-provider-initials {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    font-weight: 700;
}

.sfcm-provider-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--sfcm-primary);
    line-height: 1.2;
}

.sfcm-provider-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
}

.sfcm-provider-badge svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
}

.sfcm-order-btn {
    display: inline-flex;
    align-items: center;
    margin-top: 6px;
    padding: 9px 16px;
    background: var(--sfcm-secondary);
    color: #fff !important;
    text-decoration: none !important;
    font-size: 13px;
    font-weight: 700;
    border-radius: 6px;
    letter-spacing: .02em;
    transition: filter .2s, transform .15s;
    width: 100%;
    justify-content: center;
    box-sizing: border-box;
}

.sfcm-order-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

/* Loading state */
.sfcm-loading {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #64748b;
    font-size: 14px;
    padding: 8px 0;
}

.sfcm-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e2e8f0;
    border-top-color: var(--sfcm-secondary);
    border-radius: 50%;
    animation: sfcmSpin .7s linear infinite;
    flex-shrink: 0;
}

@keyframes sfcmSpin { to { transform: rotate(360deg); } }

/* Error state */
.sfcm-error {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #991b1b;
    font-size: 14px;
    background: #fef2f2;
    padding: 12px 16px;
    border-radius: 8px;
}

.sfcm-error svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    stroke: #ef4444;
}

/* Google Places autocomplete – reset theme/WP style interference */
.pac-container {
    z-index: 99999 !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 20px rgba(0,0,0,.15) !important;
    border: 1px solid #e2e8f0 !important;
    margin-top: 4px !important;
    overflow: hidden !important;
    background: #fff !important;
}
.pac-container * {
    box-sizing: border-box !important;
    list-style: none !important;
    list-style-type: none !important;
    margin: 0 !important;
}
.pac-item {
    padding: 8px 12px !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    cursor: pointer !important;
    border-top: 1px solid #f1f5f9 !important;
    display: flex !important;
    align-items: center !important;
    background: #fff !important;
    color: #334155 !important;
    width: 100% !important;
}
.pac-item:first-child { border-top: none !important; }
.pac-item:hover, .pac-item-selected { background: #f0f6fc !important; }
.pac-icon { display: none !important; }
.pac-item-query {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #1e293b !important;
    padding-right: 4px !important;
}
.pac-matched { color: #4374ba !important; }

/* ------------------------------------------------------------------ */
/*  Responsive                                                          */
/* ------------------------------------------------------------------ */

@media (max-width: 600px) {
    .sfcm-search-inner { flex-wrap: wrap; }
    #sfcm-check-btn { width: 100%; border-radius: 0 0 8px 8px; }
    .sfcm-provider-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 380px) {
    .sfcm-provider-grid { grid-template-columns: 1fr; }
}

/* API provider unknown notice */
.sfcm-api-notice {
    margin-top: 12px;
    padding: 10px 14px;
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    font-size: 13px;
    color: #92400e;
}

/* Speed pill on provider card */
.sfcm-speed-pill {
    display: inline-block;
    background: #f0f6fc;
    border: 1px solid #bfdbfe;
    color: #1e40af;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
    letter-spacing: .02em;
}

/* Debug panel */
.sfcm-debug-panel {
    margin-top: 0;
    border: 2px solid #f59e0b;
    border-top: none;
    max-height: 320px;
    overflow-y: auto;
    background: #fffbeb;
    border-radius: 0 0 var(--sfcm-radius) var(--sfcm-radius);
    font-size: 12px;
}

/* ------------------------------------------------------------------ */
/*  Provider section (MWEB-style inline packages)                      */
/* ------------------------------------------------------------------ */

.sfcm-provider-section {
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    margin-bottom: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

.sfcm-provider-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px 12px;
    border-bottom: 1px solid #f1f5f9;
}

.sfcm-provider-logo-lg {
    max-height: 44px;
    max-width: 140px;
    object-fit: contain;
    flex-shrink: 0;
}

.sfcm-provider-initials-lg {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    flex-shrink: 0;
}

.sfcm-provider-header-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sfcm-packages-wrap {
    padding: 16px 20px 20px;
}

/* Package grid */
.sfcm-pkg-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.sfcm-pkg-card {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #f8fafc;
    transition: border-color .15s, box-shadow .15s;
}

.sfcm-pkg-card:hover {
    border-color: #94a3b8;
    box-shadow: 0 4px 12px rgba(0,0,0,.08);
}

.sfcm-pkg-name {
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.3;
}

.sfcm-pkg-speeds {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.sfcm-speed-down,
.sfcm-speed-up {
    font-size: 12px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 20px;
}

.sfcm-speed-down {
    background: #dbeafe;
    color: #1d4ed8;
}

.sfcm-speed-up {
    background: #dcfce7;
    color: #15803d;
}

.sfcm-pkg-price {
    font-size: 22px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1;
    margin-top: 4px;
}

.sfcm-pkg-period {
    font-size: 13px;
    font-weight: 400;
    color: #64748b;
}

.sfcm-pkg-order {
    display: block;
    text-align: center;
    margin-top: auto;
    padding: 9px 12px;
    border-radius: 6px;
    color: #fff !important;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none !important;
    transition: filter .2s;
}

.sfcm-pkg-order:hover { filter: brightness(1.1); }

.sfcm-order-btn-full {
    display: block;
    text-align: center;
    padding: 12px 20px;
    border-radius: 8px;
    color: #fff !important;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none !important;
    transition: filter .2s;
}

.sfcm-order-btn-full:hover { filter: brightness(1.1); }

/* Remove old provider-grid styles when using new sections */
.sfcm-results-inner .sfcm-provider-grid { display: none; }

@media (max-width: 600px) {
    .sfcm-pkg-grid { grid-template-columns: 1fr 1fr; }
    .sfcm-provider-header { padding: 12px 14px 10px; }
    .sfcm-packages-wrap { padding: 12px 14px 16px; }
}

@media (max-width: 380px) {
    .sfcm-pkg-grid { grid-template-columns: 1fr; }
}
