/* ═══════════════════════════════════════════════════════════
   Spatial Shoes — Imports Club
   Diamond shoe cluster + floating glassmorphism filter bar
   Inspired by Perfect Pair — shoe-finder-wine.vercel.app
   ═══════════════════════════════════════════════════════════ */

/* ── Variables ─────────────────────────────────────────── */
.ic-sp {
    --sp-bg: #e8e4de;
    --sp-text: #111;
    --sp-text-muted: #888;
    --sp-pill-bg: rgba(0, 0, 0, 0.05);
    --sp-pill-active: #111;
    --sp-radius: 100px;
    --sp-transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Base ──────────────────────────────────────────────── */
.ic-sp {
    background: var(--sp-bg);
    height: calc(100vh - var(--sp-header-h, 120px));
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* ── Canvas (full viewport) ───────────────────────────── */
.ic-sp__canvas {
    flex: 1;
    position: relative;
    width: 100%;
    overflow: hidden;
}

/* ── Topographic background ──────────────────────────── */
.ic-sp__topo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    color: rgba(0, 0, 0, 0.07);
    pointer-events: none;
    overflow: visible;
}

/* ── Cluster container ────────────────────────────────── */
.ic-sp__cluster {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

/* ── Individual Shoe ──────────────────────────────────── */
.ic-sp__shoe {
    position: absolute;
    cursor: pointer;
    pointer-events: all;
    transform-origin: center center;
    opacity: 0;
    animation: icSpIn 0.5s cubic-bezier(0.34, 1.4, 0.64, 1) forwards;
    animation-delay: calc(var(--idx, 0) * 12ms);
    transition: opacity 0.35s ease, transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    /* Background matches page so mix-blend-mode: multiply makes white imgs transparent */
    background-color: var(--sp-bg);
    border-radius: 4px;
    text-decoration: none;
}

@keyframes icSpIn {
    from {
        opacity: 0;
        transform: scale(0.5) translateY(15px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.ic-sp__shoe-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    mix-blend-mode: multiply;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.10));
    transition: filter 0.25s ease, transform 0.25s ease;
    display: block;
    pointer-events: none;
}

/* Hover */
.ic-sp__shoe:hover {
    z-index: 100;
    transform: scale(1.4) translateY(-6px) !important;
    animation: none;
    opacity: 1 !important;
}

.ic-sp__shoe:hover .ic-sp__shoe-img {
    filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.22));
}

/* Dimmed (filtered out) */
.ic-sp__shoe--dim {
    opacity: 0.05 !important;
    pointer-events: none;
    animation: none;
    transform: scale(0.9);
}

/* ── Tooltip ──────────────────────────────────────────── */
.ic-sp__tooltip {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: #111;
    color: #fff;
    border-radius: 12px;
    padding: 11px 15px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
    display: flex;
    flex-direction: column;
    gap: 2px;
    z-index: 200;
    min-width: 140px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.ic-sp__shoe:hover .ic-sp__tooltip {
    opacity: 1;
}

.ic-sp__tooltip-brand {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
    display: block;
}

.ic-sp__tooltip-name {
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    display: block;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ic-sp__tooltip-price {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    display: block;
    margin-top: 2px;
}

.ic-sp__tooltip-cta {
    display: inline-block;
    margin-top: 6px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: rgba(255,255,255,0.55);
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 6px;
    text-align: center;
    width: 100%;
}

/* ── Floating Filter Bar (glassmorphism island) ───────── */
.ic-sp__filterbar {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 4px;
    background: linear-gradient(135deg,
        rgba(255, 245, 238, 0.55) 0%,
        rgba(255, 255, 255, 0.45) 50%,
        rgba(245, 238, 255, 0.55) 100%
    );
    backdrop-filter: blur(40px) saturate(200%);
    -webkit-backdrop-filter: blur(40px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 28px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06),
                inset 0 1px 0 rgba(255, 255, 255, 0.5);
    pointer-events: auto;
    max-width: calc(100vw - 32px);
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.ic-sp__filterbar::-webkit-scrollbar {
    display: none;
}

.ic-sp__filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 7px 14px;
    border-radius: 22px;
    background: transparent;
    border: none;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: #555;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    line-height: 1;
}

.ic-sp__filter-pill:hover {
    background: rgba(0, 0, 0, 0.06);
    color: #111;
}

.ic-sp__filter-pill--active {
    background: var(--sp-pill-active);
    color: #fff;
}

.ic-sp__filter-pill--active:hover {
    background: #333;
}

.ic-sp__filter-count {
    font-size: 11px;
    font-weight: 400;
    opacity: 0.55;
}

/* ── Count badge ──────────────────────────────────────── */
.ic-sp__count-badge {
    position: absolute;
    top: 12px;
    right: 20px;
    z-index: 20;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 100px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 500;
    color: var(--sp-text-muted);
    pointer-events: none;
}

/* ── Active hover ─────────────────────────────────────── */
.ic-sp__shoe:active {
    transform: scale(1.25) translateY(-4px) !important;
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 768px) {
    .ic-sp {
        --sp-header-h: 64px;
    }

    .ic-sp__filterbar {
        bottom: 16px;
        gap: 2px;
        padding: 4px;
    }

    .ic-sp__filter-pill {
        font-size: 11px;
        padding: 6px 12px;
    }

    .ic-sp__count-badge {
        top: 8px;
        right: 12px;
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .ic-sp__filterbar {
        bottom: 12px;
        border-radius: 22px;
    }

    .ic-sp__filter-pill {
        font-size: 10px;
        padding: 6px 10px;
    }
}
