/* ============================================================================
   CARTE DES BOUTIQUES TCG — /boutiques (public) et /boutiques-tcg (back-office)
   ----------------------------------------------------------------------------
   UN SEUL fichier pour les deux surfaces : tout est scope sous `.p151-shops`,
   la difference de contexte passe par `.p151-shops--public` / `--app`.

   ⛔ Couleurs P151 SOMBRES EXPLICITES uniquement. Aucune variable du theme Sash
   (`--custom-white`, `--default-body-bg-color`…) : le layout coreui est en
   `data-theme-mode="light"`, elles resolvent en clair et donneraient du texte
   illisible sur ce fond sombre (cf. .cursorrules-project151).
   ========================================================================== */

.p151-shops {
    --p151-shops-bg: #1c1c1c;
    --p151-shops-surface: #262626;
    --p151-shops-surface-2: #2e2e2e;
    --p151-shops-field: #303030;
    --p151-shops-border: #3a3a3a;
    --p151-shops-border-strong: #424242;
    --p151-shops-text: #e6e6f0;
    --p151-shops-text-soft: #b8b8c8;
    --p151-shops-muted: #9a9a9a;
    --p151-shops-violet: #a855f7;
    --p151-shops-rose: #f747f2;
    --p151-shops-map-height: 640px;

    background: var(--p151-shops-bg);
    border: 1px solid var(--p151-shops-border);
    border-radius: 14px;
    overflow: hidden;
    color: var(--p151-shops-text);
    font-size: 14px;
}

/* ── Barre d'outils ────────────────────────────────────────────────────── */
.p151-shops__toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--p151-shops-surface);
    border-bottom: 1px solid var(--p151-shops-border);
}

.p151-shops__search {
    position: relative;
    flex: 1 1 240px;
    min-width: 190px;
}

.p151-shops__search-icon {
    position: absolute;
    top: 50%;
    left: 11px;
    transform: translateY(-50%);
    color: var(--p151-shops-muted);
    display: flex;
    pointer-events: none;
}

.p151-shops__search-input {
    width: 100%;
    padding: 9px 12px 9px 33px;
    background: var(--p151-shops-field);
    border: 1px solid var(--p151-shops-border-strong);
    border-radius: 9px;
    color: var(--p151-shops-text);
    font-size: 13px;
    outline: none;
}

.p151-shops__search-input::placeholder { color: var(--p151-shops-muted); }
.p151-shops__search-input:focus { border-color: var(--p151-shops-violet); }

.p151-shops__types {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.p151-shops__chip,
.p151-shops__game {
    padding: 7px 13px;
    background: var(--p151-shops-field);
    border: 1px solid var(--p151-shops-border-strong);
    border-radius: 999px;
    color: var(--p151-shops-text-soft);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.p151-shops__chip:hover,
.p151-shops__game:hover { border-color: var(--p151-shops-violet); color: var(--p151-shops-text); }

.p151-shops__chip.is-active,
.p151-shops__game.is-active {
    background: linear-gradient(135deg, #f747f2 0%, #a855f7 100%);
    border-color: transparent;
    color: #ffffff;
}

.p151-shops__geo {
    padding: 8px 14px;
    background: linear-gradient(135deg, #f747f2 0%, #a855f7 100%);
    border: none;
    border-radius: 9px;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.p151-shops__geo:hover { opacity: .9; }

.p151-shops__games {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 10px 14px;
    background: var(--p151-shops-surface);
    border-bottom: 1px solid var(--p151-shops-border);
    scrollbar-width: thin;
}

/* ── Corps : carte + panneau ───────────────────────────────────────────── */
.p151-shops__body {
    position: relative;
    display: flex;
    height: var(--p151-shops-map-height);
}

.p151-shops__map {
    flex: 1 1 auto;
    height: 100%;
    background: #131313;
}

.p151-shops__status {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 500;
    max-width: 60%;
    padding: 7px 12px;
    background: rgba(28, 28, 28, .92);
    border: 1px solid var(--p151-shops-border-strong);
    border-radius: 8px;
    color: var(--p151-shops-text-soft);
    font-size: 12px;
}

.p151-shops__status.is-error { border-color: #b3341f; color: #ffb3a7; }
.p151-shops__status.is-hidden { display: none; }

.p151-shops__panel {
    display: flex;
    flex-direction: column;
    flex: 0 0 320px;
    width: 320px;
    background: var(--p151-shops-surface);
    border-left: 1px solid var(--p151-shops-border);
}

.p151-shops__panel-handle { display: none; }

.p151-shops__panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--p151-shops-border);
}

.p151-shops__panel-title { font-size: 14px; font-weight: 700; color: var(--p151-shops-text); }
.p151-shops__panel-sub { margin-top: 2px; font-size: 11px; color: var(--p151-shops-muted); }

.p151-shops__panel-add {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 6px 10px;
    background: var(--p151-shops-field);
    border: 1px solid var(--p151-shops-border-strong);
    border-radius: 8px;
    color: var(--p151-shops-text-soft);
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
}

.p151-shops__panel-add:hover { color: #ffffff; border-color: var(--p151-shops-violet); }

.p151-shops__cards {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 10px;
}

.p151-shops__card {
    position: relative;
    padding: 10px 12px 10px 14px;
    margin-bottom: 8px;
    background: var(--p151-shops-surface-2);
    border: 1px solid var(--p151-shops-border);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
}

.p151-shops__card:hover { border-color: var(--p151-shops-violet); }
.p151-shops__card.is-selected { border-color: var(--p151-shops-rose); background: #332433; }

.p151-shops__card::before {
    content: "";
    position: absolute;
    top: 10px;
    bottom: 10px;
    left: 5px;
    width: 3px;
    border-radius: 3px;
    background: var(--p151-shops-violet);
}

.p151-shops__card[data-type="both"]::before { background: var(--p151-shops-rose); }

.p151-shops__card-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

.p151-shops__card-name { font-size: 13px; font-weight: 700; color: var(--p151-shops-text); }
.p151-shops__card-city { font-size: 11px; color: var(--p151-shops-muted); white-space: nowrap; }
.p151-shops__card-address { margin-top: 3px; font-size: 11px; color: var(--p151-shops-text-soft); }

.p151-shops__tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }

.p151-shops__tag {
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 600;
    background: #3a2f4d;
    color: #d7c6ff;
}

.p151-shops__tag[data-game="pokemon"] { background: #4a3a12; color: #ffd76a; }
.p151-shops__tag[data-game="magic"] { background: #3a2f4d; color: #d7c6ff; }
.p151-shops__tag[data-game="yugioh"] { background: #4a2a17; color: #ffb98a; }
.p151-shops__tag[data-game="onepiece"] { background: #16354a; color: #8fd4ff; }
.p151-shops__tag[data-game="lorcana"] { background: #133a34; color: #7fe3cd; }
.p151-shops__tag[data-game="other"] { background: #333333; color: #c4c4c4; }

.p151-shops__empty {
    padding: 26px 14px;
    text-align: center;
    color: var(--p151-shops-muted);
    font-size: 12px;
}

.p151-shops__stats {
    display: flex;
    border-top: 1px solid var(--p151-shops-border);
}

.p151-shops__stat { flex: 1; padding: 10px 6px; text-align: center; }
.p151-shops__stat + .p151-shops__stat { border-left: 1px solid var(--p151-shops-border); }
.p151-shops__stat-value { display: block; font-size: 16px; font-weight: 700; color: var(--p151-shops-rose); }
.p151-shops__stat-label { display: block; font-size: 10px; color: var(--p151-shops-muted); text-transform: uppercase; letter-spacing: .4px; }

/* ── Bouton de bascule de la liste (mobile) ────────────────────────────── */
.p151-shops__sheet-toggle {
    display: none;
    position: absolute;
    right: 12px;
    bottom: 12px;
    z-index: 600;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #f747f2 0%, #a855f7 100%);
    border: none;
    border-radius: 999px;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .45);
    cursor: pointer;
}

.p151-shops__sheet-badge {
    padding: 1px 7px;
    background: rgba(0, 0, 0, .35);
    border-radius: 999px;
    font-size: 11px;
}

/* ── Habillage Leaflet ─────────────────────────────────────────────────── */
.p151-shops .leaflet-container { background: #131313; font-family: inherit; }
.p151-shops .leaflet-control-zoom a {
    background: var(--p151-shops-surface);
    border-color: var(--p151-shops-border-strong);
    color: var(--p151-shops-text);
}
.p151-shops .leaflet-control-zoom a:hover { background: var(--p151-shops-field); }
.p151-shops .leaflet-control-attribution {
    background: rgba(28, 28, 28, .8);
    color: var(--p151-shops-muted);
}
.p151-shops .leaflet-control-attribution a { color: var(--p151-shops-text-soft); }

.p151-shops .leaflet-popup-content-wrapper {
    background: var(--p151-shops-surface);
    border: 1px solid var(--p151-shops-border-strong);
    border-radius: 12px;
    color: var(--p151-shops-text);
    padding: 0;
    overflow: hidden;
}

.p151-shops .leaflet-popup-content { margin: 0; width: 262px !important; }
.p151-shops .leaflet-popup-tip { background: var(--p151-shops-surface); border: 1px solid var(--p151-shops-border-strong); }
.p151-shops .leaflet-popup-close-button { color: var(--p151-shops-muted) !important; top: 8px !important; right: 8px !important; }

.p151-shops__popup { padding: 14px 15px 12px; }
.p151-shops__popup-type {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    background: #3a2f4d;
    color: #d7c6ff;
}
.p151-shops__popup-type[data-type="both"] { background: #4a2545; color: #ffb6f6; }
.p151-shops__popup-name { margin-top: 8px; font-size: 15px; font-weight: 700; color: var(--p151-shops-text); }
.p151-shops__popup-address { margin-top: 4px; font-size: 12px; color: var(--p151-shops-text-soft); }
.p151-shops__popup-bonus {
    margin-top: 8px;
    padding: 7px 9px;
    background: var(--p151-shops-surface-2);
    border-left: 2px solid var(--p151-shops-violet);
    border-radius: 6px;
    font-size: 11px;
    color: var(--p151-shops-text-soft);
}
.p151-shops__popup-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.p151-shops__popup-link {
    flex: 1 1 auto;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    background: linear-gradient(135deg, #f747f2 0%, #a855f7 100%);
    color: #ffffff !important;
}
.p151-shops__popup-link.is-secondary {
    background: var(--p151-shops-field);
    border: 1px solid var(--p151-shops-border-strong);
    color: var(--p151-shops-text-soft) !important;
}

.p151-shops .p151-shops-pin { background: transparent !important; border: none !important; }

.p151-shops .marker-cluster {
    background: rgba(168, 85, 247, .22);
    border-radius: 50%;
}
.p151-shops .marker-cluster div {
    background: linear-gradient(135deg, #f747f2 0%, #a855f7 100%);
    color: #ffffff;
    font-weight: 700;
    font-size: 12px;
    border-radius: 50%;
}

/* ── Repere de position de l'utilisateur ───────────────────────────────── */
.p151-shops__me { color: var(--p151-shops-text); font-size: 12px; padding: 4px 2px; }

/* ── Responsive : le panneau devient une feuille glissante ─────────────── */
@media (max-width: 991.98px) {
    .p151-shops { --p151-shops-map-height: 72vh; }

    .p151-shops__sheet-toggle { display: inline-flex; }

    .p151-shops__panel {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 700;
        width: auto;
        max-height: 78%;
        border-left: none;
        border-top: 1px solid var(--p151-shops-border-strong);
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -8px 24px rgba(0, 0, 0, .5);
        transform: translateY(101%);
        transition: transform .25s ease;
    }

    .p151-shops__panel.is-open { transform: translateY(0); }

    .p151-shops__panel-handle {
        display: block;
        width: 46px;
        height: 4px;
        margin: 8px auto 2px;
        padding: 0;
        background: var(--p151-shops-border-strong);
        border: none;
        border-radius: 3px;
        cursor: pointer;
    }

    .p151-shops__cards { max-height: 46vh; }
}

@media (max-width: 575.98px) {
    .p151-shops__toolbar { padding: 10px; }
    .p151-shops__geo { width: 100%; }
    .p151-shops__types { width: 100%; }
    .p151-shops__chip { flex: 1 1 auto; }
}

/* ── Mode compact : carte seule (fiche boutique, page ville) ───────────── */
.p151-shops--compact { --p151-shops-map-height: 420px; }
.p151-shops--compact .p151-shops__body { height: var(--p151-shops-map-height); }

@media (max-width: 991.98px) {
    .p151-shops--compact { --p151-shops-map-height: 320px; }
}

/* ============================================================================
   PAGE PUBLIQUE /boutiques — habillage autour de la carte
   ----------------------------------------------------------------------------
   Volontairement dans CE fichier et pas dans assets_theme/custom.css : la page
   /boutiques est la seule a le charger, et une feature = un fichier CSS.
   ========================================================================== */
.p151-shops-section { padding: 40px 0 60px; }

.p151-shops-intro {
    max-width: 900px;
    margin: 0 auto 22px;
    color: #b8b8c8;
    font-size: 15px;
    line-height: 1.7;
    text-align: center;
}

.p151-shops-intro strong { color: #ffffff; }

.p151-shops-seo {
    max-width: 980px;
    margin: 48px auto 0;
    color: #b8b8c8;
    font-size: 14px;
    line-height: 1.75;
}

.p151-shops-seo h2 {
    margin: 34px 0 14px;
    color: #ffffff;
    font-size: 22px;
    font-weight: 700;
}

.p151-shops-seo a { color: #f747f2; text-decoration: none; }
.p151-shops-seo a:hover { text-decoration: underline; }

.p151-shops-seo-note { font-size: 13px; color: #9a9a9a; }

.p151-shops-city { margin-bottom: 20px; }

.p151-shops-city-name {
    margin-bottom: 6px;
    color: #e6e6f0;
    font-size: 16px;
    font-weight: 700;
}

.p151-shops-city-name span { color: #9a9a9a; font-size: 13px; font-weight: 500; }

.p151-shops-city-list { margin: 0; padding-left: 18px; }
.p151-shops-city-list li { margin-bottom: 5px; font-size: 13px; }
.p151-shops-city-list strong { color: #e6e6f0; }
.p151-shops-city-games { color: #9a9a9a; font-size: 12px; }

/* ── Fiche boutique /boutiques/{slug} ──────────────────────────────────── */
.p151-shop-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 22px;
    align-items: start;
    max-width: 1100px;
    margin: 0 auto;
    padding: 22px;
    background: #1c1c1c;
    border: 1px solid #3a3a3a;
    border-radius: 14px;
}

.p151-shop-type {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    background: #3a2f4d;
    color: #d7c6ff;
    font-size: 11px;
    font-weight: 700;
}

.p151-shop-type[data-type="both"] { background: #4a2545; color: #ffb6f6; }

.p151-shop-title {
    margin: 12px 0 14px;
    color: #ffffff;
    font-size: 22px;
    font-weight: 700;
}

.p151-shop-line { margin: 0 0 6px; color: #b8b8c8; font-size: 14px; }
.p151-shop-line strong { color: #e6e6f0; }
.p151-shop-line a { color: #f747f2; text-decoration: none; }
.p151-shop-line a:hover { text-decoration: underline; }

.p151-shop-bonus {
    margin: 12px 0;
    padding: 9px 12px;
    background: #262626;
    border-left: 3px solid #a855f7;
    border-radius: 8px;
    color: #b8b8c8;
    font-size: 13px;
}

.p151-shop-tags { display: flex; flex-wrap: wrap; gap: 5px; margin: 12px 0; }

.p151-shop-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

.p151-shop-btn {
    padding: 10px 16px;
    border-radius: 9px;
    background: linear-gradient(135deg, #f747f2 0%, #a855f7 100%);
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.p151-shop-btn:hover { opacity: .9; color: #ffffff; }

.p151-shop-btn.is-secondary {
    background: #303030;
    border: 1px solid #424242;
    color: #e6e6f0;
}

.p151-shop-map { min-width: 0; }

/* ── Liste de boutiques d'une ville ────────────────────────────────────── */
.p151-city-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
    margin: 18px 0 8px;
}

.p151-city-item {
    padding: 14px 16px;
    background: #262626;
    border: 1px solid #3a3a3a;
    border-radius: 12px;
}

.p151-city-item-name { margin: 0 0 6px; font-size: 15px; font-weight: 700; }
.p151-city-item-name a { color: #ffffff; text-decoration: none; }
.p151-city-item-name a:hover { color: #f747f2; }
.p151-city-item-address { margin: 0; color: #b8b8c8; font-size: 12px; }
.p151-city-item-links { margin: 8px 0 0; font-size: 12px; color: #9a9a9a; }

/* ── Grille des villes (/villes et hub de /boutiques) ──────────────────── */
.p151-cities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
    margin: 18px 0;
}

.p151-cities-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 12px;
    background: #262626;
    border: 1px solid #3a3a3a;
    border-radius: 9px;
    color: #e6e6f0 !important;
    font-size: 13px;
    text-decoration: none;
}

.p151-cities-link:hover { border-color: #a855f7; color: #ffffff !important; }
.p151-cities-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.p151-cities-count {
    flex: 0 0 auto;
    padding: 1px 8px;
    background: #3a2f4d;
    border-radius: 999px;
    color: #d7c6ff;
    font-size: 11px;
    font-weight: 700;
}

@media (max-width: 767.98px) {
    .p151-shops-section { padding: 24px 0 40px; }
    .p151-shops-intro { text-align: left; font-size: 14px; }
    .p151-shop-card { grid-template-columns: minmax(0, 1fr); padding: 16px; }
}
