@import url('https://fonts.cdnfonts.com/css/pricedown');

/* --- BOUTIQUE ECOSYSTEM HUB (V2) --- */
.shop-controls-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin: -20px auto 40px;
    position: relative;
    z-index: 10;
    background: #fff;
    padding: 15px 25px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
    border: 1px solid #f0f4f8;
}

.shop-filter-tabs {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.shop-search-sort {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.search-box, .sort-box {
    display: flex;
    align-items: center;
    background: #f4f8ff;
    border-radius: 50px;
    padding: 10px 20px;
    border: 1px solid #eaf0f8;
    color: #0161bb;
    transition: all 0.3s ease;
}

.search-box:focus-within, .sort-box:hover {
    border-color: #0161bb;
    box-shadow: 0 4px 15px rgba(1, 97, 187, 0.1);
}

.search-box .material-symbols-outlined,
.sort-box .material-symbols-outlined {
    font-size: 20px;
    margin-right: 8px;
}

.search-box input {
    border: none;
    background: transparent;
    font-family: 'Sora', sans-serif;
    font-size: 0.9rem;
    color: #1a1a1a;
    outline: none;
    width: 180px;
}

.search-box input::placeholder {
    color: #888;
}

.sort-box select {
    border: none;
    background: transparent;
    font-family: 'Sora', sans-serif;
    font-size: 0.9rem;
    color: #1a1a1a;
    font-weight: 700;
    outline: none;
    cursor: pointer;
}

.filter-tab {
    padding: 12px 28px;
    background: #fff;
    border: 1px solid #eceff3;
    border-radius: 50px;
    font-family: 'Sora', sans-serif;
    font-weight: 800;
    font-size: 0.85rem;
    text-transform: uppercase;
    color: #666;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

.filter-tab:hover {
    color: #1a1a1a;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.06);
}

.filter-tab.active {
    background: #0161bb;
    color: #fff;
    border-color: #0161bb;
    box-shadow: 0 10px 25px rgba(1, 97, 187, 0.3);
}

.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin: 40px 0 60px;
}

/* CARDE COMMUNE */
.shop-card {
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #f0f4f8;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    -webkit-user-drag: none;
    user-select: text;
}

.shop-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.06);
}

/* MÉDIA CARDE */
.shop-card-media {
    position: relative;
    height: 220px;
    overflow: hidden;
    background: #fcfcfc;
}

.shop-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: none;
    -webkit-user-drag: none;
}

.shop-card:hover .shop-card-media img {
    transform: none;
}

/* BADGES DYNAMIQUE - Version Haut Contraste */
.shop-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 8px 16px;
    border-radius: 50px;
    font-family: 'Sora', sans-serif;
    font-weight: 800;
    font-size: 0.75rem;
    text-transform: uppercase;
    z-index: 5;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.badge-stock { background: #4caf50; color: #ffffff; border: 1px solid #388e3c; }
.badge-condition { background: #0161bb; color: #ffffff; border: 1px solid #004d99; }
.badge-service { background: #ffb600; color: #333; border: 1px solid #f5a400; }

/* CONTENU CARDE */
.shop-card-body {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.shop-card-body h3 {
    margin: 0 0 10px 0;
    font-family: 'Sora', sans-serif;
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.3;
}

.shop-card-body .item-code {
    font-size: 0.7rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px; /* Rapprochement avec le h3 */
}

.shop-card-body .description {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
}

.shop-card-footer {
    padding: 0 20px 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.shop-card-actions {
    display: flex;
    align-items: center;
    gap: 12px; /* Ecart fixe et homogène entre QTY et ACTION */
}

.price-tag {
    font-family: 'Sora', sans-serif;
    font-size: 1.4rem;
    font-weight: 800;
    color: #1a1a1a;
}

.price-tag span {
    font-size: 0.9rem;
    color: #999;
    margin-left: 2px;
}

.btn-shop-action {
    padding: 12px 20px;
    background: #1a1a1a;
    color: #fff;
    border-radius: 12px;
    text-decoration: none;
    font-family: 'Sora', sans-serif;
    font-weight: 800;
    font-size: 0.75rem;
    text-transform: uppercase;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-shop-action .material-symbols-outlined {
    font-size: 1.1rem;
}

.btn-shop-action:hover {
    background: #0161bb;
    transform: scale(1.05);
}

/* VARIANTE SERVICE (NEON BLUE AVEC BOUTON FALLOUT 76) */
.shop-card.type-service {
    background: linear-gradient(135deg, #0161bb 0%, #004282 100%);
    border: none;
    color: #fff;
}

.shop-card.type-service .shop-card-body {
    padding-top: 60px; /* Espace pour laisser passer le badge absolu */
}

.type-service .shop-card-body h3, 
.type-service .shop-card-body .description,
.type-service .price-tag {
    color: #fff;
}

.type-service .shop-card-body .item-code { color: rgba(255, 255, 255, 0.5); }

/* LE BOUTON D'ACTION SERVICE IMMEDIAT */
.type-service .btn-shop-action { 
    background: #fff; 
    color: #0161bb; 
    border: none;
    box-shadow: none;
    text-shadow: none;
}

.type-service .btn-shop-action:hover { 
    background: #fcd12a !important; 
    color: #1a1a1a !important; 
}


@media (max-width: 768px) {
    .shop-filter-tabs {
        flex-wrap: wrap;
        margin-top: -10px;
    }
    .shop-grid {
        grid-template-columns: 1fr;
    }
}

/* --- ETAT VERROUILLE (IS-LOCKED) --- */
.shop-card.is-locked {
    pointer-events: auto; /* On laisse passer les clics pour les feedbacks/boutons */
    cursor: default;
}

/* On bloque par contre le clic sur l'enveloppe parente de la carte pour ne pas recharger/naviguer */
.shop-card.is-locked .shop-card-body,
.shop-card.is-locked .shop-card-media {
    pointer-events: none;
}

.shop-card.is-locked .shop-card-body,
.shop-card.is-locked .price-tag,
.shop-card.is-locked .shop-card-media,
.shop-card.is-locked .shop-badge {
    filter: grayscale(100%) blur(1.5px);
    opacity: 0.6;
    transition: all 0.4s ease;
}

/* On s'assure que le bouton reste parfaitement net */
.shop-card.is-locked .shop-card-actions {
    filter: none !important;
    opacity: 1 !important;
}

/* Bouton spécifique "Me prévenir" */
.btn-restock-notify {
    pointer-events: auto !important;
    cursor: pointer;
    background: #1a1a1a !important;
    border-color: #333 !important;
}

.btn-restock-notify.success {
    background: #28a745 !important;
    border-color: #28a745 !important;
}

.shop-locked-bar {
    background: transparent;
    color: #ff2a2a; /* Rouge néon ultra vif */
    font-family: 'Pricedown', 'Impact', sans-serif;
    font-weight: normal;
    text-transform: lowercase;
    font-size: clamp(3rem, 7vw, 4.5rem);
    letter-spacing: 2px;
    padding: 0;
    margin: 0;
    text-align: center;
    width: 100%;
    z-index: 50;
    position: absolute;
    top: 110px; /* Pile au centre vertical (media = 220px) */
    left: 50%;
    
    /* Dynamisme incliné du sticker et centrage horizontal/vertical */
    transform: translate(-50%, -50%) rotate(-4deg) scale(1.05);
    
    /* Bordure interne blanche MASSIVE dessinée sur l'extérieur des lettres */
    paint-order: stroke fill;
    -webkit-text-stroke: 10px #fff; 
    
    /* Filtres vectoriels pour la bordure noire et le léger halo rouge */
    filter: 
        drop-shadow(4px 0px 0px #111)
        drop-shadow(-4px 0px 0px #111)
        drop-shadow(0px 4px 0px #111)
        drop-shadow(0px -4px 0px #111)
        drop-shadow(0px 2px 0px #111)
        drop-shadow(0px 10px 15px rgba(255, 42, 42, 0.15));
        
    text-shadow: none;
    white-space: nowrap;
    overflow: visible; /* On laisse le sticker respirer */
    pointer-events: none; /* Ne pas gêner le clic sur la carte */
}

/* --- SHOP ITEM DETAIL (ATELIER PREMIUM) --- */
.shop-item-detail-page {
    background: linear-gradient(180deg, #f7f9fc 0%, #f7f9fc 220px, #ffffff 221px, #ffffff 100%);
}

.shop-item-detail-hero {
    padding: 20px 0 6px;
}

.shop-item-backlink {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Sora', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    color: #4b5563;
    text-decoration: none;
    margin-bottom: 10px;
}

.shop-item-backlink:hover {
    color: #0161bb;
}

.shop-item-detail-hero h1 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: clamp(1.5rem, 2.2vw, 2.5rem);
}

.shop-item-detail-body {
    padding: 12px 0 18px;
}

.shop-item-detail-grid {
    display: grid;
    grid-template-columns: minmax(300px, 500px) minmax(280px, 440px);
    gap: 22px;
    align-items: start;
    justify-content: start;
}

.shop-item-visual-wrap {
    position: sticky;
    top: 96px;
}

.shop-item-visual-frame {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    background: radial-gradient(circle at 20% 0%, #ffffff 0%, #f2f5fa 80%);
    border: 1px solid #e7edf5;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.07);
    padding: 12px;
    min-height: 320px;
}

.shop-item-visual-frame img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 360px;
    display: block;
    object-fit: contain;
}

.shop-item-panel {
    border: 1px solid #e8eef5;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 20px rgba(2, 13, 34, 0.05);
    padding: 18px;
    align-self: start;
}

.shop-item-meta-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.shop-item-meta-left,
.shop-item-meta-right {
    display: flex;
    align-items: center;
}

.shop-item-type {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border: 1px solid #d9e2ef;
    border-radius: 999px;
    font-family: 'Sora', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #334155;
    background: #f8fafc;
}

.shop-item-price {
    margin: 6px 0 10px;
    font-family: 'Sora', sans-serif;
    font-weight: 800;
    font-size: clamp(1.5rem, 2.4vw, 2rem);
    color: #111827;
    letter-spacing: -0.02em;
}

.shop-item-meta-right .shop-badge {
    position: static;
    display: inline-flex;
    box-shadow: none;
}

.shop-item-summary {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #4b5563;
}

.shop-item-panel-actions {
    margin-top: 16px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.shop-item-panel-actions .btn-shop-action {
    display: inline-flex;
}

.shop-item-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #4b5563;
    font-family: 'Sora', sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    padding: 6px 8px;
}

.shop-item-back-btn:hover {
    color: #0161bb;
}

.shop-item-detail-content {
    padding: 4px 0 40px;
}

.shop-item-content-card {
    background: #ffffff;
    border: 1px solid #e8eef5;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 10px 26px rgba(2, 13, 34, 0.05);
}

.shop-item-rich-block + .shop-item-rich-block {
    margin-top: 16px;
}

.shop-item-rich-block + p,
.shop-item-rich-block + h2,
.shop-item-rich-block + h3,
.shop-item-rich-block + ul,
.shop-item-rich-block + ol {
    margin-top: 14px;
}

@media (max-width: 980px) {
    .shop-item-detail-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .shop-item-visual-wrap {
        position: static;
    }

    .shop-item-visual-frame {
        padding: 10px;
        min-height: 260px;
    }

    .shop-item-panel {
        padding: 14px;
    }

    .shop-item-meta-top {
        align-items: flex-start;
    }
}
