/* ==========================================================================
   Marketplace SV Catalog Engine v1.0.0 — Estilos Comerciales y Móviles
   Compatible con Kadence, WooCommerce y WP Rocket
   ========================================================================== */

/* 1. Defensa visual en profundidad: ocultar mini-carrito de cabecera y botones residuales de compra */
.site-header-cart,
.header-cart-wrap,
.kadence-cart-toggle,
.header-mobile-cart-wrap,
.wp-block-woocommerce-mini-cart,
.wp-block-woocommerce-product-button,
.woocommerce div.product form.cart .single_add_to_cart_button,
.woocommerce div.product form.cart .quantity,
.woocommerce ul.products li.product .add_to_cart_button,
.woocommerce ul.products li.product .ajax_add_to_cart {
    display: none !important;
}

/* 2. Franja superior de Estado + Referencia en ficha individual */
.mpsv-meta-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px 0;
}

.mpsv-status-badge,
.mpsv-loop-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1.2;
    padding: 5px 11px;
    border-radius: 999px;
    text-transform: uppercase;
}

.mpsv-loop-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 5;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.16);
}

.mpsv-status--disponible {
    background-color: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.mpsv-status--reservado {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

.mpsv-status--vendido {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.mpsv-status--no_disponible {
    background-color: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
}

.mpsv-ref-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12.5px;
    color: #334155;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 4px 10px;
    border-radius: 999px;
}

.mpsv-price-note-pill {
    display: inline-flex;
    align-items: center;
    font-size: 12.5px;
    font-weight: 600;
    color: #1e40af;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    padding: 4px 10px;
    border-radius: 999px;
}

/* 3. Tarjeta de acciones comerciales en ficha individual */
.mpsv-commercial-card {
    margin: 18px 0 22px 0;
    padding: 18px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mpsv-sold-notice,
.mpsv-reserved-notice,
.mpsv-unavailable-notice {
    margin: 0;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.45;
}

.mpsv-sold-notice {
    background: #fef2f2;
    color: #991b1b;
    border-left: 4px solid #dc2626;
}

.mpsv-reserved-notice {
    background: #fffbeb;
    color: #92400e;
    border-left: 4px solid #f59e0b;
}

.mpsv-unavailable-notice {
    background: #f1f5f9;
    color: #334155;
    border-left: 4px solid #64748b;
}

/* 4. Botones comerciales accesibles (mínimo 48px táctil en móvil) */
.mpsv-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 15.5px;
    font-weight: 700;
    line-height: 1.25;
    text-decoration: none !important;
    cursor: pointer;
    border: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
    text-align: center;
}

.mpsv-btn--whatsapp {
    background-color: #16a34a;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(22, 163, 74, 0.25);
}

.mpsv-btn--whatsapp:hover,
.mpsv-btn--whatsapp:focus {
    background-color: #15803d;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(22, 163, 74, 0.32);
}

.mpsv-btn--assistant {
    background-color: #0f172a;
    color: #ffffff !important;
}

.mpsv-btn--assistant:hover,
.mpsv-btn--assistant:focus {
    background-color: #1e293b;
    color: #ffffff !important;
}

.mpsv-btn--card {
    width: 100%;
    min-height: 42px;
    padding: 9px 14px;
    font-size: 14px;
    font-weight: 600;
    background: #0f172a;
    color: #ffffff !important;
    border-radius: 8px;
}

.mpsv-btn--card:hover {
    background: #1e293b;
    color: #ffffff !important;
}

.mpsv-loop-actions {
    margin-top: 10px;
}

/* 5. Barra de compartir publicación */
.mpsv-share-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding-top: 6px;
    border-top: 1px solid #e2e8f0;
}

.mpsv-share-bar__label {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
}

.mpsv-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 34px;
    padding: 5px 11px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #1e293b !important;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none !important;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.mpsv-share-btn:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.mpsv-copy-feedback {
    font-size: 12.5px;
    font-weight: 600;
    color: #15803d;
}

/* 6. Sección de video promocional */
.mpsv-video-section {
    margin: 28px 0;
    padding: 20px;
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
}

.mpsv-video-section__title {
    margin: 0 0 14px 0;
    font-size: 20px;
}

.mpsv-video-embed {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 10px;
}

.mpsv-video-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.mpsv-video-player video {
    width: 100%;
    max-height: 540px;
    border-radius: 10px;
    background: #000000;
}

/* 7. Barra fija inferior en dispositivos móviles */
.mpsv-mobile-sticky {
    display: none;
}

@media (max-width: 767px) {
    body.single-product {
        padding-bottom: 78px;
    }

    .mpsv-mobile-sticky {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 99980;
        background: rgba(255, 255, 255, 0.97);
        backdrop-filter: blur(8px);
        border-top: 1px solid #cbd5e1;
        box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.08);
        padding: 10px 14px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
    }

    /* Elevar la burbuja flotante del chat en móvil cuando existe barra inferior de producto */
    body.single-product #vites-chat-widget-root {
        bottom: 82px !important;
    }

    .mpsv-mobile-sticky__info {
        display: flex;
        flex-direction: column;
        min-width: 0;
    }

    .mpsv-mobile-sticky__price {
        font-size: 16px;
        color: #0f172a;
        line-height: 1.2;
    }

    .mpsv-mobile-sticky__ref {
        font-size: 11.5px;
        color: #64748b;
    }

    .mpsv-btn--compact {
        min-height: 44px;
        padding: 9px 16px;
        font-size: 14.5px;
        white-space: nowrap;
    }
}
