/* =========================================================
   BGC CATALOGUE - DESIGN MODERNE (Version Finale Restaurée)
   ========================================================= */

/* --- 1. STRUCTURE GÉNÉRALE --- */
.bgc-catalog-container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 40px 20px;
    background-color: #f8f9fa;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Layout Grille : Sidebar + Contenu */
.bgc-catalog-form {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
    align-items: start;
}

@media (max-width: 900px) {
    .bgc-catalog-form { grid-template-columns: 1fr; gap: 20px; }
}

/* --- 2. BARRE LATÉRALE (FILTRES) --- */
.bgc-catalog-sidebar {
    background: #ffffff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.03);
    border: 1px solid #eef2f6;
    position: sticky;
    top: 20px;
}
.bgc-catalog-sidebar h3 {
    font-size: 18px; font-weight: 700; color: #1e293b;
    margin: 0 0 25px 0; padding-bottom: 15px; border-bottom: 2px solid #f1f5f9;
}
.bgc-filter-widget { margin-bottom: 30px; }
.bgc-filter-widget h4 {
    font-size: 13px; text-transform: uppercase; color: #64748b;
    letter-spacing: 1px; font-weight: 700; margin-bottom: 15px;
}

/* Listes de filtres */
.bgc-filter-list {
    list-style: none !important; padding: 0 !important; margin: 0 !important;
    max-height: 300px; overflow-y: auto;
}
.bgc-filter-list li { margin-bottom: 10px; list-style: none !important; }
.bgc-filter-list label {
    display: flex; align-items: center; gap: 10px; cursor: pointer;
    color: #334155; font-size: 14px; transition: color 0.2s;
}
.bgc-filter-list label:hover { color: #2563eb; }

/* Drapeaux dans Sidebar */
.bgc-flag-svg {
    width: 20px; height: 15px; border-radius: 3px;
    box-shadow: 0 0 2px rgba(0,0,0,0.2); flex-shrink: 0;
    vertical-align: middle; display: inline-block;
}

/* --- 3. TOOLBAR (RECHERCHE & TRI) --- */
.bgc-catalog-toolbar {
    background: #ffffff; padding: 15px 20px; border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.03); border: 1px solid #eef2f6;
    display: flex; flex-wrap: wrap; justify-content: space-between;
    align-items: center; margin-bottom: 30px; gap: 15px;
}
.bgc-catalog-search { flex-grow: 1; position: relative; max-width: 500px; }
.bgc-catalog-search input {
    width: 100%; padding: 12px 20px 12px 45px; border-radius: 50px;
    border: 1px solid #cbd5e1; font-size: 15px; transition: all 0.3s ease;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: 18px center;
}
.bgc-catalog-search input:focus { border-color: #2563eb; outline: none; }
.bgc-catalog-sort select {
    padding: 10px 35px 10px 15px; border-radius: 8px; border: 1px solid #cbd5e1;
    background-color: #fff; font-size: 14px; font-weight: 500; color: #475569; cursor: pointer;
}

/* --- 4. LIVE SEARCH --- */
.bgc-live-results {
    position: absolute; top: 100%; left: 0; right: 0;
    background: #fff; border: 1px solid #e2e8f0; border-top: none;
    border-radius: 0 0 12px 12px; box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    z-index: 999; margin: 0; padding: 0; list-style: none !important;
    display: none; max-height: 350px; overflow-y: auto;
}
.bgc-live-results.active { display: block; }
.bgc-live-results li {
    display: flex; align-items: center; padding: 12px 15px;
    border-bottom: 1px solid #f8fafc; cursor: pointer; margin: 0 !important;
}
.bgc-live-results li:hover { background-color: #f1f5f9; }
.bgc-live-results img {
    width: 40px; height: 40px; object-fit: cover; border-radius: 6px;
    margin-right: 12px; border: 1px solid #eee;
}

/* =========================================================
   5. GRILLE PRODUITS (CARDS)
   ========================================================= */

/* Force l'ID pour priorité max sur le thème */
#bgc-catalog-grid ul.bgc-grid-catalog.products {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)) !important;
    gap: 25px !important;
    list-style: none !important; padding: 0 !important; margin: 0 !important;
}

/* La Carte Produit */
#bgc-catalog-grid ul.bgc-grid-catalog.products > li.product {
    display: flex !important; flex-direction: column !important;
    background: #ffffff; border-radius: 16px; border: 1px solid #f1f5f9;
    overflow: hidden; transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative; height: 100%; padding: 0 !important; margin: 0 !important;
    width: auto !important; list-style: none !important;
}
#bgc-catalog-grid ul.bgc-grid-catalog.products > li.product:hover {
    transform: translateY(-5px); box-shadow: 0 15px 30px rgba(0,0,0,0.08); border-color: #bfdbfe;
}

/* Zone Image */
.bgc-card-media {
    padding: 20px; background: #ffffff; display: flex;
    align-items: center; justify-content: center; height: 220px;
    position: relative; border-bottom: 1px solid #f8fafc;
}
.bgc-card-media a {
    display: flex !important; width: 100%; height: 100%;
    align-items: center; justify-content: center; text-decoration: none !important; border:none !important;
}
.bgc-card-media img {
    max-height: 100%; width: auto; max-width: 100%;
    object-fit: contain; filter: drop-shadow(0 5px 10px rgba(0,0,0,0.05));
    transition: transform 0.3s ease;
}
.bgc-card-catalog:hover .bgc-card-media img { transform: scale(1.05); }

/* Corps */
.bgc-card-body {
    padding: 15px 20px 20px; display: flex; flex-direction: column; flex-grow: 1;
}
.bgc-title {
    font-size: 16px; font-weight: 700; color: #1e293b; margin-bottom: 5px;
    line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden; min-height: 44px;
}
.bgc-credits {
    font-size: 12px; 
    color: #94a3b8; 
    margin-bottom: 15px;
    /* Allow wrapping */
    white-space: normal;       
    /* Optional: limit to 2 lines if you want to keep cards uniform */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

/* Ensure individual items break correctly */
.bgc-meta {
    display: inline-block; /* Allows wrapping between designer/artist */
    margin-right: 8px;
    white-space: normal; /* Allows names inside to wrap */
}

.bgc-price {
    font-size: 18px; font-weight: 800; color: #0f172a;
    margin-top: auto; margin-bottom: 15px;
}

/* Boutons */
.bgc-actions a.button {
    width: 100%; display: block !important; text-align: center;
    padding: 10px !important; border-radius: 8px !important;
    font-weight: 600 !important; font-size: 14px !important;
    margin-top: 5px; text-decoration: none !important;
}
.bgc-btn--addtocart { background-color: #2563eb !important; color: white !important; }
.bgc-btn--addtocart:hover { background-color: #1d4ed8 !important; }
.bgc-btn--preorder { background-color: #7c3aed !important; color: white !important; }
.bgc-btn--preorder:hover { background-color: #6d28d9 !important; }

/* Bouton Soon (Grisé) */
.bgc-button-disabled,
.woocommerce ul.products li.product .button.bgc-button-disabled {
    background-color: #e2e8f0 !important; 
    color: #94a3b8 !important;
    cursor: default !important; 
    box-shadow: none !important;
    border: 1px solid #cbd5e1 !important;
    pointer-events: none;
}

/* BADGES (Conteneur et Badges) - RESTAURÉ */
.bgc-badges-container {
    position: absolute; top: 15px; left: 15px; 
    display: flex; flex-direction: column; align-items: flex-start; gap: 5px; z-index: 10;
}

.bgc-badge-preorder, .bgc-badge-available, .bgc-badge-soon, .bgc-badge-promo {
    position: static !important; /* Annule le top/left individuel */
    padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 800;
    text-transform: uppercase; letter-spacing: 0.5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.bgc-badge-available { background: #d1fae5; color: #065f46; }
.bgc-badge-preorder { background: #fef3c7; color: #92400e; }
.bgc-badge-soon { background: #f1f5f9; color: #475569; }
.bgc-badge-promo { background: #ec4899; color: white; border: 1px solid #db2777; }

/* --- 6. LOADING SPINNER --- */
#bgc-infinite-loader { margin: 40px 0; font-weight: 600; color: #64748b; }
.bgc-spinner { border: 3px solid rgba(37, 99, 235, 0.1); border-top-color: #2563eb; }

/* CHIPS DRAPEAUX (Catalogue) - RESTAURÉ */
.bgc-langchips { 
    display: flex; flex-wrap: wrap; gap: 6px; 
    margin-top: 10px; padding-top: 10px; border-top: 1px solid #f1f5f9; 
}
.bgc-chip {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 8px; border-radius: 4px; background: #f1f5f9; border: 1px solid #e2e8f0;
    font-size: 11px; color: #64748b; font-weight: 600; white-space: nowrap;
}
.bgc-chip .bgc-flag-svg {
    width: 16px; height: 12px; border-radius: 2px;
    box-shadow: 0 0 1px rgba(0,0,0,0.2); flex-shrink: 0; display: block;
}