/* ============================================================
   CP Vente Flash — vente-flash.css  v1.1.0
   Reprend les styles de brand-filter pour la grille produits.
   ============================================================ */

/* ---- Layout principal ---- */
.cp-vf-wrap {
    width: 100%;
}

.cp-vf-layout {
    display: flex;
    gap: 36px;
    align-items: flex-start;
    width: 100%;
}

/* ---- Zone produits ---- */
.cp-vf-main {
    flex: 1;
    min-width: 0;
}

/* ---- Grille (identique à brand-filter) ---- */
.cp-vf-products-list {
    display: grid !important;
    grid-template-columns: repeat(var(--cp-bf-cols, 3), 1fr) !important;
    gap: 24px !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.cp-vf-products-list > li.product {
    margin: 0 !important;
    float: none !important;
    width: auto !important;
    clear: none !important;
    padding-bottom: 0 !important;
}

/* Masquer le bouton flottant Astra */
.cp-vf-products-list li.product .ast-on-card-button,
.cp-vf-products-list li.product .ast-on-card-button:hover {
    display: none !important;
}

.cp-vf-products-list li.product .astra-shop-thumbnail-wrap::before,
.cp-vf-products-list li.product .astra-shop-thumbnail-wrap::after {
    display: none !important;
    background: transparent !important;
}

/* Bouton ajouter au panier natif (caché, remplacé par cp-vf-add-wrap) */
.cp-vf-products-list li.product > a.button,
.cp-vf-products-list li.product > .add_to_cart_button {
    display: none !important;
}

/* ---- Prix flash ---- */
.cp-vf-price-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cp-vf-price-wrap del {
    color: #aaa;
    font-size: 13px;
}

.cp-vf-price-wrap ins {
    text-decoration: none;
    color: #c40000;
    font-size: 20px;
    font-weight: 700;
}

.cp-vf-discount-badge {
    display: inline-block;
    background: #c40000;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    width: fit-content;
}

/* ---- Stock ---- */
.cp-vf-stock-count {
    font-size: 12px;
    color: #666;
    display: block;
    margin-top: 4px;
}

.cp-vf-stock-empty {
    font-size: 12px;
    font-weight: 700;
    color: #c40000;
    text-transform: uppercase;
    display: block;
    margin-top: 4px;
}

.cp-vf-stock-bar {
    height: 4px;
    background: #eee;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 4px;
    width: 100%;
}

.cp-vf-stock-fill {
    height: 100%;
    background: #c40000;
    border-radius: 2px;
    transition: width .3s ease;
}

/* ---- Bouton ajout au panier custom ---- */
.cp-vf-add-wrap {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
    width: 100%;
}

.cp-vf-qty-wrap {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    overflow: hidden;
    flex-shrink: 0;
    height: 50px;
}

.cp-vf-qty-btn {
    width: 32px;
    height: 50px;
    background: #f5f5f5;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #333;
    transition: background .15s;
    line-height: 1;
}

.cp-vf-qty-btn:hover { background: #eee; }

.cp-vf-qty-input {
    width: 40px;
    height: 50px;
    border: none;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
    text-align: center;
    font-size: 14px;
    -moz-appearance: textfield;
}

.cp-vf-qty-input::-webkit-outer-spin-button,
.cp-vf-qty-input::-webkit-inner-spin-button { -webkit-appearance: none; }

.cp-vf-add-btn {
    flex: 1;
    height: 50px !important;
    background-color: #000 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 0 !important;
    font-family: inherit !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    cursor: pointer !important;
    transition: background .2s ease !important;
    padding: 0 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
}

.cp-vf-add-btn:hover { background-color: #ECE8DD !important; color: #000 !important; }

.cp-vf-add-btn--loading { background-color: #666 !important; pointer-events: none !important; }

.cp-vf-add-btn--disabled {
    width: 100% !important;
    height: 50px !important;
    background: #e0e0e0 !important;
    color: #888 !important;
    border: none !important;
    border-radius: 0 !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    cursor: not-allowed !important;
    margin-top: 8px !important;
}

/* Notice succès/erreur */
.cp-vf-notice {
    padding: 8px 12px;
    margin-top: 6px;
    font-size: 12px;
    border-radius: 3px;
}

.cp-vf-notice--error   { background: #fde8e8; color: #c40000; border-left: 3px solid #c40000; }
.cp-vf-notice--success { background: #e8f5e9; color: #2e7d32; border-left: 3px solid #2e7d32; }

/* ---- Mini Panier ---- */
.cp-vf-cart {
    flex: 0 0 300px;
    position: sticky;
    top: 100px;
    background: #fff;
    border: 1px solid #eee;
    box-shadow: 0 4px 20px rgba(0,0,0,.06);
}

.cp-vf-cart-header {
    padding: 14px 18px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #000;
    color: #fff;
}

.cp-vf-cart-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #fff;
}

.cp-vf-cart-count { font-size: 12px; opacity: .8; }

.cp-vf-cart-items {
    padding: 14px 18px;
    max-height: 360px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cp-vf-cart-empty {
    color: #aaa;
    font-size: 13px;
    text-align: center;
    padding: 16px 0;
    margin: 0;
}

.cp-vf-cart-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.cp-vf-cart-item:last-child { border-bottom: none; padding-bottom: 0; }

.cp-vf-cart-item-img {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    overflow: hidden;
    background: #fafafa;
}

.cp-vf-cart-item-img img { width: 100%; height: 100%; object-fit: contain; }

.cp-vf-cart-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cp-vf-cart-item-name { font-size: 12px; font-weight: 600; line-height: 1.3; }
.cp-vf-cart-item-qty  { font-size: 11px; color: #aaa; }
.cp-vf-cart-item-price { font-size: 13px; font-weight: 700; color: #c40000; }

.cp-vf-cart-remove {
    width: 22px;
    height: 22px;
    background: #f0f0f0;
    border: none;
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    color: #888;
    flex-shrink: 0;
    transition: background .15s, color .15s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.cp-vf-cart-remove:hover { background: #c40000; color: #fff; }

.cp-vf-cart-footer {
    padding: 14px 18px;
    border-top: 1px solid #eee;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cp-vf-cart-total {
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cp-vf-cart-total strong { font-size: 16px; }

.cp-vf-checkout-btn {
    display: block;
    width: 100%;
    padding: 13px;
    background: #c40000;
    color: #fff;
    text-align: center;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: background .2s ease;
    box-sizing: border-box;
}

.cp-vf-checkout-btn:hover { background: #a00000; color: #fff; }

/* Page inactive */
.cp-vf-inactive {
    padding: 48px 20px;
    text-align: center;
    color: #aaa;
    font-size: 16px;
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
    .cp-vf-layout { gap: 24px; }
    .cp-vf-cart   { flex: 0 0 260px; }
}

@media (max-width: 680px) {
    .cp-vf-layout { flex-direction: column; }
    .cp-vf-cart   { position: static; flex: none; width: 100%; }
    .cp-vf-products-list { grid-template-columns: 1fr !important; }
}