/* ─── Forces Custom Search v1.0 ──────────────────────────────────────────── */

:root {
    --fcs-navy:      #1a2c4e;
    --fcs-navy-dk:   #101d36;
    --fcs-navy-lt:   #e8edf6;
    --fcs-red:       #c8102e;
    --fcs-green:     #10b981;
    --fcs-orange:    #EE7311;
    --fcs-text:      #111827;
    --fcs-muted:     #6b7280;
    --fcs-border:    #e5e7eb;
    --fcs-radius:    10px;
    --fcs-shadow:    0 8px 30px rgba(0,0,0,0.14);
}

/* ─── Wrapper ─── */

.fcs-search-wrap { width: 100%; font-family: inherit; }

.fcs-search-bar-wrap {
    position: relative;
    max-width: 680px;
    margin: 0 auto;
}

/* ─── Input bar ─── */

.fcs-search-form { margin: 0; }

.fcs-search-input-wrap {
    display: flex;
    align-items: center;
    background: #fff;
    border: 2px solid var(--fcs-navy);
    border-radius: 50px;
    box-shadow: 0 2px 12px rgba(26,44,78,0.18);
    transition: box-shadow .2s, border-color .2s;
    overflow: hidden;
}

.fcs-search-input-wrap:focus-within {
    box-shadow: 0 2px 20px rgba(26,44,78,0.32);
    border-color: var(--fcs-navy-dk);
}

.fcs-search-icon {
    width: 19px; height: 19px;
    margin: 0 8px 0 18px;
    color: var(--fcs-navy);
    flex-shrink: 0;
}

.fcs-search-input {
    flex: 1;
    border: none; outline: none;
    padding: 13px 6px;
    font-size: 15px;
    color: var(--fcs-text);
    background: transparent;
    min-width: 0;
}

.fcs-search-input::placeholder { color: #94a3b8; }

.fcs-search-clear {
    background: none; border: none;
    color: #94a3b8; font-size: 19px;
    padding: 0 6px; cursor: pointer; flex-shrink: 0;
    line-height: 1;
}
.fcs-search-clear:hover { color: var(--fcs-text); }

.fcs-search-btn {
    background: var(--fcs-navy);
    color: #fff; border: none;
    padding: 0 22px;
    min-height: 48px;
    font-size: 14px; font-weight: 700;
    cursor: pointer;
    border-radius: 0 50px 50px 0;
    transition: background .2s;
    white-space: nowrap; flex-shrink: 0;
}
.fcs-search-btn:hover { background: var(--fcs-navy-dk); }

/* ─── Dropdown ─── */

.fcs-search-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0; right: 0;
    background: #fff;
    border: 1px solid var(--fcs-border);
    border-radius: var(--fcs-radius);
    box-shadow: var(--fcs-shadow);
    z-index: 99999;
    max-height: 480px;
    overflow-y: auto;
    animation: fcs-dd-in .13s ease;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e0 transparent;
}

@keyframes fcs-dd-in {
    from { opacity: 0; transform: translateY(-5px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ─── Rows ─── */

.fcs-dd-row {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 10px 14px;
    text-decoration: none !important;
    color: var(--fcs-text) !important;
    border-bottom: 1px solid #f1f5f9;
    transition: background .1s;
}

.fcs-dd-row:last-child { border-bottom: none; }
.fcs-dd-row:hover { background: var(--fcs-navy-lt); }

/* Brand row — slightly highlighted */
.fcs-dd-brand {
    background: #f8fafd;
    border-bottom: 2px solid var(--fcs-border) !important;
}
.fcs-dd-brand:hover { background: var(--fcs-navy-lt); }

/* ─── Logo ─── */

.fcs-dd-logo-wrap {
    width: 42px; height: 42px;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: #f4f6f9;
    border-radius: 8px;
    border: 1px solid var(--fcs-border);
    overflow: hidden;
    margin-top: 2px;
}

.fcs-dd-logo {
    max-width: 100%; max-height: 100%;
    object-fit: contain; display: block;
}

.fcs-dd-initial {
    font-size: 17px; font-weight: 800;
    color: var(--fcs-navy);
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    background: var(--fcs-navy-lt);
}

/* ─── Text body ─── */

.fcs-dd-body {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column; gap: 3px;
}

.fcs-dd-title {
    font-size: 13px; font-weight: 600;
    color: var(--fcs-text);
    white-space: normal;
    word-break: break-word;
    display: block;
    line-height: 1.4;
}

.fcs-dd-brand .fcs-dd-title { font-size: 14px; }

.fcs-dd-sub {
    display: flex; align-items: center; gap: 5px; flex-wrap: wrap;
    font-size: 11px; color: var(--fcs-muted);
}

/* ─── Badges ─── */

.fcs-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 20px;
    font-size: 10px; font-weight: 800;
    letter-spacing: .04em;
    flex-shrink: 0;
}

.fcs-badge-code  { background: #fef9c3; color: #854d0e; border: 1px solid #fcd34d; }
.fcs-badge-deal  { background: #dcfce7; color: #166534; border: 1px solid #86efac; }

/* ─── Code copy button ─── */

.fcs-copy-btn {
    background: var(--fcs-navy-lt);
    color: var(--fcs-navy-dk);
    border: 1px solid #c3d0e8;
    border-radius: 4px;
    padding: 1px 7px;
    font-size: 11px; font-weight: 700;
    cursor: pointer;
    font-family: monospace;
    letter-spacing: .04em;
    transition: background .15s, color .15s;
}
.fcs-copy-btn:hover,
.fcs-copy-btn.copied { background: var(--fcs-green); color: #fff; border-color: var(--fcs-green); }

/* ─── Expiry ─── */

.fcs-expiry { font-size: 11px; color: var(--fcs-muted); }

/* ─── Placeholder logo ─── */

.fcs-dd-placeholder {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    background: #f1f5f9;
}
.fcs-dd-placeholder svg {
    width: 20px; height: 20px;
    color: #94a3b8;
}

/* ─── Direct affiliate offer ─── */

.fcs-dd-offer-direct {
    border-left: 3px solid var(--fcs-orange);
}

/* ─── CTA label ─── */

.fcs-dd-cta-label {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 11px;
    font-weight: 700;
    color: var(--fcs-navy);
    white-space: nowrap;
    flex-shrink: 0;
    opacity: .7;
    transition: opacity .15s;
}
.fcs-dd-cta-label svg { width: 13px; height: 13px; }
.fcs-dd-row:hover .fcs-dd-cta-label { opacity: 1; }

/* ─── Arrow ─── */

.fcs-dd-arrow {
    flex-shrink: 0;
    color: var(--fcs-navy);
    opacity: .5;
    transition: opacity .15s, transform .15s;
}
.fcs-dd-arrow svg { width: 14px; height: 14px; display: block; }
.fcs-dd-row:hover .fcs-dd-arrow { opacity: 1; transform: translateX(2px); }

/* ─── Loading / empty ─── */

.fcs-dd-state {
    padding: 16px 18px;
    font-size: 13px;
    color: var(--fcs-muted);
    display: flex; align-items: center; gap: 10px;
}

.fcs-dd-empty { color: #64748b; }
.fcs-dd-empty strong { color: var(--fcs-text); }

/* ─── Skeleton loading (ghost cards + shimmer) ─── */

.fcs-skel-wrap { padding: 2px 0; }

.fcs-skel-row {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 12px 14px;
    border-bottom: 1px solid #f1f5f9;
}
.fcs-skel-row:last-child { border-bottom: none; }

.fcs-skel-logo {
    width: 42px; height: 42px;
    border-radius: 8px;
    flex-shrink: 0;
}

.fcs-skel-body {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column; gap: 8px;
}

.fcs-skel-line { height: 10px; border-radius: 5px; }
.fcs-skel-title { width: 72%; }
.fcs-skel-sub   { width: 42%; height: 8px; }

.fcs-skel-cta {
    width: 64px; height: 14px;
    border-radius: 5px;
    flex-shrink: 0;
}

.fcs-skel-logo,
.fcs-skel-line,
.fcs-skel-cta {
    background: linear-gradient(90deg, #eef1f5 25%, #e2e8f0 37%, #eef1f5 63%);
    background-size: 400% 100%;
    animation: fcs-shimmer 1.4s ease infinite;
}

@keyframes fcs-shimmer {
    0%   { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

.fcs-loading-msg {
    text-align: center;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--fcs-navy);
    padding: 12px 14px 10px;
    border-bottom: 1px solid #f1f5f9;
}

@media (prefers-reduced-motion: reduce) {
    .fcs-skel-logo, .fcs-skel-line, .fcs-skel-cta { animation: none; }
    .fcs-float-btn { animation: none; }
}

/* ════════════════════════════════════════════════════════════════════════════
   MOBILE STICKY SEARCH BAR — sits under the header, sticks to top on scroll
   ════════════════════════════════════════════════════════════════════════════ */

#fcs-mobile-sticky {
    display: none; /* hidden on desktop — JS moves it into place */
}

@media (max-width: 768px) {

    #fcs-mobile-sticky {
        display: block;
        position: sticky;
        top: 0;
        z-index: 99990;
        background: var(--fcs-navy);
        padding: 8px 12px 10px;
        box-shadow: 0 3px 12px rgba(0,0,0,0.22);
        transition: box-shadow .2s;
    }

    #fcs-mobile-sticky .fcs-mobile-sticky-inner {
        max-width: 100%;
        margin: 0;
    }

    #fcs-mobile-sticky .fcs-search-input-wrap {
        border-color: rgba(255,255,255,0.5);
        box-shadow: none;
    }
    #fcs-mobile-sticky .fcs-search-input-wrap:focus-within {
        border-color: #fff;
        box-shadow: 0 0 0 3px rgba(255,255,255,0.25);
    }

    #fcs-mobile-sticky .fcs-search-icon {
        color: var(--fcs-navy);
        margin-left: 14px;
    }

    #fcs-mobile-sticky .fcs-search-input {
        font-size: 14px;
        padding: 10px 4px;
        color: var(--fcs-text);
    }

    #fcs-mobile-sticky .fcs-search-btn {
        min-height: 42px;
        padding: 0 16px;
        font-size: 13px;
        background: var(--fcs-navy-dk);
        border-radius: 0 50px 50px 0;
    }
    #fcs-mobile-sticky .fcs-search-btn:hover {
        background: #0a1425;
    }

    #fcs-mobile-sticky .fcs-search-dropdown {
        left: -12px;
        right: -12px;
        border-radius: 0 0 var(--fcs-radius) var(--fcs-radius);
        max-height: 60vh;
        border-top: none;
    }

    /* ── Standard mobile tweaks for main search ── */
    .fcs-search-input { font-size: 14px; padding: 11px 4px; }
    .fcs-search-icon  { margin: 0 6px 0 12px; width: 17px; height: 17px; }
    .fcs-search-btn   { padding: 0 14px; font-size: 13px; min-height: 44px; }
    .fcs-search-dropdown { max-height: 380px; }
    .fcs-dd-row { padding: 9px 12px; gap: 9px; }
    .fcs-dd-logo-wrap { width: 36px; height: 36px; }
    .fcs-dd-title { font-size: 12px; }

    /* Floating button + overlay are desktop-only */
    .fcs-float-btn, .fcs-overlay { display: none !important; }
}

/* ════════════════════════════════════════════════════════════════════════════
   DESKTOP FLOATING SEARCH BUTTON
   ════════════════════════════════════════════════════════════════════════════ */

.fcs-float-btn {
    position: fixed;
    right: 26px;
    bottom: 30px;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: var(--fcs-navy);
    color: #fff;
    border: none;
    cursor: pointer;
    z-index: 99980;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 22px rgba(16,29,54,0.45);
    transition: transform .18s ease, background .18s, box-shadow .18s;
    animation: fcs-float-pulse 3.2s ease-in-out infinite;
}

.fcs-float-btn svg {
    width: 24px;
    height: 24px;
}

.fcs-float-btn:hover {
    background: var(--fcs-red);
    transform: scale(1.1);
    box-shadow: 0 8px 28px rgba(200,16,46,0.45);
    animation: none;
}

@keyframes fcs-float-pulse {
    0%, 100% { box-shadow: 0 6px 22px rgba(16,29,54,0.45); }
    50%      { box-shadow: 0 6px 22px rgba(16,29,54,0.45), 0 0 0 10px rgba(26,44,78,0.10); }
}

/* ════════════════════════════════════════════════════════════════════════════
   DESKTOP SEARCH OVERLAY
   ════════════════════════════════════════════════════════════════════════════ */

.fcs-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10,17,32,0.72);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 99995;
}

body.fcs-overlay-open { overflow: hidden; }

.fcs-overlay-panel {
    max-width: 680px;
    margin: 12vh auto 0;
    padding: 0 16px;
}

.fcs-overlay-panel .fcs-search-input-wrap {
    border-color: #fff;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.fcs-overlay-close {
    position: absolute;
    top: 22px;
    right: 30px;
    background: none;
    border: none;
    color: rgba(255,255,255,0.75);
    font-size: 44px;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
    transition: color .15s, transform .15s;
}
.fcs-overlay-close:hover {
    color: #fff;
    transform: scale(1.1);
}
